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

Copying unmatched conditons into another file


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

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Sat Mar 01, 2008 12:49 am
Reply with quote

Hi all,
my input file has the below records;Key 1-5 position

11111adfafafafadfa
22222ffadfvbvmlakl
55555afkadafffaffa
66666fadfafadsfffa
99999fafsdfaafafaf

my sort card is like the below way

sort fields=copy
include cond=(1,5,ch,eq,c'11111',or,
1,5,ch,eq,c'22222',or,
1,5,ch,eq,c'33333')

now sort with extract only 2 records as the third condition does not match with the input file keys. Is there a way that I copy all the unmatched conditons into another file like in the above case copying the key '33333' into a different file which shows the ones which were not found in the input file.

Please let me know

Thanks
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: Sat Mar 01, 2008 2:30 am
Reply with quote

You can use a DFSORT/ICETOOL job like this to get what you want. Just set up a file with the conditions instead of putting them in an INCLUDE statement as shown. I used 'F2' to identify the conditions (but you can use any id you like). Make sure the two files in the concatenation have the same LRECL.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD *     input file
11111adfafafafadfa
22222ffadfvbvmlakl
55555afkadafffaffa
66666fadfafadsfffa
99999fafsdfaafafaf
/*
//    DD *     condition file
11111 F2
22222 F2
33333 F2
/*
//OUT1 DD DSN=...  matching input records
//OUT2 DD DSN=...  non-matching conditions
//TOOLIN   DD    *
SELECT FROM(CON) TO(OUT1) ON(1,5,CH) ALLDUPS DISCARD(OUT2) -
  USING(CTL1)
/*
//CTL1CNTL DD *                                   
  OUTFIL FNAMES=OUT1,OMIT=(7,2,CH,EQ,C'F2')       
  OUTFIL FNAMES=OUT2,INCLUDE=(7,2,CH,EQ,C'F2'),   
    OVERLAY=(7:2X)                                 
/*


OUT1 has:

Code:

11111adfafafafadfa
22222ffadfvbvmlakl


OUT2 has:

Code:

33333


Note that if you already have the INCLUDE statement and don't want to put the conditions in a file manually, you could use the INCLUDE statement as an input file and have DFSORT create an output file for the conditions automatically that you can use in the concatenation.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Mar 01, 2008 2:34 am
Reply with quote

Quote:
//TOOLIN DD *
SELECT FROM(CON) TO(OUT1) ON(1,5,CH) ALLDUPS DISCARD(OUT2) -
USING(CTL1)


What is USING(CTL1)?
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: Sat Mar 01, 2008 2:42 am
Reply with quote

Oops. I forgot to copy/paste it. I've added it in. Thanks for letting me know.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top