BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ilya_1991
Fluorite | Level 6

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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.

View solution in original post

4 REPLIES 4
Reeza
Super User
You may have missed a semicolon somewhere I think. Can you post your actual code?
Tom
Super User Tom
Super User

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.  

ilya_1991
Fluorite | Level 6

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. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 4 replies
  • 2376 views
  • 2 likes
  • 4 in conversation