SUPPORT / SAMPLES & SAS NOTES
 

Support

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

DetailsAboutRate It

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."



Operating System and Release Information

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