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
 

 

include records not found in second of the compared files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 11:44 am    Post subject: include records not found in second of the compared files
Reply with quote

My requirement is to compare two files if the record is not found in the second include that record in another file. This should happen for all records in the first and second files. Can anyone provide a sort job to achieve this purpose.
Back to top
View user's profile Send private message

prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 12:00 pm    Post subject:
Reply with quote

Let me explain my requirement further :

Let us say my file1 has the following records:
aaaaaa
bbbbbb
ccccccc
ababab

and file2 has following records
bbbbbb
ababab
dddddd

then my file3 should contain

aaaaaa
ccccccc

Hope I made myself clear in explaining my problem
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Jun 07, 2006 12:01 pm    Post subject: Re: include records not found in second of the compared file
Reply with quote

What I understand is , whatever records are there in file A but not in file B, needs to be written in another file.

If this is the requirement then this ICETOOL job would do it.
Since you have not given the LRECL etc..I have written it according to my files ...

Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=XXXXXXXXXXXXXXX,DISP=SHR
//IN2 DD DSN=YYYYYYYYYYYYYYYYY,DISP=SHR
//OUT12 DD  SYSOUT=*
//T1   DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//        DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)                     
COPY FROM(IN2) TO(T1) USING(CTL2)                     
SPLICE FROM(T1) TO(OUT12) ON(1,16,CH) -               
  WITH(66,1) KEEPNODUPS USING(CTL3)                     
//CTL1CNTL DD *                                       
  OUTREC FIELDS=(1,64,65:C'11')                       
/*                                                     
//CTL2CNTL DD *                                       
  OUTREC FIELDS=(1,64,65:C'22')                       
/*                                                     
//CTL3CNTL DD *                                       
  OUTFIL FNAMES=OUT12,INCLUDE=(65,2,CH,EQ,C'11'),     
  OUTREC=(1,64)                                       
/*                                                     
//
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 12:05 pm    Post subject:
Reply with quote

I appriciate your concern and thank you for the quick reply .I will try it and let you know the result
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 12:32 pm    Post subject:
Reply with quote

My first file has record length 80 with FB and following key

01 RAADMS01-RECORD.
10 ADM-NPT-HOME PIC S9(5) COMP-3.
10 ADM-NPT-PAT-NO PIC S9(5) COMP-3.

Second has length 362 with VB and following key

01 DETL-LNK-RECORD.
05 DETL-LNK-SECTION1.
10 DETL-LNK-HOME PIC S9(05) COMP-3.
10 DETL-LNK-PAT-NO PIC S9(05) COMP-3.

I need to compare both for combination of the above given two fields.

Third file should of same format as first.

Can you just supply the modified job for the these details.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 1:24 pm    Post subject:
Reply with quote

Hi ap_mainframes

I got the following messages when I used your JCL:

CTL1CNTL :
OUTREC FIELDS=(1,80,81:C'11')
*
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER001A COL 1 OR 1-15 NOT BLANK
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Can you kindly let me know where I am wrong
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 2:31 pm    Post subject:
Reply with quote

Thanks Hi ap_mainframes , your JCL helped resolve my problem.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Wed Jun 07, 2006 2:54 pm    Post subject:
Reply with quote

Hi,
If you are having the latest release of SYNCSORT,the following JCL will work for you.

Code:


//PS030    EXEC  PGM=SORT                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTJNF1 DD *
aaaaaa
bbbbbb
ccccccc
ababab
//SORTJNF2 DD *
bbbbbb
ababab
dddddd
//SORTOUT  DD DSN=XXX.XXX.COMB,                 
//             DISP=(,CATLG,DELETE),                             
//             UNIT=XXX,                                       
//             SPACE=(CYL,(55,55),RLSE)                         
//SYSIN    DD *                                                 
  JOINKEYS FILES=F1,FIELDS=(1,6,A)                             
  JOINKEYS FILES=F2,FIELDS=(1,6,A)
  Join unpaired,f1,only                             
  REFORMAT FIELDS=(F1:1,6)                                     
  SORT FIELDS=COPY                                               
//*                                                             



Thanks
Krishy
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 07, 2006 3:17 pm    Post subject:
Reply with quote

Krishy,

I dont know how to thank you but your solution worked fine and I need not write a file matching program to get the third file.

Thanks once again
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Wed Jun 07, 2006 9:41 pm    Post subject:
Reply with quote

Hi Prasad,
You are most welcome.

Thanks
Krishy
Back to top
View user's profile Send private message
hipatnaik
Warnings : 1

New User


Joined: 16 Aug 2005
Posts: 7
Location: NewJersey

PostPosted: Thu Feb 01, 2007 12:16 pm    Post subject: Re: include records not found in second of the compared file
Reply with quote

HI,
If i want to keep the matching recods in another file then what commands we need to give?
Thanks in advance.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Wed Feb 14, 2007 1:08 am    Post subject: Re: include records not found in second of the compared file
Reply with quote

hipatnaik,
Please remove the unpaired command and run the job.You will get all the matched records in the sortout file.

I was not looking to the forum for long time.

Thanks
Krishy
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


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