SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 31850: Using the LENGTH statement might produce a warning and RC=4

DetailsCodeHotfixAboutRate It

A new warning message is produced when the length of a variable changes, with or without a LENGTH statement. The SYSRC is set to 4.

WARNING: Multiple lengths were specified for the variable VOLTYPE by input data set(s). This might cause truncation of data.

When the length of a variable is shortened, data truncation might occur.

SAS® sessions that check the return code now return rc=4 when a LENGTH statement is used to change the length of character variables and some numeric variables.

Explanation

Placing a LENGTH statement immediately after the DATA statement is a standard practice for changing the length of a variable on the input data set(s).

Character variable length is set in the program data vector (PDV) by the length found in the first reference in the DATA step code.

Numeric variables are defined in the PDV as 8 bytes. The length of a numeric variable is determined by the last reference to the variable in the DATA step. The length is set when the variable is written to the output data set.

Solution details for SAS 9.2 TS2M0

Note: A new option has been implemented that turns this behavior on and off.

For more information, see VARLENCHK= System Option in the SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition.

To get the same behavior as SAS 9.1.3, use the following:

   options varlenchk=nowarn; 

The new VARLENCHK option does not affect variables in the BY statement. For more information, see

Note 37102: The VARLENCHK= system option excludes BY variables.

Solution details for SAS 9.2 TS1M0

The hot fix turns off the warning and does not set return code, restoring the SAS 9.1.3 behavior.

Click the Hot Fix tab in this note to access the hot fix.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASz/OS9.2 TS1M09.2 TS2M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS1M09.2 TS2M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS1M09.2 TS2M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS1M09.2 TS2M0
Microsoft Windows XP 64-bit Edition9.2 TS1M09.2 TS2M0
Microsoft® Windows® for x649.2 TS1M09.2 TS2M0
Microsoft Windows 2000 Advanced Server9.2 TS1M0
Microsoft Windows 2000 Datacenter Server9.2 TS1M0
Microsoft Windows 2000 Server9.2 TS1M0
Microsoft Windows 2000 Professional9.2 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS1M09.2 TS2M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS1M09.2 TS2M0
Microsoft Windows Server 2003 Standard Edition9.2 TS1M09.2 TS2M0
Microsoft Windows XP Professional9.2 TS1M09.2 TS2M0
Windows Vista9.2 TS1M09.2 TS2M0
64-bit Enabled AIX9.2 TS1M09.2 TS2M0
64-bit Enabled HP-UX9.2 TS1M09.2 TS2M0
64-bit Enabled Solaris9.2 TS1M09.2 TS2M0
HP-UX IPF9.2 TS1M09.2 TS2M0
Linux9.2 TS1M09.2 TS2M0
Linux for x649.2 TS1M09.2 TS2M0
OpenVMS on HP Integrity9.2 TS1M09.2 TS2M0
Solaris for x649.2 TS1M09.2 TS2M0
* 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.