DATA Step, Macro, Functions and more

LRECL= help

Reply
Contributor
Posts: 61

LRECL= help

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?
Super Contributor
Posts: 474

Re: LRECL= help

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
Super Contributor
Super Contributor
Posts: 3,174

Re: LRECL= help

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.
Ask a Question
Discussion stats
  • 2 replies
  • 143 views
  • 0 likes
  • 3 in conversation