Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
morpheus,
You need to provide few more details on the field positions. Use this JCL for your requirement and change the same as per your field positions.
Code: |
//STEP01 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
11223344
11223344
AABBCCDD
/*
//IN2 DD *
11223388
11XX3388
AABBCCFF
/*
//T1 DD DSN=&&X1,UNIT=SYSDA,SPACE=(CYL,(15,5),RLSE),
// DISP=(MOD,PASS)
//OUT DD DSN=HLQ.XX.Y7,DISP=(,CATLG,DELETE)
//OU1 DD DSN=HLQ.XX.Y8,DISP=(,CATLG,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,6,CH) WITH(82,1) WITH(9,2) -
USING(CTL3) WITHALL
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,8,81:C'11')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1,6,2X,7,2,81:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'12'),OUTREC=(1,10)
OUTFIL FNAMES=OU1,INCLUDE=(81,2,CH,EQ,C'11'),OUTREC=(1,8,2X)
/* |
output:
HLQ.XX.Y7
Code: |
****** ***************************** Top of Data ******************************
000001 AABBCCDDFF
000002 1122334488
****** **************************** Bottom of Data **************************** |
HLQ.XX.Y8
Code: |
****** ***************************** Top of Data ******************************
000001 11223344
****** **************************** Bottom of Data **************************** |
You need to add a step to concatenate both the files. |
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Krisprems,
Quote: |
Do you mean to say that if either filed1 or field2 and field3 match then.....? |
morpheus wrote:
Quote: |
4.For those FILE1 records where the 3 fields do not match the corresponding values in FILE2 we need SPACES
for the last field in FILE3. |
hence i guess his requirement is to check for all the 3 fields. Anyways let us wait for the clarification from the OP.
This is one more example where people post their queries but never bother to reply back |
|