Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To get the count and sum from the I/P file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue May 18, 2010 12:35 pm    Post subject: To get the count and sum from the I/P file
Reply with quote

I/P file layout:

A 100
B 200
C 300
D 400
E 500

Position :1st Byte--> Type, 3-5th byte---> Amount

Output File Layout should be:

5 1500

Position :1st Byte--> Sum of records count , 4-7th byte---> Sum Of amount Amount

Requirement : O/P file should contains total no of records present in the I/P file and sum of the amount field.

Can anyone help me here?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 18, 2010 2:07 pm    Post subject:
Reply with quote

What if count exceeds 9 and sum 999???
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue May 18, 2010 2:12 pm    Post subject:
Reply with quote

The requirement is like that only to concider upto 9 for count and summation 9999 (4-7 bytes in O/P file).
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2446
Location: Netherlands, Amstelveen

PostPosted: Tue May 18, 2010 2:16 pm    Post subject:
Reply with quote

Open the file in an editor, use a calculator and get the crap requirement done.
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue May 18, 2010 2:18 pm    Post subject:
Reply with quote

This is a part of daily batch process so I think we can not not do like that.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 18, 2010 2:37 pm    Post subject:
Reply with quote

Debasis Misra wrote:
The requirement is like that only to concider upto 9 for count and summation 9999 (4-7 bytes in O/P file).

Output you have shown is having sum from 3rd byte..
Below sort step will give you required output.
Code:

//STEP10   EXEC PGM=SORT                                         
//SORTIN       DD *                                               
A 100                                                             
B 200                                                             
C 300                                                             
D 400                                                             
E 500                                                             
/*                                                               
//SORTOUT DD SYSOUT=*                                             
//SYSOUT  DD SYSOUT=*                                             
//SYSIN    DD  *                                                 
  SORT FIELDS=COPY                                               
  OUTFIL REMOVECC,NODETAIL,                                       
  TRAILER1=(COUNT=(M11,LENGTH=1),X,TOT=(3,3,ZD,EDIT=(TTTT)))     
/*                                                               

I am sure this is homework.
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue May 18, 2010 3:29 pm    Post subject:
Reply with quote

thanks a lot, its working fine.
Its not home work, believe mw icon_biggrin.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts VSAM File free space sancraig16 JCL & VSAM 13 Fri Mar 30, 2018 1:02 am
No new posts Creation of Datasets dynamically on t... Raghu M N DFSORT/ICETOOL 8 Fri Mar 16, 2018 12:56 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us