I have 2 files. First file (Input1) having only 1 record is of 8 bytes containing the date in YYYYMMDD format. The second input file (Input2) having many records is of 107 bytes. This 2nd input file (Input2) contains the date from the column 100 to 107.
I need to compare both these files on the dates value and if the date matches then I need to copy all the contents from file 2 (input2) from column 1 to 99 in my output file.
For example: INPUT1
20110110
INPUT2
emp no1, name1, address,.........20110101
emp no2, name2, address,.........20110211
emp no3, name3, address,.........20110110
OUTPUT
emp no3, name3, address,.........
The JCL that I have coded is as follows:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Input 1,DISP=SHR --> file of 8 bytes
//SORTJNF2 DD DSN=Input 2,DISP=SHR --> file of 107 bytes
//SORTOUT DD DSN=Output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(230,4),RLSE),
// DCB=(RECFM=FB,LRECL=99,BLKSIZE=990)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(100,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F1:1,99)
OPTION COPY
/*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Input 1,DISP=SHR --> file of 8 bytes
//SORTJNF2 DD DSN=Input 2,DISP=SHR --> file of 107 bytes
//SORTOUT DD DSN=Output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(230,4),RLSE),
// DCB=(RECFM=FB,LRECL=99,BLKSIZE=990)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(100,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F1:1,99)
OPTION COPY
/*
However, I'm getting this error constantly:
1 SYNCSORT 3.7BR TPF1 US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 199861,5117495, OTHER PAT. PEND. (C) 1998 SYNCSORT INC. DATE=2011/089 TIME=07.25.38
z/OS 1.0.0 CPU MODEL 2097
SYSIN :
JOINKEYS FILE=F1,FIELDS=(100,8,A)
*
JOINKEYS FILE=F2,FIELDS=(1,8,A)
*
REFORMAT FIELDS=(F1:1,99)
*
SORT FIELDS=COPY
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
z/OS 1.0.0 CPU MODEL 2097
SYSIN :
JOINKEYS FILE=F1,FIELDS=(100,8,A)
*
JOINKEYS FILE=F2,FIELDS=(1,8,A)
*
REFORMAT FIELDS=(F1:1,99)
*
SORT FIELDS=COPY
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
I also tried giving PGM=SYNCTOOL, but it failed with RC 0020.
Please help me wit this problem. I need this urgently