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
 
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: 8657
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 VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Copying only first and last word from... chandan.inst SYNCSORT 4 Wed Jan 31, 2018 4:19 pm
No new posts How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm

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