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

How to override first 5 bytes alone???


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

New User


Joined: 29 Dec 2005
Posts: 7

PostPosted: Fri May 25, 2007 8:24 am
Reply with quote

Hi all,

I have two files with the length of 100 and with 3 thousand records.
I have to copy the first 5 bytes of first file to the second file, but other values in the second file should not be disturbed.

Eg:
Input

FIle1 - AA111111
BB222222

File 2 - XX333333
YY555555

I want the output as below

File2 - AA111333
BB222555

Please advice.

Thank You.
Abirami.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri May 25, 2007 10:08 am
Reply with quote

abirami_2006
ICETOOL solution for your question is as follows
Code:
//STEP001  EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                       
AA111111                                                               
BB222222                                                               
/*                                                                     
//IN2      DD *                                                       
XX333333                                                               
YY555555                                                               
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
 COPY FROM(IN1)  TO(TMP1) USING(CP01)                                 
 COPY FROM(IN2)  TO(TMP1) USING(CP02)                                 
 SPLICE FROM(TMP1) TO(OUT) ON(20,8,PD) KEEPNODUPS -                   
  WITHEACH   WITH(6,3) USING(CP13)                                     
/*                                                                     
//CP01CNTL DD   *                         
  OUTREC FIELDS=(1:1,8,20:SEQNUM,8,PD)     
/*                                         
//CP02CNTL DD   *                         
  OUTREC FIELDS=(6:6,3,20:SEQNUM,8,PD)     
/*                                         
//CP13CNTL DD   *                         
  OUTFIL FNAMES=OUT,OUTREC=(1,8)           
/*                                         


The output OUT should contain
Code:
AA111333
BB222555
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Fri May 25, 2007 10:16 am
Reply with quote

Abi,

Go through the following previous post -

www.ibmmainframes.com/viewtopic.php?t=19629

I hope this suits your requirement.
Back to top
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Fri May 25, 2007 10:23 am
Reply with quote

Hi,

try this logic below.

1. add sequence number to both the i\p files
2. Join the records from both the files using SPLICE based on sequence number
3. Using OVERLAY function copy the First 2 char which will be at end of temporary o\p from above step
4. Using BUILD omit the fields u added in 2nd step also the sequence number

Regards,
Mani
Back to top
View user's profile Send private message
abirami_2006

New User


Joined: 29 Dec 2005
Posts: 7

PostPosted: Sat May 26, 2007 10:26 am
Reply with quote

Thanks a lot. I got the output.

Regards,
Abirami
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 Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts total number of bytes PL/I & Assembler 10
No new posts AN OVERRIDE MAY NOT TARGET OVERRIDING... JCL & VSAM 1
No new posts Compare Two datasets and Override Mat... DFSORT/ICETOOL 7
No new posts ICE039A H INSUFFICIENT MAIN STORAGE -... DFSORT/ICETOOL 3
Search our Forums:

Back to Top