![]() | ![]() | ![]() | ![]() |
The VARLENCHK= system option excludes BY variables by design. The VARLENCHK= option is used to specify the type of message written to the SAS log when the length of a variable being read using the SET, MERGE, UPDATE, or MODIFY statement is longer than the length defined for the variable in the Program Data Vector (PDV).
If you are merging two data sets that contain a variable of the same name in both data sets that is not one of the BY variables, and the length of that variable in the second data set named on the merge statement is longer than in the first data set, SAS by default, issues a warning message indicating multiple lengths were specified for this variable and may cause truncation of data.
You can specify the VARLENCHK=NOWARN in an OPTIONS statement prior to the DATA Step to avoid this warning.
When BY variables are defined with different lengths in each of the data sets, SAS issues this warning message:
WARNING: Multiple lengths were specified for the BY variable x by input data sets. This may cause unexpected results.
To avoid the warning message for multiple lengths specified for the BY variable, you must change the length of the BY variable. This can be done by placing a LENGTH statement immediately following the DATA statement and prior to the SET, MERGE, UPDATE, or MODIFY statement with the new desired length of the BY variable.
For more details about the VARLENCHK= option and warning messages regarding multiple lengths being specified, see SAS Note 31850, "Using the LENGTH statement might produce a warning and RC=4."
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | z/OS | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |||
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |||
Microsoft® Windows® for x64 | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |||
Microsoft Windows Server 2008 | 9.2 TS2M0 | |||
Microsoft Windows XP Professional | 9.2 TS2M0 | |||
Windows Vista | 9.2 TS2M0 | |||
64-bit Enabled AIX | 9.2 TS2M0 | |||
64-bit Enabled HP-UX | 9.2 TS2M0 | |||
64-bit Enabled Solaris | 9.2 TS2M0 | |||
HP-UX IPF | 9.2 TS2M0 | |||
Linux | 9.2 TS2M0 | |||
Linux for x64 | 9.2 TS2M0 | |||
OpenVMS on HP Integrity | 9.2 TS2M0 | |||
Solaris for x64 | 9.2 TS2M0 |