BookmarkSubscribeRSS Feed
chandler
Fluorite | Level 6
Can't find specific rules in the documentation on the use of LRECL=. I don't know the record length of this comma delimited text file, I'm trying to read from the mainframe. If I over estimate the record length, ie. LRECL=1900 when it actually is 1850, will that cause a problem when SAS is reading the file?
2 REPLIES 2
DanielSantos
Barite | Level 11
Hello Chandler.

Is your file blocked or unblocked?

Anyway, if your file is has a variable length record (delimited), you should specify the RECFM=V (or VB for blocked files) option and estimate LRECL has a value larger than the longest record that your expect to read.

Check the online documentation:
http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/chifoptfmain.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You don't want to code LRECL= for an INFILE (not in mainframe JCL or SAS code) -- specify the INFILE parameter COLUM= and use its value (SAS maintains it) to detect where you are in your record for INPUT handling. As Daniel mentioned, if the file is RECFM=V or VB, your records may be of varying length -- however if the file is RECFM=F or FB, you will need to consider whether or not to use techniques to detect the current non-blank values for your variables -- look at MISSOVER and TRUNCOVER options for INFILE.

Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1069 views
  • 0 likes
  • 3 in conversation