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

File change/insertion extraction using ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Mon Apr 28, 2008 5:45 pm
Reply with quote

Hi Team,

Request
---------
Two Input files of 80 character is available.Fil1,File2.

File2 may be updated with new records. or it may be modified for an existing record.Modified means only the date is changed in second file.Date starts at 25 th position and runs for 8 character.

The first 10 character is key. Both the files are sorted in ascending.

Expected Result
------------------

File 3 must be generate with all the newly inserted or changed records from File2.


File Strucutre example
-------------------------

File1 (sample 70 character i have given)

0010100002 200804100080430050000C 00 000000
0010100004 200804100080428050000C 00 000000
0010100009 200805020080501050000C 00 000000


File2 (sample 70 character i have given)

0010100002000000000000002008041720080417235900C 00200804
0010100004000000000000002008041720080417235900C 00200804
0010100009000000000000002008050220080417235900C 00200804
0010100012000000000000002008041720080417235900C 00200804

Expected result file3


0010100002000000000000002008041720080417235900C 00200804
(for date changed)

0010100004000000000000002008041720080417235900C 00200804
(for date changed)

0010100012000000000000002008041720080417235900C 00200804
(as new record)

Third row of file2 is skipped,because it did not have any change.

Can anyone give me a ICETOOL code to generate the same.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Apr 28, 2008 11:17 pm
Reply with quote

The following DFSORT/ICETOOL JCl will give you desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                               
0010100002              200804100080430050000C 00 000000     
0010100004              200804100080428050000C 00 000000     
0010100009              200805020080501050000C 00 000000     
//IN2      DD *                                               
0010100002000000000000002008041720080417235900C 00200804     
0010100004000000000000002008041720080417235900C 00200804     
0010100009000000000000002008050220080417235900C 00200804     
0010100012000000000000002008041720080417235900C 00200804     
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(IN1) USING(CTL1)                                 
  COPY FROM(IN2) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITHALL -               
  KEEPNODUPS USING(CTL3) WITH(01,80)                         
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,OVERLAY=(81:1,10,25,8)                     
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=T1,OVERLAY=(81:18X)                           
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT,BUILD=(01,80),                           
  INCLUDE=(25,8,CH,NE,91,8,CH)                               
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Tue Apr 29, 2008 2:37 pm
Reply with quote

Absolutely Brilliant.....

thanks a lot

it worked icon_smile.gif
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Mon May 05, 2008 11:02 am
Reply with quote

Hi Skolusu,

I have an enhanced requirement on this.

//IN1 DD *
0010100002 200804100080430050000C 00 000000
0010100004 200804100080428050000C 00 000000
0010100009 200805020080501050000C 00 000000
//IN2 DD *
0010100002000000000000002008041720080417235900C 00200804
0010100004000000000000002008041720080417235900C 00200804
0010100009000000000000002008050220080417235900C 00200804
0010100012000000000000002008041720080417235900C 00200804
0010100012000000000000002008051720080417235900C 00200804


If i find a duplicate in the second file , both of them should be captured inthe o/p file. how can that be done?

plz help
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Mon May 05, 2008 2:13 pm
Reply with quote

Code:
//STEP0100 EXEC PGM=ICETOOL                                               
//TOOLMSG  DD SYSOUT=*                                                     
//DFSMSG   DD SYSOUT=*                                                     
//IN1      DD *                                                           
0010100002              200804100080430050000C 00 000000                   
0010100004              200804100080428050000C 00 000000                   
0010100009              200805020080501050000C 00 000000                   
//IN2      DD *                                                           
0010100002000000000000002008041720080417235900C 00200804                   
0010100004000000000000002008041720080417235900C 00200804                   
0010100009000000000000002008050220080417235900C 00200804                   
0010100012000000000000002008041720080417235900C 00200804                   
0010100012000000000000002008051720080417235900C 00200804                   
//OUT      DD  *                                                           
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE),
//  UNIT=SYSDA             
//TOOLIN   DD *                                                           
  COPY FROM(IN1) USING(CTL1)                                               
  COPY FROM(IN2) USING(CTL2)                                               
  SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITHALL -                           
  KEEPNODUPS KEEPBASE USING(CTL3) WITH(01,80) WITH(99,1)                   
//CTL1CNTL DD *                                                           
  OUTFIL FNAMES=T1,OVERLAY=(81:1,10,25,8,99:C'AA')                         
//CTL2CNTL DD *                                                   
  OUTFIL FNAMES=T1,OVERLAY=(81:18X,99:C'BB')                       
//CTL3CNTL DD *                                                   
  OUTFIL FNAMES=OUT,BUILD=(01,80),                                 
  INCLUDE=(25,8,CH,NE,91,8,CH,AND,99,2,CH,NE,C'AA')   


If the duplicates exist for the key which is present in the file1, the same jcl works. But if duplicates exist for the new records added in the file2 then use this jcl.
Hope this might help you...
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top