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.

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 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
  • 2 replies
  • 611 views
  • 0 likes
  • 3 in conversation