Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

RECFM LRECL

Accepted Solution Solved
Reply
Contributor
Posts: 73
Accepted Solution

RECFM LRECL

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


Accepted Solutions
Solution
‎07-08-2013 09:05 AM
Occasional Contributor
Posts: 5

Re: RECFM LRECL

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


All Replies
Super User
Super User
Posts: 7,076

Re: RECFM LRECL

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

Contributor
Posts: 73

Re: RECFM LRECL

Got it, well explained.

Do fixed length records get assigned F for RECFM?

Solution
‎07-08-2013 09:05 AM
Occasional Contributor
Posts: 5

Re: RECFM LRECL

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.

Contributor
Posts: 20

Re: RECFM LRECL

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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