Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To display no of bytes used by the input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To display no of bytes used by the input file
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Feb 21, 2013 4:03 pm    Post subject: Reply to: To display no of bytes used by the input file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Feb 21, 2013 4:19 pm    Post subject: Reply to: To display no of bytes used by the input file
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: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 21, 2013 5:04 pm    Post subject:
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Thu Feb 21, 2013 5:32 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Feb 21, 2013 5:41 pm    Post subject: Reply to: To display no of bytes used by the input file
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: 7913
Location: Bellevue, IA

PostPosted: Thu Feb 21, 2013 6:49 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Feb 21, 2013 7:40 pm    Post subject: Reply to: To display no of bytes used by the input file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Feb 21, 2013 8:23 pm    Post subject: Reply to: To display no of bytes used by the input file
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    Post subject: Try IDCAMS DCOLLECT
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 17 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us