View previous topic :: View next topic
|
Author |
Message |
worldan
New User
Joined: 15 Sep 2009 Posts: 10 Location: chennai
|
|
|
|
Hi,
Currently in my JCL i have two SORT steps. In first sort step it sorts the input in certain sorting key fileds and write in output file. In the second sort it sorts the same input file and in the same sorting keys fields and SUM fileds and write in a different file. Is there any way in sort to club both steps in a single step to write FILE1 with just sorted order and second file with SORT SUMMED order? Basically since the input file contain millions pf records i just wanted to save some MIPS in clubbing together. |
|
Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you post the current 2-step jcl and control statements. . . |
|
Back to top |
|
 |
worldan
New User
Joined: 15 Sep 2009 Posts: 10 Location: chennai
|
|
|
|
Hi this is control cards. Is there any way to club these two steps?
STEP1 EXEC PGM=SORT
DXXXX DD DSN = aaa.bbb.ccc
Dyyyy DD DSN = ddd.eee.fff
sysin DD *
SORT FIELDS=(1,9,PD,A,23,3,PD,A,56,1,CH,A)
.......
.......
STEP1 EXEC PGM=SORT
DXXXX DD DSN = aaa.bbb.ccc
Dyyyy DD DSN = gggg.hhh.iii
sysin DD *
SORT FIELDS=(1,9,PD,A,23,3,PD,A,56,1,CH,A)
SUM FIELDS=(27,9)
.......
|
|
Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
SUM FIELDS=(27,9) is invalid since you don't have a format. What is the format of this field - ZD, PD, BI?
I believe you could do it in one pass by not using SUM, but instead using an OUTFIL without SECTIONS for the sorted version, and an OUTFIL with REMOVECC, NODETAIL, SECTIONS, TRAILER3 and TOT for the sorted/summed version. But I need to know the format of the field to be summed before I can show you how to do it.
Also, what is the RECFM and LRECL of the input file?
Are the SORT PD values all positive, or can they be both positive and negative? |
|
Back to top |
|
 |
worldan
New User
Joined: 15 Sep 2009 Posts: 10 Location: chennai
|
|
|
|
Hi Frank,
The SUM FIELDS format is PD .
Also the RECFM is FB and LRECL is 80.
The SORT PD values is acct number and PID. So it is Positive.
But the summed fileds are expiration points. So it can be Positive Or Negative |
|
Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for in one pass:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//OUT1 DD DSN=... output file1 (FB/80)
//OUT2 DD DSN=... output file2 (FB/80)
//SYSIN DD *
SORT FIELDS=(1,9,PD,A,23,3,PD,A,56,1,CH,A)
OUTREC OVERLAY=(81:1,9,PD,TO=PD,LENGTH=9,23,3,PD,TO=PD,LENGTH=3,
56,1)
OUTFIL FNAMES=OUT1,BUILD=(1,80)
OUTFIL FNAMES=OUT2,REMOVECC,NODETAIL,
BUILD=(1,80),
SECTIONS=(81,13,
TRAILER3=(1,26,TOT=(27,9,PD,TO=PD,LENGTH=9),36,45))
/*
|
|
|
Back to top |
|
 |
worldan
New User
Joined: 15 Sep 2009 Posts: 10 Location: chennai
|
|
|
|
Thanks Frank for your solution.
I will test run and let u know if i face any issues |
|
Back to top |
|
 |
|
 |
All times are GMT + 6 Hours |
|