Hi All, Please help me to solve the below Issue. I have one Key File (LRECL 80) and One Master file (LRECL) 280. MY O/P file is LRECL is also 280
I need to compare the Key file with Master file based on the position (1,17,CH) and write the O/P file with all the Matching records present in MASTER file.
For Example If there are 5000 records present in Key file , I need to retreive these 5000 records from MASTER file and write in to the O/P file.
Both the files have the matching records present in the position 1,17 of 17 CHAR length.
Please help me to acheive this using DFSORT.
Let me know if im not clear with any details. Thank you all in advance.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Assuming there are no duplicate keys within the Master file, and no duplicate keys within the Key file, you can use a DFSORT/ICETOOL job like the following:
Hi Frank,
Both of The files will not have duplicates. I tried teh above jcl and im getting But im gettin INVALID DATSET ATTRIBUTES error message.
The two i/p files are of different LRECL
1ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 15:13 ON WED A
0 DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTIN=CON,SORTOUT=OUT,
NALLOC,SZERO,EQUALS,NOVLSHRT,LOCALE=NONE,NOCHECK
SORT FIELDS=(1,17,CH,A)
MODS E35=(ICE35DU,12288)
ICE043A 3 INVALID DATA SET ATTRIBUTES: CON LRECL - REASON CODE IS 05
ICE751I 0 C5-K48846 C6-K90014 C7-K45047 C8-K46331 E7-K48846
ICE052I 3 END OF DFSORT [/code]
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sorry, I misread your original post. I thought both of your input files had LRECL=280, but rereading it, I see that one has 80 and the other has 280.
I'll post a solution for that after my lunch.
To continue to above query, apart from the matching key output; is there any possibility to write key file record which doesn’t have matching record in master file?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
To continue to above query, apart from the matching key output; is there any possibility to write key file record which doesn’t have matching record in master file?
It's not clear to me what you want to do.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
File1 (Key file) and File2 (Master file) has unique records and in sorted order.
File1 attributes:
LRECL – 12
RECFM – FB
Key Position – column 1 to column 12
File2 attributes:
LRECL – 2200
RECFM – VB
Key Position – column 1 to column 12
If file1 key (column: 1 to 12) has match in file2 (column: 1 to 12), then I need file2 record in output1 file.
If file1 key has no match in file2, then I need file1 record in output2 file.
In our organization we have both DFSORT and SYNCSORT. When I use EXEC PGM=SORT it is using syncsort and i am getting following syntax errors.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 37FA6, MODEL 2097 605
SYSIN :
JOINKEYS F1=IN1,FIELDS=(1,12,A)
*
JOINKEYS F2=IN2,FIELDS=(5,12,A)
*
REFORMAT FIELDS=(F2:1,4,?,F1:1,12,F2:5)
*
JOIN UNPAIRED,F1
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'B'),
BUILD=(1,4,18)
OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'1'),
VTOF,BUILD=(6,12)
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A REFORMAT STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Is there any option to specify in jcl to use DFSORT instead of SYNCSORT during execution?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Since you posted in the DFSORT Forum and had "DFSORT" in the Subject, I gave you a DFSORT solution. My job works fine with DFSORT.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
If you want a Syncsort solution, you should post in the correct Forum for that.
If you're asking how to invoke DFSORT instead of Syncsort with PGM=SORT, you need to ask your System Programmers which libraries you need to JOBLIB to for DFSORT.