Joined: 27 Nov 2008 Posts: 31 Topics: 9 Location: India
Posted: Wed Aug 31, 2011 2:37 pm Post subject:
Hi,
Hope I explain well this time. Apologies if I was not in the earlier case.
Input:
------
File 1 has below contents: size=80 bytes/FB
<some data> PART 12
<some data>
Here PART 12 starts from position 48. And there is only one PART in the whole file.
Output:
------
File 2 has below contents: size=80 bytes/FB
<static data>
PART 12
<static data>
Here PART 12 starts from 1st position in the third line. And there is only one PART in the whole file.
Only the number 12 after PART is changing. i.e. It could be 12/13/14/15.
Now, what I wants is that the utility should read file 1 and search PART and then pick the number after the PART
and then replace the part number in the second file.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
//SORTJNF2 DD *
PART 12
PART 13
PART 13
PART 14
PART 14
PART 14
PART 15
PART 15
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(48,04,A),SORTED,NOSEQCK
JOINKEYS FILES=F2,FIELDS=(01,04,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F2:01,80,F1:48,7)
INREC OVERLAY=(1:81,7)
OPTION COPY
OUTFIL BUILD=(1,80)
/*
//JNF1CNTL DD *
INCLUDE COND=(48,5,CH,EQ,C'PART ')
/*
OUTPUT
Code:
PART XX
PART XX
PART XX
PART XX
PART XX
PART XX
PART XX
PART XX
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Aug 31, 2011 6:50 pm Post subject:
sqlcode,
As far as I can tell, that only works if every input file 2 record has PART in positions 1-4. But that doesn't match the OP's description of file 2 as:
Quote:
File 2 has below contents: size=80 bytes/FB
<static data>
PART 12
<static data>
Here PART 12 starts from 1st position in the third line. And there is only one PART in the whole file.
When I changed SORTJNF2 in your job to:
//SORTJNF2 DD *
<STATIC DATA>
PART 12
<STATIC DATA>
The output was just:
PART 11
It drops the other records. I don't think that's what the OP wanted.
With the same input file 2 records for my job, the output is:
<STATIC DATA>
PART 11
<STATIC DATA> _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum