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

ICETOOL - Build and Remove DUPS


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

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 19, 2010 10:58 pm
Reply with quote

Hi,

I'm new to use ICETOOL. Please help me regrding the below query.

I have two data sets with the following attributes.

DS1 - RECFM=FB, LRECL=78, Pass_no(CHAR type)=8 bytes in length, starts in Column 1, May be DUPS in Pass_no.
DS2 - RECFM=FB, LRECL=15, Pass_no(CHAR type)=8 bytes in length, starts in Column 1, May be DUPS in Pass_no.

I need to get Pass_no alone from both data sets without DUPS.

Output - RECFM=FB, LRECL=8, Pass_no=8 bytes in length, starts in Column 1,

I tried below ICETOOL job.

Code:
//DS1 DD DSN=... 
//DS2 DD DSN=... 
//T   DD DSN=&&T,DISP=(MOD,PASS)....
//OUTPUT DD DSN=... 
//TOOLIN *
   COPY FROM(DS1) TO (T) USING(CTL1)
   COPY FROM(DS1) TO (T) USING(CTL1)
   SELECT FROM(T) TO(OUTPUT) ON(1,8,CH) FIRST
/*
//CTL1CNTL DD
  OPTION COPY
  INREC BUILD=(1,8)
/*


BTW, ICETOOL is in my installation with ICE201I F RECORD TYPE ...

I hope this will work as I expect. Please let me know if I am wrong. Also, is there any better way for the same?

Your help is appreciated!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed May 19, 2010 11:39 pm
Reply with quote

Quote:
I hope this will work as I expect. Please let me know if I am wrong.


Why not just try it and find out?

If you need more help, post an example of your input and expected output.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 19, 2010 11:46 pm
Reply with quote

Hi Frank,

I tried and got the output. Just checking if I'm doing correctly.

Example(as explained in my first post),

DS1:
Code:
A2389012......
A2398032......
A4454444......
A2389012......
A2398032......

DS2:
Code:
A2389012......
A2398032......
A6666666......

OUTPUT:
Code:
A2389012
A2398032
A4454444
A6666666


Thank you very much. Have a good day!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed May 19, 2010 11:51 pm
Reply with quote

Yes, that looks right based on what you've posted. One nit: you don't need

Code:

  OPTION COPY


in CTL1CNTL. The COPY operator supplies it automatically.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 19, 2010 11:53 pm
Reply with quote

OKay, Frank. Thanks for the help! icon_smile.gif
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 28, 2010 7:56 pm
Reply with quote

Hi all,

Release Management here is not allowing that job to PROD since DISP=MOD can't be used in the step above.

So, I splitted that step into 3 steps as below.

Step1:
Code:
//SORTIN DD DSN=DS1....
//SORTOUT DD DSN=OUT1
//SYSIN DD *
 OPTION COPY
 INREC BUILD=(1,8)
/*

Step2:
Code:
//SORTIN DD DSN=DS2....
//SORTOUT DD DSN=OUT2
//SYSIN DD *
 OPTION COPY
 INREC BUILD=(1,8)
/*

Step3:
Code:
//SORTIN DD DSN=OUT1....
//       DD DSN=OUT2....
//SORTOUT DD DSN=FINAL...
//SYSIN DD *
 SORT EQUALS,FORMAT=CH,FIELDS=(1,8,A)     
 SUM FIELDS=NONE                         
/*


I tested the above and it seemed that my approach is correct. Please me know if I'm wrong with the above steps.

And, kindly tell me if there is any other better to do the same.( I mean, without DISP=MOD)

Thank you!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jul 28, 2010 9:42 pm
Reply with quote

Gnana Sekaran Nallathambi,

You really don't have to reformat both files to lrecl of 8 , you can just reformat the larger LRECL file (78) to 15 bytes and then concatenate them to sortin and then remove dups


Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input 78 byte file,DISP=SHR
//SORTOUT  DD DSN=&&TM15,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)   
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  INREC BUILD=(1,8,7X)                                         
//*                                                           
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input 15 byte file,DISP=SHR
//         DD DSN=&&TM15,DISP=SHR                             
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *
  INREC BUILD=(1,8)
  SORT FIELDS=(1,8,CH,A),EQUALS
  SUM FIELDS=NONE
//*
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Fri Jul 30, 2010 6:28 pm
Reply with quote

Thanks, Kolusu.
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Remove leading zeroes SYNCSORT 4
Search our Forums:

Back to Top