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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2303 views
  • 2 likes
  • 4 in conversation