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

I'm creating some plain text (ASCII) records in a SAS data step.  I'm running in a UNIX/SAS 9.4/SAS EG 7.1 environment.  When I string everything together, some of these records are over 100,000 bytes long.  UNIX can handle records of that length, but as I recall (and confirmed by what testing I have so far done), SAS has a constraint of no more than 32767 bytes in an output record.

Is there some kind of workaround such that I can create output records longer than 32767 bytes?

 

Thank you,

 

Jim

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

On your file statement just include the lrecl option (e.g., file the_output_filename lrecl=999999;)

 

Art, CEO, AnalystFinder.com

 

View solution in original post

4 REPLIES 4
Reeza
Super User

The LRECL option doesn't override this? The docs say the maximum is 1G under Unix but I don't know what that actually means. 

 

http://support.sas.com/documentation/cdl/en/hostunx/69602/HTML/default/viewer.htm#p0upngkius4n84n17w...

 

Edit: The SAS 'constraint' is just the default value, not an actual constraint. 

art297
Opal | Level 21

On your file statement just include the lrecl option (e.g., file the_output_filename lrecl=999999;)

 

Art, CEO, AnalystFinder.com

 

jimbarbour
Meteorite | Level 14

Thank you to all three of you.  All three of you are right.  I'm going to mark @art297's answer as the solution since it is the most specific in terms of a fix, but all three of you deserve credit, and I thank you.

 

@LinusH, I was aware of the 32767 byte limit for a single variable.  I was confused in thinking that 32767 was a hard constraint for the the LRECL.  Simply setting a value for the LRECL parameter as suggested by @art297 took care of that (I already had multiple 32767 length character variables set up to handle the data).

 

Easiest fix.  Ever.  Thank you, again.

 

Jim

LinusH
Tourmaline | Level 20
When you say "string together" do you mean as in one SAS variable? Then the maximum is as you say 32K.
Then the work around is not to string together but output your data from different variables.
Data never sleeps

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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