Good Day.
I am trying to upload txt file with more than 800 columns.
I have a SAS script :
filename fln "C:\file.txt";
DATA WORK.tableA;
....
RUN; filename fln;
But I get an error
ERROR: The submitted line exceeds maximum line length - 32768 bytes.
Help please.
Sounds like the source file for your program has lines that are way too long.
Perhaps the end of line characters got removed?
There is no need for any source code lines to be anywhere near 32K bytes long. In fact to make them readable by humans you should try to limit your source lines to 80 characters or less.
If you have lines of text that represent data then put them in a separate file rather than using inline data (CARDS or DATALINES statements). It appears that you might be trying to do that with the FILENAME statement that you posted.
Note that to read lines of data that is longer 32K you will need to use the LRECL option on the INFILE statement.
Sounds like the source file for your program has lines that are way too long.
Perhaps the end of line characters got removed?
There is no need for any source code lines to be anywhere near 32K bytes long. In fact to make them readable by humans you should try to limit your source lines to 80 characters or less.
If you have lines of text that represent data then put them in a separate file rather than using inline data (CARDS or DATALINES statements). It appears that you might be trying to do that with the FILENAME statement that you posted.
Note that to read lines of data that is longer 32K you will need to use the LRECL option on the INFILE statement.
I agree with Tom here, 800 columns is not a useable format. Return to the source and ask them to provide a useable dataset, you can use CSV, but break it up or normalize the data.
Thanks to everyone for help.
The reason was in code: it was generating automatically in the same line. When I added line breaks the problem has gone.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.