IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Multiple VSAM files single output file using ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Wed Aug 09, 2017 7:57 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Aug 09, 2017 8:20 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Aug 09, 2017 8:32 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Thu Aug 10, 2017 1:24 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Aug 10, 2017 3:34 pm
Reply with quote

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
View user's profile Send private message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Thu Aug 10, 2017 7:58 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Thu Aug 10, 2017 8:26 pm
Reply with quote

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
View user's profile Send private message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Thu Aug 10, 2017 9:20 pm
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Fri Aug 11, 2017 1:03 am
Reply with quote

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
View user's profile Send private message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Fri Aug 11, 2017 3:44 pm
Reply with quote

Thanks All, Issue resolved with magesh23586 suggestion.

Special Thanks to magesh23586 icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Aug 11, 2017 6:18 pm
Reply with quote

Mohan,

Did you try your original solution modified to have DISP=MOD on your SORTOUT? If not, why not?
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Fri Aug 11, 2017 6:30 pm
Reply with quote

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
Code:

1
2


File2
Code:

1
2


output
Code:

1
2
1
2


But i think expected output is
Code:

1
1
2
2
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top