IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find LRECL of Variable block Record


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naren_kang

New User


Joined: 27 Feb 2006
Posts: 3
Location: pune

PostPosted: Wed Jul 18, 2007 2:21 pm
Reply with quote

In a cobol program i want to read the length of the VB record before processing it. The first two bytes of a VB file is the length of the record. How do i read first two bytes.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 18, 2007 2:39 pm
Reply with quote

See this previous topic.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jul 18, 2007 2:52 pm
Reply with quote

As far as I can tell, the FM says that "These control fields in the buffer are not available for you to use in your program."

Is there an echo in here?
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Jul 23, 2007 12:49 am
Reply with quote

Hi Narendar,

If you're still out there, or for posterity:

If you use "VARYING FROM 1 TO your-max-rec-length DEPENDING ON WS-REC-LEN" in the FD, where WS-REC-LEN is PIC 9(004), it will contain the length of the variable rec just read.

If you want to WRITE a rec to a vriable length file do the same thing but MOVE the desired len of the rec to WS-REC-LEN before you issue the WRITE.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 7
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top