There are many ways to submit SAS® code and the length limitation is different depending on how you submit your code. The following are the length limitations as imposed by the various submission methods prior to SAS® 9.2 and for SAS 9.2 and beyond:
- Submitting a SAS program via a batch file imposes a maximum length limit of 256 characters prior to SAS 9.2. For SAS 9.2 and beyond you can use the new SAS system option of LRECL= to specify a range of 1-32767 to use for reading and writing external files. The default for the LRECL= system option is 256. This option is valid in the configuration file, at SAS invocation, the OPTIONS statement, or the SAS Systems Option window. Under z/OS, the LRECL= system option is recognized only for reading and writing HFS files.
- Submitting a SAS program from the Program Editor imposes a maximum length limit of 384 characters prior to SAS 9.2. For SAS 9.2 and beyond you can use the new SAS system option of DMSPGMLINESIZE= to specify a range of 136-960 to specify the maximum number of characters in a Program Editor line. The default for the DMSPGMLINESIZE= system option is 136. This option is valid in the configuration file or at SAS invocation.
- Submitting a SAS program from the Enhanced Editor imposes a maximum length limit of 960 characters prior to SAS 9.2. For SAS 9.2 and beyond the maximum length is extended to 6,000 characters.
- Submitting SAS code using the IOM submit via the metadata server or a stored process server imposes a maximum length limit of 2,000 characters prior to SAS 9.1. For SAS 9.1 the maximum length limit extends to 6,000 characters. For SAS 9.2 and beyond, the maximum length limit extends to 32,767 characters.
- Submitting SAS code using a %INCLUDE statement imposes a maximum length limit of 2,000 characters prior to SAS 9.1. For SAS 9.1 and beyond the maximum length limit is 6,000 characters. For further information about %INCLUDE, see the following articles:
- Problem Note 4448, "Source code, %INCLUDE records, and DATALINES are truncated at 256 bytes"
- Usage Note 8328, "%INCLUDE of file with LRECL greater than 2000 causes problems"
- Usage Note 39619, "Options you can use on the %INCLUDE statement such as a LRECL= specification"
For specific details under your operating system, see the SAS Companion documentation for your operating environment.