BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

What is the  meaning of using "LRECL=54 recfm=f;"  in  infile statement when I import a file?

 

 

Kind regards

Joe

3 REPLIES 3
ghosh
Barite | Level 11
Fixed length (f) 54 bytes record size
Tom
Super User Tom
Super User

Did you read the documentation?  https://documentation.sas.com/?docsetId=lestmtsref&docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&doc...

 

The LRECL is the Logical Record Length. How many bytes per line (record).

The RECFM is the RECord ForMat. How each line is store.

 

54 means 54 bytes.

F means each record is Fixed length.

 

So in your file every 54 bytes is a record. So you a binary file (although all of the bytes might normal characters) instead of a normal text file.

ballardw
Super User

Maybe looking at the results of this will give you a clue, change the drive to a path where you have read/write privileges:

data _null_;
   file 'd:\text.txt';
   input s :$20.;
   put s;
datalines;
234567890qwertyuiop
ghjkertyuuaddsakka
;
data example;
   infile 'd:\text.txt' lrecl=5 recfm=F;
   input @;
   str=_infile_;
run;

_infile_ is a special temporary SAS variable that holds the contents of the current input buffer.

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1087 views
  • 0 likes
  • 4 in conversation