Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Output should contain records in file1 that not in file2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Aug 20, 2008 10:49 pm    Post subject: Output should contain records in file1 that not in file2
Reply with quote

The requirement is to compare file1 with file2. Records in file2 also occur in file1. Output file3 should contain records in file1 that do not exist in file2.

Duplicate records may exist within each file and that is ok.

Record length = 138 and it is fixed block.

file1 (lrecl = 138)

test1aaa
test1bbb
test1bbb
test1ccc
test1ddd
----------------------------------------

file2 (lrecl = 138)

test1aaa
test1bbb
test1bbb
--------------------------------------
output file3 (lrecl=138) should contain

test1ccc
test1ddd
Back to top
View user's profile Send private message

Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Aug 20, 2008 11:08 pm    Post subject:
Reply with quote

....one more thing, there are no key values in the file, the comparison is to be made over the entire record length of 138.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Aug 20, 2008 11:12 pm    Post subject:
Reply with quote

Suresh,

Suppose file-1 has duplicate records which are not present in file-2.
Do you want all those duplicate records into your output file?

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

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Aug 20, 2008 11:16 pm    Post subject:
Reply with quote

Arun, yes, if file-1 has duplicate records that are not present in file-2, then those records are also required in the output file.

thanks.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 21, 2008 1:02 am    Post subject:
Reply with quote

ssk,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/138)
//IN2 DD DSN=...  input file2 (FB/138)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/138)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,138,CH) -
  KEEPBASE KEEPNODUPS WITHALL WITH(1,139) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(139:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(139:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(139,2,CH,EQ,C'VV'),
    BUILD=(1,138)
/*
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Thu Aug 21, 2008 1:12 am    Post subject:
Reply with quote

Thanks Frank, it works !! icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us