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
 

 

SYNCSORT : Generating different 'TOTAL' for different record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Thu Feb 23, 2012 5:18 pm    Post subject: SYNCSORT : Generating different 'TOTAL' for different record
Reply with quote

Here is my I/P file looks like:

Account Debit/Credit
10131977 10.00
10139389 12.00-
10145489 19.00-
10170148 13.00
10488463 17.00

I need to create a report of Record Length 133, with having all the Input data display in the report, with following Trailer :

TOTAL NUMBER OF RECORDS = 5
TOTAL DEBIT AMOUNT = 40.00
TOTAL CREDIT AMOUNT = 31.00-
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 23, 2012 5:26 pm    Post subject:
Reply with quote

Oh, OK then, off you go, and thanks for telling us that ..................... icon_evil.gif

There is just oh so much information missing if you are actually looking for any help at all.

Do you want to write a program or use a utility, if a utility which one.
If sort, what is the product used and its release level.
DSORG/RECFM/LRECL of input file(s).
Same as above for the output files - also is there carriage control involved, if so A or M.
Length, position and data type of the relevent fields.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Feb 23, 2012 9:51 pm    Post subject:
Reply with quote

Based solely on your example, without the additional information requested by expat, here is an example that may help you:
Code:

//STEP1 EXEC PGM=SORT                                                 
//SYSOUT  DD SYSOUT=*                                                 
//SORTIN  DD *                                                         
ACCOUNT DEBIT/CREDIT                                                   
10131977 10.00                                                         
10139389 12.00-                                                       
10145489 19.00-                                                       
10170148 13.00                                                         
10488463 17.00                                                         
//SORTOUT DD SYSOUT=*                                                 
//SYSIN   DD *                                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(30:C'1',40:C'00.00',50:C'00.00-')),
        IFTHEN=(WHEN=(1,7,CH,EQ,C'ACCOUNT'),OVERLAY=(30:C'0')),       
        IFTHEN=(WHEN=(15,1,CH,EQ,C' '),OVERLAY=(40:10,5)),             
        IFTHEN=(WHEN=(15,1,CH,EQ,C'-'),OVERLAY=(50:10,6))             
  SORT FIELDS=(30,1,CH,A)                                             
  OUTFIL BUILD=(1,20,112X),                                           
      TRAILER1=(1:'TOTAL NUMBER OF RECORDS =',TOT=(30,1,ZD,LENGTH=6),/,
      1:'TOTAL DEBIT AMOUNT =',TOT=(40,5,UFF,EDIT=(IIIT.TT)),/,       
      1:'TOTAL CREDIT AMOUNT =',TOT=(50,6,SFF,EDIT=(IIIT.TT-)))       
/*   

The above code produces the following output:
Code:

ACCOUNT DEBIT/CREDIT           
10131977 10.00                 
10139389 12.00-               
10145489 19.00-               
10170148 13.00                 
10488463 17.00                 
TOTAL NUMBER OF RECORDS =    5
TOTAL DEBIT AMOUNT =  40.00   
TOTAL CREDIT AMOUNT =  31.00- 

You will need to modify this based on your actual data.
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Thu Feb 23, 2012 10:00 pm    Post subject:
Reply with quote

Debasis Misra,

Will your credit/debit always be a 2 digit value?
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: Fri Feb 24, 2012 5:43 pm    Post subject: Reply to: SYNCSORT : Generating different 'TOTAL' for differ
Reply with quote

Sorry for less information.
Thanks Alissa for your suggestion. Its working fine for me.
Thanks All.
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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