![]() | ![]() | ![]() | ![]() | ![]() |
The CATX function can produce unexpected results when used within DS2. The CATX function incorrectly appends the delimiter to a missing value. This behavior differs from the documented behavior of the CATX function, which states that blank items do not produce delimiters at the beginning or the end of the result, nor do blank items produce multiple consecutive delimiters.
The example code below illustrates the problem.
proc ds2; data _null_; dcl varchar(100) "X"; dcl varchar(100) "Y"; dcl varchar(100) "Z"; dcl varchar(100) "NEWVAR"; method run(); "X"='TEST'; "Y" = ' '; "Z"='TEST'; "NEWVAR" = catx( '*' , "X","Y" , "Z" ); put "NEWVAR"=; end; enddata; run; quit;
The output of the PUT statement below shows that the CATX function incorrectly lists consecutive delimiters:
"NEWVAR"=TEST**TEST
The delimiter should not be appended to the value because the value of Y is missing.
Click the Hot Fix tab in this note to access the hot fix for this issue.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | HP-UX IPF | 9.4 TS1M0 | 9.4 TS1M4 |
64-bit Enabled Solaris | 9.4 TS1M0 | 9.4 TS1M4 | ||
64-bit Enabled AIX | 9.4 TS1M0 | 9.4 TS1M4 | ||
Windows 7 Professional x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Windows 7 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2012 Std | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows Server 2008 R2 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 10 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Microsoft® Windows® for x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
z/OS 64-bit | 9.4 TS1M0 | 9.4 TS1M4 | ||
z/OS | 9.4 TS1M0 | 9.4 TS1M4 | ||
Linux for x64 | 9.4 TS1M0 | 9.4 TS1M4 | ||
Solaris for x64 | 9.4 TS1M0 | 9.4 TS1M4 |