Hello
What is the meaning of using "LRECL=54 recfm=f;" in infile statement when I import a file?
Kind regards
Joe
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.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.