In SAS® Enterprise Miner™, you can build flows that modify variables, and that generate interactions. When a variable is modified, a new variable is created, and the new-variable name contains a suffix or prefix that describes the modification. If the new variable is subsequently modified, then the additional new-variable names are also longer. Nodes that generate interactions create new variables that are a combination of variable names that are used in the interaction.
It is possible for a series of modifications and interactions to create a new-variable name that would exceed the 32-character limit in SAS®. To prevent exceeding the limit, new-variable names are truncated at 32 characters. When multiple new-variable names are truncated, the names might not be unique. When non-unique names are present, score code that uses those names can generate incorrect scores. The scores are not correct because values are overwritten instead of being unique.
There are no errors or warnings to indicate a problem.
To avoid the problem, consider manually creating new variable names when automatically generated names are long and non-unique in the first few characters. Manually create shorter names before automatically generating interactions. Or, click the Full Code tab, and run the SAS code in a SAS Code node.
Click the Hot Fix tab in this note to access the hot fix for this issue.
Product Family | Product | System | Product Release | SAS Release | ||
Reported | Fixed* | Reported | Fixed* | |||
SAS System | SAS Enterprise Miner | 64-bit Enabled AIX | 5.1 | 9.1 TS1M3 | ||
Windows Vista | 5.1 | 9.1 TS1M3 | ||||
Windows Vista for x64 | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows XP Professional | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows Server 2003 Standard Edition | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows NT Workstation | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows 2000 Professional | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows 2000 Server | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows 2000 Datacenter Server | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows 2000 Advanced Server | 5.1 | 9.1 TS1M3 | ||||
Microsoft® Windows® for x64 | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows XP 64-bit Edition | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 5.1 | 9.1 TS1M3 | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 5.1 | 9.1 TS1M3 | ||||
z/OS | 5.1 | 9.1 TS1M3 | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 5.1 | 9.1 TS1M3 | ||||
64-bit Enabled HP-UX | 5.1 | 9.1 TS1M3 | ||||
64-bit Enabled Solaris | 5.1 | 9.1 TS1M3 | ||||
HP-UX IPF | 5.1 | 9.1 TS1M3 | ||||
Linux | 5.1 | 9.1 TS1M3 | ||||
Tru64 UNIX | 5.1 | 9.1 TS1M3 |
/*
07JUN2019
Run this code in a SAS Code node to remap variable names in the event that they become too long.
The code dynamically renames all input variables.
A macro variable named PREFIX enables you to control the names of the new mapping variables.
When using this code, set the Publish Code property on the SAS Code node to "Flow".
Do not use this code if an Ensemble node is downstream.
The code can cause incorrect results from the Ensemble node (the predicted values are constants).
See SAS Note 64290: "Ensemble node results might be incorrect when a Drop node has both Drop From Tables and Hidden set to Yes".
http://support.sas.com/kb/64290
The code corrects only non-optimized score-code.
The optimized score-code is not corrected.
SAS Institute Inc.
License Agreement for Corrective Code or Additional Functionality
SAS INSTITUTE INC. IS PROVIDING YOU WITH THE COMPUTER SOFTWARE CODE INCLUDED
WITH THIS AGREEMENT ("CODE") ON AN "AS IS" BASIS, AND AUTHORIZES YOU TO USE THE
CODE SUBJECT TO THE TERMS HEREOF. BY USING THE CODE, YOU AGREE TO THESE TERMS.
YOUR USE OF THE CODE IS AT YOUR OWN RISK. SAS INSTITUTE INC. MAKES NO
REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT
AND TITLE, WITH RESPECT TO THE CODE.
The Code is intended to be used solely as part of a product ("Software") you
currently have licensed from SAS Institute Inc. or one of its subsidiaries or
authorized agents ("SAS"). The Code is designed to either correct an error in
the Software or to add functionality to the Software, but has not necessarily
been tested. Accordingly, SAS makes no representation or warranty that the Code
will operate error-free. SAS is under no obligation to maintain or support the
Code.
Neither SAS nor its licensors shall be liable to you or any third party for any
general, special, direct, indirect, consequential, incidental or other damages
whatsoever arising out of or related to your use or inability to use the Code,
even if SAS has been advised of the possibility of such damages.
Except as otherwise provided above, the Code is governed by the same agreement
that governs the Software. If you do not have an existing agreement with SAS
governing the Software, you may not use the Code.
SAS and all other SAS Institute Inc. product or service names
are registered trademarks or trademarks of SAS Institute Inc. in the USA and
other countries. (r) indicates USA registration. Other brand and product names
are registered trademarks or trademarks of their respective companies.
*/
%let prefix = MAP_;
/* Create Mapping score code */
filename _frf "&EM_FILE_EMFLOWSCORECODE";
data _null_;
length string $1000 newvar $32;
set &em_data_variableset;
where ROLE='INPUT' and creator ne '';
file _frf;
newvar = "&prefix"!!strip(put(_N_, best.));
if type = 'N' then
string = 'length '!!trim(newvar)!!' 8;';
else
string = 'length '!!trim(newvar)!!' $'!!strip(put(length, best.))!!';';
put string;
if label ne '' then do;
string = 'label '!!trim(newvar)!!' = "'!!strip(tranwrd(label, '"', '""'))!!'";';
put string;
end;
if format ne '' then do;
string = 'format '!!trim(newvar)!!' '!!strip(format)!!';';
put string;
end;
string =trim(newvar)!!' = '!!trim(name)!!';';
put string;
string = 'drop '!!trim(name)!!';';
put string;
run;
filename _frf2 "&EM_FILE_EMPUBLISHSCORECODE";
data _null_;
file _frf2;
infile _frf;
input;
put _infile_;
run;
filename _frf2;
filename _frf;
/* Create Delta Code to reject long name variables and assign
role and level to the mapped variables.
*/
filename _frf "&EM_FILE_CDELTA_TRAIN";
data _null_;
length string $1000 newvar $32;
set &em_data_variableset end=eof;
where ROLE='INPUT' and creator ne '';
file _frf;
string ='if NAME="'!!tranwrd(trim(name), '"', '""')!!'" then ROLE = "REJECTED";';
put string;
if ^eof then put 'else ';
newvar = "&prefix"!!strip(put(_N_, best.));
string ='if NAME="'!!tranwrd(trim(newvar), '"', '""')!!'" then do;';
put string;
string = ' ROLE = "INPUT";';
put string;
string = ' LEVEL = "'!!strip(level)!!'";';
put string;
put 'end;';
if ^eof then put 'else ';
run;
filename _frf;
A fix for this issue for SAS Enterprise Miner 15.1 is available at:
https://tshf.sas.com/techsup/download/hotfix/HF2/E5I.html#64200A fix for this issue for SAS Enterprise Miner 14.3 is available at:
https://tshf.sas.com/techsup/download/hotfix/HF2/B8M.html#64200Type: | Problem Note |
Priority: | alert |
Date Modified: | 2019-08-28 09:36:16 |
Date Created: | 2019-05-15 09:31:48 |