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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.