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

Submitted code contains lines longer than 6000 characters. SAS is unable to process lines longer than 6000 characters. Your submission has been aborted.

important for my uses, however, are only the first 120 characters of each line anyway. Is there a way I can tell SAS to only run as many characters in a data line as it is able, and simply missover the rest?

A code sample is as follows:


options ls=250 /*NOCARDIMAGE*/;
data testing;
length reading $120.;
input reading $ &&;
cards;
[1] Some Social Requisites of Democracy: Economic Development and Political Legitimacy Seymour Martin Lipset , 53, 1 (Mar., 1959), 69-105n AssociationnStable /1951731 .15:57nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n Association is collaborating with
[2] An Economic Theory of Alliancesn Mancur Olson, Jr. and Richard Zeckhausern The Review of Economics and Statistics, 48, 3 (Aug., 1966), 266-279n The MIT PressnStable /1927082 .15:12nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n The MIT Press is collaborating with to digitize, preserve and extend access to The Review ofn Economics and
[3] Pressure Groups and the Pattern of Tariffsn J. J. Pincusn of Political Economy, 83, 4 (Aug., 1975), 757-778n The University of Chicago PressnStable /1830398 .14:47nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n The University of Chicago Press is collaborating with to

 

...

;

proc contents;

run;

Thanks for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Don't do that. Why would you even think to try to do that?

 

Put the source text into a text file and read it from there.

In-line data is for small things that you can actually put in-line in your program.

View solution in original post

6 REPLIES 6
yabwon
Onyx | Level 15

Hi,

 

How about setting the proper length first:

length reading $ 6000;

?

 

All the best

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Shmuel
Garnet | Level 18

In your data there are lines starting as:

[1] Some Social Requisites of Democracy: .......
[2] An Economic Theory of Alliancesn Mancur Olson,...........
[3] Pressure Groups and the Pattern of ....

are those numbers [1], [2], ... part of the data or just added for test?

Would you use '[' as a delimiter between data-lines?

On what OS is SAS installed? and what are the file attributes - block length, record length? is it a record fix length or a record variable length? 

 

beyond, have you tried reading the file by code like:

data want;
   infile "<path and name>" truncover ;
   input start_line $char120.;
run;
Kurt_Bremser
Super User

I would never swamp my code with so much data. It is much easier to keep the text in a separate text file and read it from there with a proper lrecl.

SAS has certain limits when reading code from a program file and the Enhanced Editor, see Usage Note 15883 

 

PS I found the Usage Note by doing a Google search for "Submitted code contains lines longer than 6000 characters"; see Maxim 6.

playitforward
Calcite | Level 5

Thank you for the tips! Helped a lot.

ChrisNZ
Tourmaline | Level 20

Pasting your code works fine for me.

 

options ls=250 /*NOCARDIMAGE*/;
data testing;
length reading $120.;
input reading $ &&;
cards;
[1] Some Social Requisites of Democracy: Economic Development and Political Legitimacy Seymour Martin Lipset , 53, 1 (Mar., 1959), 69-105n AssociationnStable /1951731 .15:57nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n Association is collaborating with
[2] An Economic Theory of Alliancesn Mancur Olson, Jr. and Richard Zeckhausern The Review of Economics and Statistics, 48, 3 (Aug., 1966), 266-279n The MIT PressnStable /1927082 .15:12nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n The MIT Press is collaborating with to digitize, preserve and extend access to The Review ofn Economics and
[3] Pressure Groups and the Pattern of Tariffsn J. J. Pincusn of Political Economy, 83, 4 (Aug., 1975), 757-778n The University of Chicago PressnStable /1830398 .14:47nYour use of the archive indicates your acceptance of the Terms & Conditions of Use, available at .n/page/info/about/policies/terms.jspn .n is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofncontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsnof scholarship. For more information about , please contact support@.n .n The University of Chicago Press is collaborating with to
;
proc contents;
run;

 

25         options ls=250 /*NOCARDIMAGE*/;
26         data testing;
27         length reading $120.;
28         input reading $ &&;
29         cards;

NOTE: The data set WORK.TESTING has 3 observations and 1 variables.
NOTE: Compressing data set WORK.TESTING increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds

ChrisNZ_0-1646788833356.png

 

 

 

 

Tom
Super User Tom
Super User

Don't do that. Why would you even think to try to do that?

 

Put the source text into a text file and read it from there.

In-line data is for small things that you can actually put in-line in your program.

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 2103 views
  • 0 likes
  • 6 in conversation