Huzefa
New User
Joined: 05 Dec 2006 Posts: 83 Location: Bangalore
|
|
|
|
Hi All,
I want to compare 2 files and write the non matching records from File 2 to Output File. I coded the below JCl and it gives me a desired result. But gives me one space between each record
//SORTNM EXEC PGM=SORT
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
AAA 1
BBB 2
CCC 3
/*
//SORTJNF2 DD *
AAA 2
BBB 3
CCC 3
//SORTOUT DD DSN=MY.OUTPUT,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,3,A,5,1,A)
JOINKEYS FILES=F2,FIELDS=(1,3,A,5,1,A)
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F2:1,5)
/*
In the Output File I get the result as
-----> Blank Line
AAA 2
-----> Blank Line
BBB 3
Can somebody suggest me a solution where I can eliminate these blank Lines |
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Huzefa,
Change the below part
as
Code: |
JOIN UNPAIRED,F2,ONLY |
This will retrieve the unmatching records from file-2 alone.
Thanks,
Arun |
|