IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Eliminate Blank Lines in The Ouput SORTED File


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Sep 08, 2008 12:18 pm
Reply with quote

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
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 08, 2008 3:18 pm
Reply with quote

Huzefa,

Change the below part
Code:
JOIN UNPAIRED,ONLY

as
Code:
JOIN UNPAIRED,F2,ONLY

This will retrieve the unmatching records from file-2 alone.

Thanks,
Arun
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Sep 08, 2008 4:40 pm
Reply with quote

It Worked

Thanks a Lot
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top