View previous topic :: View next topic
Author
Message
Mohan Kothakota New User Joined: 12 Apr 2016Posts: 15 Location: INDIA
I am trying to SORT 3 VSAM files using ICETOOL, records are getting but not as per conditions.
Please find my code and advice.
Code:
//JSTEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE1 DD DSN=PHYD.PRM.DEL120.CHI.EDITTED, VSAM
// DISP=SHR
//E15IN1 DD DSN=PHYD.PRM.DEL130.CHI.EDITTED, VSAM
// DISP=SHR
//E15IN2 DD DSN=PHYD.PRM.DEL160.CHI.TRANSFER, VSAM
// DISP=SHR
//OUTFILE1 DD DSN=SPMOH.DELF152.TESTA1,
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=MEDIUM,
// LRECL=180,
// RECFM=FB
//TOOLIN DD *
SORT FROM(INFILE1) TO(OUTFILE1) USING(CTL1)
SORT FROM(E15IN1) TO(OUTFILE1) USING(CTL1)
SORT FROM(E15IN2) TO(OUTFILE1) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(20,2,A,22,3,A,1,2,A,3,17,A,25,99,A),FORMAT=CH
RECORD LENGTH=(180,180),TYPE=F
INCLUDE COND=(125,1,CH,NE,C'Y',AND,126,1,CH,NE,C'Y',AND,
1,2,CH,NE,C'0B',AND,1,2,CH,NE,C'01',AND,
20,2,CH,EQ,C'D2')
/*
//*
CODED
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10872 Location: italy
Quote:
records are getting but not as per conditions.
it would have been nice if You had posted a sample of ...
the input records
the expected output
the output You got
Back to top
Nic Clouston Global Moderator Joined: 10 May 2007Posts: 2455 Location: Hampshire, UK
In addition to what Enrico has said - you should use the code tags when posting data and code to maintain spacing. Your post suggests that your control statements start in column one which would not work with a lot of utilities including Dfsort and Syncsort. Use the code tags whe posting the items Enrico requested.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2012 Location: USA
Mohan Kothakota wrote:
I am trying to SORT 3 VSAM files using ICETOOL, records are getting but not as per conditions.
Please find my code and advice.
The only advices to pre-advise you are as follows,
1) verify your field offsets.
2) as a test, try to handle files one by one to simplify verification
3) try to use simple concatenation of input DD-s, as single input to sort, not three consecutive sort steps
4) are you sure the subsequent sorts into the same output DSNAME would not overwrite any previous output? I'm not sure of that...
Back to top
superk Global Moderator Joined: 26 Apr 2004Posts: 4652 Location: Raleigh, NC, USA
sergeyken wrote:
4) are you sure the subsequent sorts into the same output DSNAME would not overwrite any previous output? I'm not sure of that...
I was thinking the same thing. Wouldn't OUTFILE1 need DISP=MOD?
Back to top
Mohan Kothakota New User Joined: 12 Apr 2016Posts: 15 Location: INDIA
Hi All,
Please find the sample Input, Expected Output, and Actual Output
PHYD.PRM.DEL120.CHI.EDITTED -------- Sample Input ------- 4821 records
00 A2Y
0B A2Y
00 A4A
0B A4A
00 A48C
0B A48C
00 A48D
0B A48D
00 A48H
0B A48H
00 A48S
0B A48S
00 A48Z
0B A48Z
00 A481
0B A481
00 A485
PHYD.PRM.DEL160.CHI.TRANSFER --------- Sample Input -------- 130 records
00 A2Y
0B A2Y
00 A4A
0B A4A
00 A48C
0B A48C
00 A48D
0B A48D
00 A48H
0B A48H
00 A48S
0B A48S
00 A48Z
0B A48Z
00 A481
0B A481
00 A485
PHYD.PRM.DEL130.CHI.EDITED --------------- 0 records
Expected Output: -------------- 4705 records
===>
00 D2B
00 D2C
00 D2D
00 D2H
00 D2K
00 D2L
00 D2M
00 D2M
1022000131953 D2M A10010000120180214D217331780090
1022007603483 D2M A10010000320180214D217331980150
1022015304256 D2M A10010000520180214D217331600200
1022016531360 D2M A10010000620180214D217331530500
1022019468578 D2M A10010000720180214D217332040440
1022019856764 D2M A10010000820180214D217015170100
1022020422143 D2M A10010000920180214D217016040000
1022022357180 D2M A10010001020171101D217331760280
1022028270395 D2M A10010001120170909D217015670040
Actual Output: --------------- Only 18 records
----+----1----+----2----+----3
00 D2B
00 D2C
00 D2D
00 D2H
00 D2K
00 D2L
00 D2M
00 D2N
00 D2P
00 D2Q
00 D2S
00 D2T
00 D2U
00 D2V
00 D2W
00 D2X
00 D2Y
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2012 Location: USA
Mohan Kothakota wrote:
Hi All,
Please find the sample Input, Expected Output, and Actual Output
PHYD.PRM.DEL120.CHI.EDITTED -------- Sample Input ------- 4821 records
00 A2Y
0B A2Y
00 A4A
0B A4A
00 A48C
0B A48C
00 A48D
0B A48D
00 A48H
0B A48H
00 A48S
0B A48S
00 A48Z
0B A48Z
00 A481
0B A481
00 A485
PHYD.PRM.DEL160.CHI.TRANSFER --------- Sample Input -------- 130 records
00 A2Y
0B A2Y
00 A4A
0B A4A
00 A48C
0B A48C
00 A48D
0B A48D
00 A48H
0B A48H
00 A48S
0B A48S
00 A48Z
0B A48Z
00 A481
0B A481
00 A485
PHYD.PRM.DEL130.CHI.EDITED --------------- 0 records
Expected Output: -------------- 4705 records
===>
00 D2B
00 D2C
00 D2D
00 D2H
00 D2K
00 D2L
00 D2M
00 D2M
1022000131953 D2M A10010000120180214D217331780090
1022007603483 D2M A10010000320180214D217331980150
1022015304256 D2M A10010000520180214D217331600200
1022016531360 D2M A10010000620180214D217331530500
1022019468578 D2M A10010000720180214D217332040440
1022019856764 D2M A10010000820180214D217015170100
1022020422143 D2M A10010000920180214D217016040000
1022022357180 D2M A10010001020171101D217331760280
1022028270395 D2M A10010001120170909D217015670040
Actual Output: --------------- Only 18 records
----+----1----+----2----+----3
00 D2B
00 D2C
00 D2D
00 D2H
00 D2K
00 D2L
00 D2M
00 D2N
00 D2P
00 D2Q
00 D2S
00 D2T
00 D2U
00 D2V
00 D2W
00 D2X
00 D2Y
That proves to me that the last SORT has overwritten two previous SORTs, as we suggested you to check. But you ignore all advices, and ask us for the job to be done for you by others!
Back to top
Mohan Kothakota New User Joined: 12 Apr 2016Posts: 15 Location: INDIA
Hi Sergeyken,
I did understand the final Copy with SORT has overridden.
I did some research and tried Merge, Select too but nothing seems to work with ICETOOL. So I am posting on the forum to get Expert's advice with my TOOLIN.
Basically, my question is whether my TOOLIN is correct or not to get expected output
//TOOLIN DD *
COPY FROM(INFILE1) TO(OUTFILE1) USING(CTL1)
COPY FROM(E15IN1) TO(OUTFILE1) USING(CTL1)
COPY FROM(E15IN2) TO(OUTFILE1) USING(CTL1)
/*
&
//TOOLIN DD *
SORT FROM(INFILE1) TO(OUTFILE1) USING(CTL1)
SORT FROM(E15IN1) TO(OUTFILE1) USING(CTL1)
SORT FROM(E15IN2) TO(OUTFILE1) USING(CTL1)
/*
Back to top
magesh23586 Active User Joined: 06 Jul 2009Posts: 213 Location: Chennai
Try this.. untested
Code:
//JSTEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE1 DD DSN=PHYD.PRM.DEL120.CHI.EDITTED, VSAM
// DISP=SHR
//E15IN1 DD DSN=PHYD.PRM.DEL130.CHI.EDITTED, VSAM
// DISP=SHR
//E15IN2 DD DSN=PHYD.PRM.DEL160.CHI.TRANSFER, VSAM
// DISP=SHR
//TEMP1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(50,50)),DISP=(MOD,PASS)
//OUTFILE1 DD DSN=SPMOH.DELF152.TESTA1,
// DISP=(,CATLG,DELETE),
// DATACLAS=MEDIUM,
// LRECL=180,
// RECFM=FB
//TOOLIN DD *
COPY FROM(INFILE1) TO(TEMP1) USING(CTL1)
COPY FROM(E15IN1) TO(TEMP1) USING(CTL1)
COPY FROM(E15IN2) TO(TEMP1) USING(CTL1)
SORT FROM(TEMP1) TO(OUTFILE1) USING(CTL2)
/*
//CTL1CNTL DD *
INCLUDE COND=(125,1,CH,NE,C'Y',AND,126,1,CH,NE,C'Y',AND,
1,2,CH,NE,C'0B',AND,1,2,CH,NE,C'01',AND,
20,2,CH,EQ,C'D2')
//CTL2CNTL DD *
SORT FIELDS=(20,2,A,22,3,A,1,2,A,3,17,A,25,99,A),FORMAT=CH
RECORD LENGTH=(180,180),TYPE=F
//*
Back to top
Mohan Kothakota New User Joined: 12 Apr 2016Posts: 15 Location: INDIA
Thanks All, Issue resolved with magesh23586 suggestion.
Special Thanks to magesh23586
Back to top
Nic Clouston Global Moderator Joined: 10 May 2007Posts: 2455 Location: Hampshire, UK
Mohan,
Did you try your original solution modified to have DISP=MOD on your SORTOUT? If not, why not?
Back to top
magesh23586 Active User Joined: 06 Jul 2009Posts: 213 Location: Chennai
Nic Clouston wrote:
Mohan,
Did you try your original solution modified to have DISP=MOD on your SORTOUT? If not, why not?
Nic, that solution will sort each file and append.
example
File1
File2
output
But i think expected output is
Back to top
Please enable JavaScript!