routine to find byte count of a fixed block file dynamic



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: routine to find byte count of a fixed block file dynamic

Postby Robert Sample » Wed Apr 21, 2010 11:06 pm

I am not aware of any circumstances on a mainframe where the situation you describe makes sense or returns a valid count.

Fixed length records are that length, period. Nothing is added to them. If the LRECL is 40, the correct byte count will be 40 times the number of records. If the LRECL is 85, the correct byte count will be 85 times the number of records. If the LRECL is 32760, the correct byte count is 32760 times the number of records.

Variable length files have an additional 4-byte field at the beginning of each block (called the block descriptor word) and a 4-byte record descriptor word at the beginning of each record but not two bytes. Of course, with variable length records you have to sum the record lengths to get the correct byte count.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: routine to find byte count of a fixed block file dynamic

Postby dick scherrer » Wed Apr 21, 2010 11:34 pm

One more time. . . .

How will this byte count be used?


iam trtying to dynamically allocate a byte count and record count file for a 2 input files.
How does one allocate "a byte count"? If what you want to do was working, what then?

Keep in mind that you completely understand what you believe you want to do. We are still trying to understand this. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post