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
 

 

Eliminating records based on fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Eliminating records based on fields
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 Moderator


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

PostPosted: Wed Feb 07, 2007 11:39 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Feb 08, 2007 9:19 pm    Post subject:
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    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 write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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