How many unique entries do you have in your key ? Since your version of sort does not support SPLICE, matching using INCLUDE is possible but limited to the number of unique entries.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Mon Sep 19, 2005 5:36 am Post subject:
Suresh05,
I am sorry. you cannot achieve your output using your version of sort. You can MATCH records from File1 and File 2 and extract all matching records from FILE2 but cannot include FILE1's contents in the output.
The code below will match 2 files and extract matching records from file 2.
Code:
//R010 EXEC PGM=SYNCTOOL
//INPUT1 DD *
12345 Y
11111 N
22222 N
33333 N
12346 Y
55555 N
66666 N
77777 N
/*
//INPUT2 DD *
TEST1 12345
TEST2 12346
TEST3 77777
TEST9 77777
TEST4 66666
TEST5 99999
TEST6 12346
TEST7 11111
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CTL2CNTL DD DSN=&&TEMP1,DISP=(,PASS)
//OUTPUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INPUT1) TO(CTL2CNTL) USING(CTL1)
COPY FROM(INPUT2) TO(OUTPUT) USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL HEADER1=(' INCLUDE COND=(7,5,CH,EQ,C''',1,5,''',OR,',80:X),
OUTREC=(C' 7,5,CH,EQ,C''',1,5,C''',OR,',80:X),
TRAILER1=(' 7,5,CH,EQ,C''',1,5,''')',80:X)
/*
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