View previous topic :: View next topic
|
Author |
Message |
mahe1015
New User
Joined: 19 Dec 2012 Posts: 14 Location: India
|
|
|
|
we have input file which has n no of records with record length m. out requirement is output file should display no bytes used by input file.
Is there any utility to get this output in a JCL. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why do you want to know that?
What type of file is it? Does it contain "variable-length" or "fixed-length" records? |
|
Back to top |
|
|
mahe1015
New User
Joined: 19 Dec 2012 Posts: 14 Location: India
|
|
|
|
We have a requirement to display the no of bytes used in a output dataset.
File is FB. It has fixed length records. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why? Because it's the requirement? Not a very good answer. What is the purpose of the requirement?
If you know the number of records on the file, multiply by the LRECL value.
If you don't, is there something which reads the entire file which you could amend to count the records?
If you don't, have a look at ICETOOL COUNT. Multiply the answer by the LRECL value. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
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. |
|
Back to top |
|
|
mahe1015
New User
Joined: 19 Dec 2012 Posts: 14 Location: India
|
|
|
|
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? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
As you have already gotten this through "Eaziretreive" (sic), why do you need another process? Are you incapable of generalizing that program to meet your needs? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I am in a very good mood today ....
maybe the TS is just the innocent victim of somebody' s stupidity and incompetence
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Utilities do not generaly deal with numbers of bytes. You will need to write code in the language of your choice (however spelled) to achieve your goal. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Easytrieve Plus requires very little code for your task. Do you want to post what you have so far? |
|
Back to top |
|
|
mahe1015
New User
Joined: 19 Dec 2012 Posts: 14 Location: India
|
|
|
|
I have done it through Easytrieve ..
Any there is no chance through Utilities..
Thanks a lot for your assistance |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Something like:
Code: |
FILE COUNTB
JOB INPUT COUNTB +
FINISH DISPLAY-THE-COUNT
DISPLAY-THE-COUNT. PROC
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
END-PROC
|
or
Code: |
FILE COUNTB
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. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
One of the fields in the DCOLLECT output from IDCAMS is the 'number of bytes'. I'm sure there are lots of caveats to using it, but it gives a fair representation:
Code: |
//PS010 EXEC PGM=IDCAMS
//OUTDS DD DSN=&&DCOL,
// DCB=(RECFM=VB,LRECL=644,BLKSIZE=0),
// SPACE=(TRK,(50,50),RLSE),
// DISP=(NEW,PASS)
//* VOLUMES(OSCAR1 OSCAR2 OSCAR3)
//SYSIN DD *
DCOLLECT -
OFILE(OUTDS) -
STORAGEGROUP(XXXXXXXX)
/*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
|
You can do a storage group or volumes, and you might be able to use a datasetname, I don't know.
I follow that step with one that combines all the records by datasetname:
Code: |
//PS020 EXEC PGM=SORT,PARM='MSG=AP'
//SYSIN DD *
INCLUDE COND=(9,1,CH,EQ,C'D')
INREC FIELDS=(1,4,29,44,97,4,117,4)
SORT FIELDS=(5,44,CH,A)
SUM FIELDS=(49,4,BI)
OUTFIL CONVERT,OUTREC=(5,44,C' ',53,4,PD,EDIT=(TTTT/TTT),C' ',
49,4,BI,EDIT=(III,III,II,TTTTTTT))
|
Then a step to sort the files by size:
Code: |
//PS030 EXEC PGM=SORT,PARM='MSG=AP'
//SYSIN DD *
SORT FIELDS=(55,18,CH,D)
/*
//SORTIN DD DISP=(SHR,PASS),DSN=&&DSNLIST
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
|
I use this to keep track of our test storage group allocations and to quickly identify which datasets are filling things up. |
|
Back to top |
|
|
|