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: 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

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