Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple VSAM files single output file using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 8
Location: INDIA

PostPosted: Wed Aug 09, 2017 7:57 pm    Post subject: Multiple VSAM files single output file using ICETOOL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Wed Aug 09, 2017 8:20 pm    Post subject: Reply to: Multiple VSAM files single output file using ICETOOL
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: 1846
Location: UK

PostPosted: Wed Aug 09, 2017 8:32 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 128
Location: Maryland

PostPosted: Thu Aug 10, 2017 1:24 am    Post subject: Re: Multiple VSAM files single output file using ICETOOL
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

Moderator Team Head


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

PostPosted: Thu Aug 10, 2017 3:34 pm    Post subject: Re: Multiple VSAM files single output file using ICETOOL
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: 8
Location: INDIA

PostPosted: Thu Aug 10, 2017 7:58 pm    Post subject: Reply to: Multiple VSAM files single output file using ICETOOL
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

Active User


Joined: 29 Apr 2008
Posts: 128
Location: Maryland

PostPosted: Thu Aug 10, 2017 8:26 pm    Post subject: Re: Reply to: Multiple VSAM files single output file using ICETOOL
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: 8
Location: INDIA

PostPosted: Thu Aug 10, 2017 9:20 pm    Post subject: Reply to: Multiple VSAM files single output file using ICETOOL
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: 170
Location: Chennai

PostPosted: Fri Aug 11, 2017 1:03 am    Post subject: Reply to: Multiple VSAM files single output file using ICETOOL
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: 8
Location: INDIA

PostPosted: Fri Aug 11, 2017 3:44 pm    Post subject: Reply to: Multiple VSAM files single output file using ICETOOL
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: 1846
Location: UK

PostPosted: Fri Aug 11, 2017 6:18 pm    Post subject:
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: 170
Location: Chennai

PostPosted: Fri Aug 11, 2017 6:30 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us