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

routine to find byte count of a fixed block file dynamic

Postby mainframe1 » Tue Apr 20, 2010 7:56 pm

hi,
please help to find the routine to get the byte count of a fixed block mainframe dataset
thanks
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Tue Apr 20, 2010 9:25 pm

Why do you need useless data? And are you wanting exact byte count (which requires counting records) or the approximate byte count which can be estimated using block 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: routije to find byte count of a fixed block file dynamic

Postby dick scherrer » Wed Apr 21, 2010 12:32 am

Hello,

How will this byte count be used?
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

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

Postby mainframe1 » Wed Apr 21, 2010 5:29 pm

to get the byte count of fixed block mainframe PS where lrecl > 80
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Wed Apr 21, 2010 6:16 pm

Number of records X the record length.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby mainframe1 » Wed Apr 21, 2010 7:14 pm

for dynami allocation of files, i have an input files with lrecl 85 and lrecl 40,
the byte count is calcuted as record count*(lrecl+2).
couls u please clarify why its is added 2
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby CICS Guy » Wed Apr 21, 2010 8:32 pm

Re: "routine to find byte count of a fixed block file dynamic"
mainframe1 wrote:for dynami allocation of files, i have an input files with lrecl 85 and lrecl 40...

Fixed block with two lrecls? How do you explain this?
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Wed Apr 21, 2010 8:51 pm

for dynami allocation of files, i have an input files with lrecl 85 and lrecl 40,
the byte count is calcuted as record count*(lrecl+2).
couls u please clarify why its is added 2
Since you haven't explained precisely what you are doing, the platform you are doing it on, nor pretty much anything, there's no way we can tell you the answer. Who (or what) calculated the 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 mainframe1 » Wed Apr 21, 2010 9:29 pm

robert,
iam trtying to dynamically allocate a byte count and record count file for a 2 input files.
theinput files with lrecl 85 and lrecl 40,
the byte count is calcuted as record count*(lrecl+2). as pre-defined in the code
iam getting the byte count +2 fro input file whose lrecl <80 and correct byte count for lrecl>80
couls u please clarify why its is added 2
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby CICS Guy » Wed Apr 21, 2010 9:46 pm

mainframe1 wrote:the byte count is calcuted as record count*(lrecl+2). as pre-defined in the code
Pre-defined by whom?
iam getting the byte count +2 fro input file whose lrecl <80 and correct byte count for lrecl>80
couls u please clarify why its is added 2
The byte count +2 I can understand, but the correct byte count for the larger lrecl is not understandable. How many records in the 40 byte file and how many records in the 85 byte file?
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post