|
|
| Author |
Message |
Silpha
New User
Joined: 15 May 2007 Posts: 5 Location: Trivandrum
|
|
|
|
Requirement
I have two files(F1, F2) of LRECL 80. The key field is first 2 bytes.
I want matching records of F2 to be written to the output file(F3).
The records of F3 is not exactly same as of F2. I want to replace 5 to 10 bytes of F2 by 5 to 10 bytes of F1 before writing it into F3.
Please find below the example. I am listing only the first 10 bytes.
F1
01aa1000dd
02bb2000ee
03cc3000ff
F2
01dd4000gg
03ee5000hh
F3
01dd1000dd
03ee3000ff |
|
| Back to top |
|
 |
References
|
Posted: Tue May 06, 2008 10:31 am Post subject: Re: Selecting matching records and replacing some fields |
 |
|
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1309 Location: Mumbai, India
|
|
|
|
Hi,
Try this JOB,
| Code: |
//DFSORT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
01AA1000DD
02BB2000EE
03CC3000FF
//IN2 DD *
01DD4000GG
03EE5000HH
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) TO(TMP1) USING(CPY1)
COPY FROM(IN1) TO(TMP1) USING(CPY2)
SPLICE FROM(TMP1) TO(OUT) ON(1,2,CH) WITH(5,6)
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,4,5:6X)
/*
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,4,5:5,6)
/* |
|
|
| Back to top |
|
 |
Silpha
New User
Joined: 15 May 2007 Posts: 5 Location: Trivandrum
|
|
|
|
Thanks a lot Anuj. It worked  |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1309 Location: Mumbai, India
|
|
|
|
Hi,
You are welcome, Well I had to solve this..coz once upon a time "Silpha" was name of my P.M. ..  |
|
| Back to top |
|
 |
|
|