Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2296
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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us