View previous topic :: View next topic
Author
Message
services New User Joined: 20 May 2009Posts: 38 Location: India
Below is the sort step that I have
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=input file,DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) USING(CTL1)
SORT FROM(T1) USING(CTL2)
//CTL1CNTL DD *
OPTION EQUALS
SORT FIELDS=(02,11,CH,A, $ P-NUM
13,08,CH,A, $ PTM-NUM
38,4,CH,A, $ P_YEAR
48,3,CH,A) $ CP1
SUM FIELDS=(63,15,ZD) $ DPRICE
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(78:16C'0')),
IFTHEN=(WHEN=(48,3,SS,EQ,C'513,523'),OVERLAY=(78:63,15,93:C'1')),
IFTHEN=(WHEN=(48,3,CH,EQ,C'697'),OVERLAY=(78:23C'0'))
OUTFIL FNAMES=T1,REMOVECC,BUILD=(1,92,8C'0',101:X),
SECTIONS=(02,19,SKIP=0L,38,4,SKIP=0L,
TRAILER3=(1,47,C'697',51,27,
78:TOT=(78,15,ZD,ZDC,LENGTH=15),
93:TOT=(93,1,ZD,ZD,LENGTH=8),'T'))
//*
//CTL2CNTL DD *
OMIT COND=(93,8,ZD,EQ,0,AND,101,1,CH,EQ,C'T')
OPTION EQUALS
SORT FIELDS=(02,11,CH,A, $ P_NUM
13,08,CH,A, $ PTM-NUM
38,4,CH,A, $ P-YEAR
48,3,CH,A) $ CP1
SUM FIELDS=(78,15,ZD, $ DPRICE
93,08,ZD) $ DPRICE
OUTFIL FNAMES=OUT,IFOUTLEN=77,
IFTHEN=(WHEN=(48,3,CH,EQ,C'697',AND,93,8,ZD,GT,0),
OVERLAY=(63:78,15,ZD,ZDC,LENGTH=15))
//*
INPUT
Code:
C1234567 0001 000029 7302 01 2011 2010N513 C000000000{00000000058428D
C1234567 0001 000028 7302 01 2011 2010N513 C000000000{00000000393743E
C1234567 0001 000031 7302 01 2011 2010N513 C000000000{00000000081949G
C1234567 0001 000032 7302 01 2011 2010N513 C000000000{00000000447853A
C1234567 0001 000026 7302 01 2011 2010N513 C000000000{00000000425543B
C1234567 0001 000030 7302 01 2011 2010N513 C000000000{00000000409748F
C1234567 0001 000033 7302 01 2011 2010N513 C000000000{00000000089570E
C1234567 0001 000027 7302 01 2011 2010N513 C000000000{00000000085108G
C1234567 0001 000000 7050 01 2011 2010N513 C000000000{00000067758673G
C1234567 0001 000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567 0001 000030 7302 01 2011 2010N603 C000015200{00000000000000{
C1234567 0001 000029 7302 01 2011 2010N603 C000003120{00000000000000{
C1234567 0001 000032 7302 01 2011 2010N603 C000019700{00000000000000{
C1234567 0001 000028 7302 01 2011 2010N603 C000014700{00000000000000{
C1234567 0001 000033 7302 01 2011 2010N603 C000004220{00000000000000{
C1234567 0001 000026 7302 01 2011 2010N603 C000015500{00000000000000{
C1234567 0001 000027 7302 01 2011 2010N603 C000003340{00000000000000{
C1234567 0001 000026 7302 01 2011 2010N696 C000000000{00000000425543B
C1234567 0001 000000 7050 01 2011 2010N696 C000000000{00000067758673G
C1234567 0001 000033 7302 01 2011 2010N696 C000000000{00000000089570E
C1234567 0001 000030 7302 01 2011 2010N696 C000000000{00000000409748F
C1234567 0001 000032 7302 01 2011 2010N696 C000000000{00000000447853A
C1234567 0001 000028 7302 01 2011 2010N696 C000000000{00000000393743E
C1234567 0001 000029 7302 01 2011 2010N696 C000000000{00000000058428D
C1234567 0001 000027 7302 01 2011 2010N696 C000000000{00000000085108G
C1234567 0001 000031 7302 01 2011 2010N696 C000000000{00000000081949G
C1234567 0001 000032 7302 01 2011 2010N697 C000000000{00000000447853A
C1234567 0001 000033 7302 01 2011 2010N697 C000000000{00000000089570E
C1234567 0001 000031 7302 01 2011 2010N697 C000000000{00000000081949G
C1234567 0001 000030 7302 01 2011 2010N697 C000000000{00000000409748F
C1234567 0001 000029 7302 01 2011 2010N697 C000000000{00000000058428D
C1234567 0001 000028 7302 01 2011 2010N697 C000000000{00000000393743E
C1234567 0001 000027 7302 01 2011 2010N697 C000000000{00000000085108G
C1234567 0001 000026 7302 01 2011 2010N697 C000000000{00000000425543B
C1234567 0001 000000 7050 01 2011 2010N697 C000000000{00000067758673G
C1234567 0001 000000 7050 01 2011 2011N615 C000053270{00000000000000{
CURRENT OUTPUT
Code:
C1234567 0001 000029 7302 01 2011 2010N513 C000000000{00000069750619D - added of all 513 values
C1234567 0001 000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567 0001 000000 7050 01 2011 2011N615 C000053270{00000000000000{
C1234567 0001 000026 7302 01 2011 2010N696 C000000000{00000069750619D - 513 values assigning here
C1234567 0001 000032 7302 01 2011 2010N697 C000000000{00000069750619D
- 513 + 523(if exists) values assigning here
EXPECTED OUTPUT (all 603 values (from column 48,3)should be displayed like input file)
Code:
C1234567 0001 000029 7302 01 2011 2010N513 C000000000{00000069750619D
C1234567 0001 000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567 0001 000030 7302 01 2011 2010N603 C000015200{00000000000000{
C1234567 0001 000029 7302 01 2011 2010N603 C000003120{00000000000000{
C1234567 0001 000032 7302 01 2011 2010N603 C000019700{00000000000000{
C1234567 0001 000028 7302 01 2011 2010N603 C000014700{00000000000000{
C1234567 0001 000033 7302 01 2011 2010N603 C000004220{00000000000000{
C1234567 0001 000026 7302 01 2011 2010N603 C000015500{00000000000000{
C1234567 0001 000027 7302 01 2011 2010N603 C000003340{00000000000000{
C1234567 0001 000000 7050 01 2011 2011N615 C000053270{00000000000000{
C1234567 0001 000026 7302 01 2011 2010N696 C000000000{00000069750619D
C1234567 0001 000032 7302 01 2011 2010N697 C000000000{00000069750619D
I need the output with all 603 values and added of all 513 values(as it is)
currently it is displaying only one 603 values.
like 603,i have 200,215,225 ,350, all needs to work like 603.
513 only should added and remaining should go like input file.
Thanks
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Showing what you did that didn't work doesn't really tell us what it is you want to do.
Please explain clearly the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Back to top
services New User Joined: 20 May 2009Posts: 38 Location: India
thanks, i am skipping this sort and function from my jcl ,
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
thanks, i am skipping this sort and function from my jcl ,
I have no idea what that means.
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
Quote:
thanks, i am skipping this sort and function from my jcl ,
Is this another way of saying "Thanks, but no thanks"
Gerry
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Ok, but it would be an odd way of saying that. I wonder what he decided to do instead.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Quote:
I wonder what he decided to do instead.
Change/eliminate the business requirement. . .
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
services,
I just took a look at this topic and I had to say you have uncanny knack of complicating a simple request. You show an example of a job which has no relation with the current request.
From what I understood is that all you need to just sum up ONLY the records which have 513,696,697 at pos 48 and leave the other keys as is
use the following DFSORT JCL
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input FB 77 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS,NZDPRINT
INREC IFTHEN=(WHEN=(48,3,SS,EQ,C'513,696,697'),OVERLAY=(78:8X)),
IFTHEN=(WHEN=NONE,OVERLAY=(78:SEQNUM,8,ZD))
SORT FIELDS=(02,11,CH,A, $ PROP-NUM
13,08,CH,A, $ PPTS-ITM-NUM
38,4,CH,A, $ PROPOSAL-YEAR
48,3,CH,A, $ COST-POOL1-3
78,8,CH,A) $ TEMP IND
SUM FIELDS=(63,15,ZD) $ DOLLARS-COST
OUTREC BUILD=(1,77)
//*
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Kolusu,
Those mind reading classes you're taking are really paying off. (Well, I guess you knew I was going to say that.)
Back to top
Please enable JavaScript!