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 - Adding totals in trailer for selected records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Vinay Pandey

New User


Joined: 23 Jun 2010
Posts: 5
Location: Hyderabad

PostPosted: Wed Jun 23, 2010 4:13 pm    Post subject: Syncsort - Adding totals in trailer for selected records
Reply with quote

This is my post on this forum. Please excuse if anything wrong with this query or the information provided is insufficient

I have the following data in my input file:

21111500/
300000000036701010000083047500/
40000000003670101000090853008001010100000200001/
50000000001/
300000000041644910000083206100/
40000000004164491000000642330001010100001200001/
50000000001/
600000000020166253600/
21112000/
300000000041644910000083208000/
40000000004164491000000642336601010100000600002/
40000000004454641000000142009701010100000400002/
50000000002/
300000000044346410000083208500/
40000000004434641000000255003901010100000800002/
50000000001/
600000000030249625100/

I need to create a trailer in this file which should have count of total number of records (ex: 17 in the above case) and total of fields between positions 28 and 37.
However, the totals should be calculated only for records starting with 4 in the first column (ex: 0415878700 in the above case).
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: Wed Jun 23, 2010 4:22 pm    Post subject:
Reply with quote

Which program / utility do you propose to accomplish this request.

If it is your sort product then read on. If it is not your sort product you need to tell us exactly what it is that you will want to use to do this.

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT and the topic will be moved to the DFSORT forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
Vinay Pandey

New User


Joined: 23 Jun 2010
Posts: 5
Location: Hyderabad

PostPosted: Wed Jun 23, 2010 5:01 pm    Post subject: Reply to: Adding totals in trailer for selected records
Reply with quote

I use SYNCHSORT itself
Back to top
View user's profile Send private message
Vinay Pandey

New User


Joined: 23 Jun 2010
Posts: 5
Location: Hyderabad

PostPosted: Wed Jun 23, 2010 5:36 pm    Post subject:
Reply with quote

SYNCSORT FOR Z/OS 1.3.2.2R

to be specific
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2233
Location: @my desk

PostPosted: Mon Jun 28, 2010 3:59 pm    Post subject:
Reply with quote

Vinay Pandey,

You can achieve this using your sort product, but I wonder how you got the Total as 0415878700 icon_rolleyes.gif
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon Jun 28, 2010 8:35 pm    Post subject:
Reply with quote

Here is a SyncSort for z/OS job that will produce your requested output. However, please note that as Arun pointed out, the TOTAL for columns 28-27 is not what you had specified.
Code:
//SORT1 EXEC PGM=SORT 
//SYSOUT  DD SYSOUT=* 
//SORTOUT DD SYSOUT=*                         
//SORTIN  DD *                                   
21111500/                                       
300000000036701010000083047500/                 
40000000003670101000090853008001010100000200001/
50000000001/                                   
300000000041644910000083206100/                 
40000000004164491000000642330001010100001200001/
50000000001/                                   
600000000020166253600/                         
21112000/                                       
300000000041644910000083208000/                 
40000000004164491000000642336601010100000600002/
40000000004454641000000142009701010100000400002/
50000000002/                                   
300000000044346410000083208500/                 
40000000004434641000000255003901010100000800002/
50000000001/                                   
600000000030249625100/                                             
//SYSIN   DD *                                             
 SORT FIELDS=COPY                                         
 OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'4'),OVERLAY=(81:28,10)),
        IFTHEN=(WHEN=NONE,OVERLAY=(81:C'0000000000'))     
 OUTFIL REMOVECC,                         
        TRAILER1=(1:'RECORD COUNT:',1X,                   
        COUNT=(EDIT=(IIT)),28:'TOTAL:',TOT=(81,10,ZD)), 
        OUTREC=(1,80)                                     
/*         


Here is the output produced from the above jobstream:
Code:
21111500/                                       
300000000036701010000083047500/                 
40000000003670101000090853008001010100000200001/
50000000001/                                     
300000000041644910000083206100/                 
40000000004164491000000642330001010100001200001/
50000000001/                                     
600000000020166253600/                           
21112000/                                       
300000000041644910000083208000/                 
40000000004164491000000642336601010100000600002/
40000000004454641000000142009701010100000400002/
50000000002/                                     
300000000044346410000083208500/                 
40000000004434641000000255003901010100000800002/
50000000001/                                     
600000000030249625100/                           
RECORD COUNT:  17          TOTAL:     8820505050
Back to top
View user's profile Send private message
Vinay Pandey

New User


Joined: 23 Jun 2010
Posts: 5
Location: Hyderabad

PostPosted: Tue Jun 29, 2010 1:20 pm    Post subject:
Reply with quote

Thanks Alissa and Arun.

The solution provided above has worked fine for me.

Also apologize for putting incorrect data in earlier post.

thanks again.
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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