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

write O/P file from INP1 if the key is not present in INP2


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

New User


Joined: 03 Apr 2007
Posts: 7
Location: pune

PostPosted: Fri Jan 02, 2009 9:51 am
Reply with quote

Hi All,

I have two input file and I want a output file as below:

1st Input:

XXXX 1234 HGKKJKKJGJ.......
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......

here col 6-9 is key.

2nd Input:
AAAA 7347 A H 32.....
AAAA 1234 B G 54.....
AAAA 6456 C D 76.....

here also 6-9 is key.

I want the output file in the format of 1st input file excluding the duplicate keys. Means if the key is present in 2nd file don't write the record for this key.

Output expected as
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......

Can we do it from JCL?
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: Fri Jan 02, 2009 8:19 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.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD *
XXXX 1234 HGKKJKKJGJ.......
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......
/*
//IN2 DD *
AAAA 7347 A H 32.....
AAAA 1234 B G 54.....
AAAA 6456 C D 76.....
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(6,4,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
/*
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