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

To display no of bytes used by the input file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mahe1015

New User


Joined: 19 Dec 2012
Posts: 14
Location: India

PostPosted: Thu Feb 21, 2013 3:57 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 4:03 pm
Reply with quote

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
View user's profile Send private message
mahe1015

New User


Joined: 19 Dec 2012
Posts: 14
Location: India

PostPosted: Thu Feb 21, 2013 4:08 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 4:19 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 21, 2013 5:04 pm
Reply with quote

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
View user's profile Send private message
mahe1015

New User


Joined: 19 Dec 2012
Posts: 14
Location: India

PostPosted: Thu Feb 21, 2013 5:14 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Feb 21, 2013 5:32 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Feb 21, 2013 5:41 pm
Reply with quote

I am in a very good mood today ....
maybe the TS is just the innocent victim of somebody' s stupidity and incompetence
icon_cool.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 21, 2013 6:49 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 7:40 pm
Reply with quote

Easytrieve Plus requires very little code for your task. Do you want to post what you have so far?
Back to top
View user's profile Send private message
mahe1015

New User


Joined: 19 Dec 2012
Posts: 14
Location: India

PostPosted: Thu Feb 21, 2013 7:45 pm
Reply with quote

I have done it through Easytrieve ..
Any there is no chance through Utilities..
Thanks a lot for your assistance
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 8:23 pm
Reply with quote

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
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Feb 21, 2013 8:45 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top