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

Eliminating records based on fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nivethitha_kumar

New User


Joined: 24 Jan 2007
Posts: 11
Location: chennai

PostPosted: Wed Feb 07, 2007 10:56 pm
Reply with quote

hi
i have two input files

file A
--------

aaaa1111
bbbb2222
cccc3333
aaaa2222
dddd4444

file B
------
cccc4444
fffff55555
gggg6666


i need to compare the files on the first 4 fields alone and need to get all the records tht are present in file A alone...

ie my output should be

output
-------
aaaa1111
bbbb2222
aaaa2222
dddd4444

i do not need cccc3333 as it matches with the first 4 fields of file2 's record cccc

Also like i have pointed out i need to have any duplicates in fileA in my output too... the records tht do not ahve any match in file B...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Feb 07, 2007 11:39 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. The output records will be in order by key. If you want the output records in the original input record order, we'd need to change the job to add a sequence number and sort on it. Let me know if you need me to show you how to do that.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
aaaa1111
bbbb2222
cccc3333
aaaa2222
dddd4444
/*
//IN2 DD *
cccc4444
fffff55555
gggg6666
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN   DD    *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) -
  KEEPNODUPS KEEPBASE -
  WITHALL WITH(1,81) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'VV'),
    BUILD=(1,80)
/*
Back to top
View user's profile Send private message
nivethitha_kumar

New User


Joined: 24 Jan 2007
Posts: 11
Location: chennai

PostPosted: Thu Feb 08, 2007 12:18 pm
Reply with quote

Thank you so much...also i checked out the sorttrck pdf .. are all the syntaxes and functions compatible with ice tool too?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Feb 08, 2007 9:19 pm
Reply with quote

Quote:
also i checked out the sorttrck pdf .. are all the syntaxes and functions compatible with ice tool too?


I don't know what you mean by this. My "Smart DFSORT Tricks" paper shows "tricks" that use functions available with DFSORT and DFSORT's ICETOOL.

If that doesn't answer your question, then please clarify what it is you're asking.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top