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
 

 

Icetool to splice data from 2 files

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

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Thu Jul 12, 2007 9:24 am    Post subject: Icetool to splice data from 2 files
Reply with quote

Code:

//VBUSPLIT EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN1      DD DSN=VAST.TTRAN.F1,
//            DISP=SHR                                         
//T1       DD DSN=VAST.US.T1,                   
//            DISP=(MOD,CATLG,DELETE),           
//            SPACE=(TRK,(1,50)),
//            UNIT=SYSDA                         
//TOOLIN   DD *                                                   
SELECT FROM(IN1) TO(T1)  ON(37,9,ZD) ON(46,4,ZD) FIRST USING(CTL1)
 /*                                                 
 //CTL1CNTL DD *                                     
    OUTFIL FNAMES=T1,                               
    OUTREC=(2X,3:37,9,181X,193:48,2,6X)             
    INCLUDE COND=(1,2,CH,EQ,C'A ',AND,602,2,BI,EQ,1)
    SUM FIELDS=NONE                                 
 /*                                               

This is a part of the JCl being used to obtain a the first temporary dataset for splicing.
I want to confirm out whether the following mentioned steps are the exact manner in which DFSORT would produce the o/p. I have run the step and getting the correct o/p but would like to finalise it wont be failing in any condition

Functioning details
1) The include condition will be executed first and all the i/p records in IN1 satisfying the criteria will go to temp dataset.
2) The outrec step will executed next and only the mentioned fields will be populated.
3) The sorting will take place next and since I'm using first, only the first duplicate record is being selected and finally written to the T1.
I feel the Sum fields= None is not required in this case but added it for extra check.The actual requirement is to get only the first duplicate record.

All the suggestions are highly appreciated.

Thanks,
Nikhil S.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 12, 2007 3:05 pm    Post subject:
Reply with quote

nikyojin
Quote:
I feel the Sum fields= None is not required
Yes, its not required.

Quote:
3) The sorting will take place next and since I'm using first, only the first duplicate record is being selected and finally written to the T1.

To confirm what you want exactly, check these definition's:
Quote:
FIRST - keep only the first record for each value (that is, records with non-duplicate values, and the first record for duplicate values)
FIRSTDUP - only keep the first record for duplicate values
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 12, 2007 8:48 pm    Post subject:
Reply with quote

The order of processing is as follows:

The INCLUDE statement is processed before SELECT.

SELECT will sort on the key value (ON fields) - FIRST will keep the first record with each key value (ON fields).

SUM will be processed next but since SELECT has already removed the duplicates, SUM won't have any effect.

OUTFIL will be processed next and will reformat the selected records.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 13, 2007 9:54 am    Post subject:
Reply with quote

Frank
I have an doubt on the order of processing that you have mentioned,
I felt like SUM FIELDS=NONE is done before the FIRST.

Because when we mention FIRSTDUP in the place of FIRST , i did not not get any records in the o/p, that is SUM fields=none is removing the duplicates and because of this FIRSTDUP is not able to extract any record to the o/p.

The code i tried is here
Code:
//GETMATCH EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
121212                                                                 
121213                                                                 
121214                                                                 
131313                                                                 
/*                                                                     
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
    SELECT FROM(IN1) TO(OUT)  ON(1,2,ZD) FIRSTDUP USING(CTL1)           
/*                                                                     
//CTL1CNTL DD *                                                         
    OUTFIL FNAMES=OUT,                                                 
    OUTREC=(2X,1,6)                                                     
    INCLUDE COND=(1,2,CH,EQ,C'12')                                     
    SUM FIELDS=NONE                                                     
/*                                                                     

The O/p OUT is empty.
The same Card with FIRST in the place of FIRSTDUP gives
Code:
  121212

Please help me in understanding the flow! icon_question.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jul 13, 2007 8:25 pm    Post subject:
Reply with quote

Technically, you're right. There's a lot of interaction between ICETOOL and DFSORT, but the actual "FIRST" processing is done with an E35 which is processed after SUM. (I've been sick all week and not thinking too clearly at times.)

But the main point here is that SUM should NOT be used with SELECT since it either isn't needed or can interfere with SELECT's processing.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 13, 2007 8:46 pm    Post subject:
Reply with quote

Thanks for clarification Frank
Back to top
View user's profile Send private message
nikyojin

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Sun Jul 15, 2007 10:50 am    Post subject: Re: Icetool to splice data from 2 files
Reply with quote

Thanks Krisprems and Frank for all your valuable suggestions. I have been able to get the desired output.
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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