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

SYNCSORT : Generating different 'TOTAL' for different record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Feb 23, 2012 5:26 pm
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: 496
Location: USA

PostPosted: Thu Feb 23, 2012 9:51 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top