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

ICEMAN Combine - Remove 1st record of second file


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

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Wed Aug 01, 2007 6:20 am
Reply with quote

I would like to combine two files together without a sort. The first file has 10 records and the second file has 500M. I would like to combine the first file with all the records of the second file (except the very first record).

~Sharon in El-Lay
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Aug 01, 2007 10:54 am
Reply with quote

Sharon,

Use the below steps for acheving your requirement with ICEMAN -

Code:
//FILE1  EXEC PGM=ICEMAN                                     
//SYSPRINT DD SYSOUT=*                                       
//SYSOUT DD SYSOUT=*                                         
//SORTIN DD *                                                 
FIRST RECORD OF FILE1                                         
SECOND RECORD OF FILE1                                       
THIRD RECORD OF FILE1                                         
/*                                                           
//SORTOUT DD DSN=&SYSUID..&SYSUID..&SYSUID,                   
//    DISP=(,CATLG,CATLG),LRECL=80,RECFM=FB,SPACE=(TRK,10)   
//SYSIN DD *                                                 
  SORT FIELDS=COPY                                           
/*                                                           
//*                                                           
//FILE2  EXEC PGM=ICEMAN                                     
//SYSPRINT DD SYSOUT=*                                       
//SYSOUT DD SYSOUT=*                                         
//SORTIN DD *                                                 
FIRST RECORD OF FILE2       
SECOND RECORD OF FILE2                                     
THIRD RECORD OF FILE2                                     
FOURTH RECORD OF FILE2                                     
FIFTH RECORD OF FILE2                                     
/*                                                         
//SORTOUT DD DSN=&SYSUID..&SYSUID..&SYSUID,DISP=MOD       
//SYSIN DD *                                               
  SORT FIELDS=COPY                                         
  OUTFIL FNAMES=SORTOUT,STARTREC=2                         
/*                                                                                           


With ICETOOL -

Code:
//SPLIT  EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG DD SYSOUT=*                                     
//FILE1  DD *                                           
1FIRST                                                   
1SECOND                                                 
/*                                                       
//FILE2 DD *                                             
2FIRST                                                   
2SECOND                                                 
2THIRD                                                   
/*                                                       
//OPFILE  DD DSN=&SYSUID..&SYSUID..&SYSUID,             
//        DISP=(MOD,CATLG,CATLG),LRECL=80,RECFM=FB,     
//        SPACE=(TRK,10,RLSE)                           
/*                                                       
//TOOLIN DD *                                           
  COPY FROM(FILE1) TO(OPFILE)                           
  COPY FROM(FILE2) USING(C111)                           
/*                                                       
//*                                       
//C111CNTL DD *                           
  OUTFIL FNAMES=OPFILE,STARTREC=2         
/*                                       


OP as expected.
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 Aug 01, 2007 8:29 pm
Reply with quote

Sharon,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1  EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG DD SYSOUT=*                                     
//IN1 DD DSN=...  input file1                                           
//IN2 DD DSN=...  input file2                                       
//OUT DD DISP=MOD,DSN=...  MOD output file                                     
//TOOLIN DD *                                           
  COPY FROM(IN1) TO(OUT)                           
  COPY FROM(IN2) TO(OUT) USING(CTL1)                           
/*                                 
//CTL1CNTL DD *                           
  OPTION SKIPREC=1         
/*                                     
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 02, 2007 1:51 am
Reply with quote

Hello,

Sorry to join the party so late, but reading this just now, a question occurred. . . icon_confused.gif

Should the 9 records of the first file be merged with the large file by some "key" that the large file is already sequenced by or is it ok to have the 9 "new" records on the front or back of the combined file?

Every time i've worked with files that large, they were in sequence by "something" so i thought i'd ask.

If i've confused anything, my apologies icon_wink.gif
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Aug 02, 2007 3:50 am
Reply with quote

I used Disp=MOD and took the default on the other two Disp parameters. The Job ran for and hour and a half, copied all the data correctly onto 10 tapes and then promptly deleted the output file at the end of the job. I used DISP=(MOD,KEEP,KEEP) and the job "RECATLOGED" that dataset I needed with all the records intact.

The records are a huge unload of an IMS database and we have a batch purge pgm (no source) that removes the obsolete segemts. It also removed the 8 new header records the the new BMC utility put in the file. No source, no fix on the Purge pgm. This ICETOOL utility helped mucho. Thank you so much everyone.
~Sharon in El-Lay
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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
Search our Forums:

Back to Top