View previous topic :: View next topic
Author
Message
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
Can anyone help me with how to use Comparex utility with copysplit option ?
I want to compare 2 files of diff format but with same key in diff positions. I need 3 output dataset, one with common records & the other 2 with the different records ( present in file 1 & not in file 2 and vice versa).
i found COPYSPLIT option in COMPAREX online help tutorial, in which more output files like output datasets (SYSUT3A-SYSUT3E) are possible.
Couldnt find further info.. Can anyone help me ?
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
kothai,
You can achieve this using syncsort/dfsort. Do you have any of these products installed in your shop?
Thanks,
Arun
Back to top
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
Hi,
yes, I have them installed.
Syncsort uses 2 -3 steps to acheive this isnt?
Is it possible in a single step ?
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Quote:
Is it possible in a single step ?
I think it's possible.
Can you post here the LRECL/RECFM of the input/output files, position of the key field and some sample records.
Thanks,
Arun
Back to top
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
Hi Arun,
Thanks first of all for replying.
File 1 - FB - LrecL = 10 key (1,7)
File 2 - FB - LecL = 216 Key (207,7)
I need output datasets as
file 3 lecL = 216 Common records
File 4 lecl = 216 ( present in file 2 not in file 1)
File 5 LecL = 10 ( present in file 1 not in file 2)
Thanks ,
kothai. E
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Kothai,
If your shop has SYNCSORT FOR Z/OS 1.2 or above, you can try the below JCL.
Code:
//STEP1 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=file-1 --------> FB,LRECL=10
//SORTJNF2 DD DSN=file-2 --------> FB,LRECL=216
//NOMATCH1 DD DSN=file-3 --------> FB,LRECL=10 (Non matching in file-1)
//NOMATCH2 DD DSN=file-4 --------> FB,LRECL=216(Non matching in file-2)
//MATCH DD DSN=file-5 --------> FB,LRECL=216(Matching records)
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(207,7,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,10,F2:1,216),FILL=X'FF'
SORT FIELDS=COPY
OUTFIL FNAMES=NOMATCH1,INCLUDE=(11,1,BI,EQ,X'FF'),
BUILD=(1,10)
OUTFIL FNAMES=NOMATCH2,INCLUDE=(1,1,BI,EQ,X'FF'),
BUILD=(11,216)
OUTFIL FNAMES=MATCH,SAVE,
BUILD=(11,216)
If this does n't satisfy your requirement, you need to provide more inputs.
Thanks,
Arun
Back to top
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
Thanks for the response. I will try & let u know Arun
Back to top
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
Hi arun . I am getting
JOINKEYS FILE=F1,FIELDS=(1,7,A)
$
STATEMENT DEFINER ERROR
JOINKEYS FILE=F2,FIELDS=(207,7,A)
$
STATEMENT DEFINER ERROR
JOIN UNPAIRED
$
STATEMENT DEFINER ERROR
I couldnt proceed further as I am not able to follow the code.
Help if u find time
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
kothai,
Can you post here the relevant error messages from your SYSOUT.
Thanks,
Arun
Back to top
kothai New User Joined: 01 Sep 2008Posts: 32 Location: chennaii
STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,10,F2:1,216),FILL=X'FF'
$
STATEMENT DEFINER ERROR
SORT FIELDS=COPY
OUTFIL FNAMES=NOMATCH1,INCLUDE=(11,1,BI,EQ,X'FF'),
BUILD=(1,10)
SORTIN NOT DEFINED
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Quote:
SORTIN NOT DEFINED
kothai,
As the message indicates, does your jcl have a SORTIN dd statement?
SYNCSORT messages start with WER . Do you have any such messages?
Post your entire sysout messages as well as the JCL you used using the "Code" tag given. After typing your message, use "Preview" to make sure everything's fine and then do a "Submit".
Thanks,
Arun
Back to top
Please enable JavaScript!