BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 876 views
  • 0 likes
  • 4 in conversation