BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
noobs
Calcite | Level 5

Hello SAS users,

Can somebody please shed light on these two keywords: RECFM and LRECL

The SAS log has following note

Note: The infile '...\sample.dat' is:

File Name = ...\sample.dat

RECFM=V LRECL=256

Seems like it is something to do with Record, however what is V?

Thankfully,

Dhanashree Gadkari

1 ACCEPTED SOLUTION

Accepted Solutions
pali
Fluorite | Level 6

LRECL is logical record length.It denotes the length of input buffer which is created in datastep processing. Data flows from input buffer to pdv to your dataset in datastep processing.

Input buffer holds record of the text file that is being read in a datastep. By default the length if input buffer is 256 bytes (which means if you are reading a file which has more than 256 bytes in a row then you have to increase this limit else SAS will not be able to read complete data from that row).

RECFM can be fixed or it can be Variable. A file's record format is said to be fixed if you can not write more than specified byte in a row. Where as in files like notepad or wordpad you can write as much data in a row as you want. This makes .txt or .dat files as Variable length file.

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

LRECL is Logical RECord length.  How many characters in a line.

RECFM is RECord ForMat. 

V is Variable which means that the lines are not all the same length.  End of line is determined by special characters. Normally a LineFeed (0A base 16) on Unix machines and CarriageReturn and LineFeed (0D0A base 16) on Windows machines.

Read up on JCL to see where these terms come from.  Job Control Language - Wikipedia, the free encyclopedia

noobs
Calcite | Level 5

Got it, well explained.

Do fixed length records get assigned F for RECFM?

pali
Fluorite | Level 6

LRECL is logical record length.It denotes the length of input buffer which is created in datastep processing. Data flows from input buffer to pdv to your dataset in datastep processing.

Input buffer holds record of the text file that is being read in a datastep. By default the length if input buffer is 256 bytes (which means if you are reading a file which has more than 256 bytes in a row then you have to increase this limit else SAS will not be able to read complete data from that row).

RECFM can be fixed or it can be Variable. A file's record format is said to be fixed if you can not write more than specified byte in a row. Where as in files like notepad or wordpad you can write as much data in a row as you want. This makes .txt or .dat files as Variable length file.

Marilyn
Calcite | Level 5

I just use these on the mainframe.  It seems they aren't required as much with PC SAS, etc and I try to stay away from the mainframe when I can Smiley Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 14097 views
  • 4 likes
  • 4 in conversation