View previous topic :: View next topic
|
Author |
Message |
Vinay Pandey
New User
Joined: 23 Jun 2010 Posts: 5 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Vinay Pandey
New User
Joined: 23 Jun 2010 Posts: 5 Location: Hyderabad
|
|
|
|
I use SYNCHSORT itself |
|
Back to top |
|
|
Vinay Pandey
New User
Joined: 23 Jun 2010 Posts: 5 Location: Hyderabad
|
|
|
|
SYNCSORT FOR Z/OS 1.3.2.2R
to be specific |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Vinay Pandey,
You can achieve this using your sort product, but I wonder how you got the Total as 0415878700 |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
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 |
|
|
Vinay Pandey
New User
Joined: 23 Jun 2010 Posts: 5 Location: Hyderabad
|
|
|
|
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 |
|
|
|