SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 58175: The CATX function can produce unexpected results when used in DS2

DetailsHotfixAboutRate It

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.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASHP-UX IPF9.4 TS1M09.4 TS1M4
64-bit Enabled Solaris9.4 TS1M09.4 TS1M4
64-bit Enabled AIX9.4 TS1M09.4 TS1M4
Windows 7 Professional x649.4 TS1M09.4 TS1M4
Windows 7 Enterprise x649.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 Std9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 R2 Std9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 R2 Datacenter9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2012 Datacenter9.4 TS1M09.4 TS1M4
Microsoft Windows Server 2008 for x649.4 TS1M09.4 TS1M4
Microsoft Windows Server 2008 R29.4 TS1M09.4 TS1M4
Microsoft Windows 109.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Pro x649.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Pro 32-bit9.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Enterprise x649.4 TS1M09.4 TS1M4
Microsoft Windows 8.1 Enterprise 32-bit9.4 TS1M09.4 TS1M4
Microsoft Windows 8 Pro x649.4 TS1M09.4 TS1M4
Microsoft Windows 8 Enterprise x649.4 TS1M09.4 TS1M4
Microsoft® Windows® for x649.4 TS1M09.4 TS1M4
z/OS 64-bit9.4 TS1M09.4 TS1M4
z/OS9.4 TS1M09.4 TS1M4
Linux for x649.4 TS1M09.4 TS1M4
Solaris for x649.4 TS1M09.4 TS1M4
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.