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 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: 2433
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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