Joined: 06 Jun 2008 Posts: 8410 Location: Dubuque, Iowa, USA
We have a requirement to display the no of bytes used in a output dataset.
This is complete and utter rubbish. You need to clarify the requirement before it can be achieved, anyway.
- Are you looking for the number of bytes used by the records in the file? Multiply the record count by the record length. If you don't know how to find the record count, I would HIGHLY recommend you move over to Beginners and Students Forum as you would be unqualified for this professional's forum.
- Are you looking for the number of bytes allocated to the file? The file space is allocated and hence used as far as the system is concerned, but there may be a significant amount of free (as in unused) space in the file (for example, if you allocate an entire 3390-3 disk volume to one file, and the file has one record in it, the used space would be less than 32,000 bytes but the allocated space would be around 2.8 BILLION bytes).
If you don't know which of these numbers you need, then your "requirement" is not defined -- period.
I do know about 'n' records * 'm' record length gives size as 'n*m' bytes..
If I need to get it in an output file through sort which should be similar
to trailer rec count .
I have suceesfully got this out through Eaziretreive code, But I am looking for a simple process .
To get this is there any utility?
JOB INPUT COUNTB +
DEFINE W-BYTE-COUNT W 4 P 0
W-BYTE-COUNT = RECORD-COUNT * 213
DISPLAY "The number of bytes on the file is: " W-BYTE-COUNT
JOB INPUT COUNTB
And look at the output, use a calculator.
I suggested earlier that you use ICETOOL's COUNT operator. It is not far from number of records to bytes.