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
 
Copying unmatched conditons into another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copying unmatched conditons into another file
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 Moderator


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

PostPosted: Sat Mar 01, 2008 2:30 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Mar 01, 2008 2:42 am    Post subject:
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    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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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