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

Compare a file with GDG versions.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Apr 04, 2007 8:53 pm
Reply with quote

Hi all,

Please find below a small requirement of mine..

I have 5 versions of a GDG dataset. And I have another file called File A.

I want to compare File A records with the records in all versions of the GDG dataset, and pick the ones which do not have a match.

For E.G

Code:
File A
1
2
3


Code:

GDG Version 1
1


Code:
GDG Version 2
2



Code:
Output file
3


Output has 3, because 1,2 are there in version 1 and version 2 respectively.

Please note that all the versions of the GDG woudl have millions of records, and hence I would require something which performs things faster.
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: Wed Apr 04, 2007 9:17 pm
Reply with quote

You really haven't described what you need in enough detail.

Do you want to just keep the FileA records that don't have a match among the GDG records? Or do you also want to keep the GDG records that don't have a match in FileA? Can there be duplicates within FileA? Can there be duplicates among the 5 GDG files? You need to show a better example of the input files that covers all of the variations and show the expected output. What is the RECFM and LRECL of each file? What is the starting position, length and format of the key?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Apr 04, 2007 11:50 pm
Reply with quote

Frank
i observed that usually ur first question would be
Quote:

What is the RECFM and LRECL of each file?

What is the significance of this here?
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: Thu Apr 05, 2007 12:50 am
Reply with quote

Krishna,

Jobs must be coded differently depending on whether the RECFM is FB or VB. For FB records, the data starts in position 1. For VB records, the data starts in position 5. Also, if the SPLICE operator of DFSORT's ICETOOL is needed, we need to know the LRECL to use an "id".
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Thu Apr 05, 2007 12:50 am
Reply with quote

krisprems,
The reason for asking that question is
To provide you the best and correct solution in first shot to avoid the silly question saying that the code is not working which is generally linked with the lrec,fb ,positions and format .

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

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Thu Apr 05, 2007 2:02 pm
Reply with quote

Q1. Do you want to just keep the FileA records that don't have a match among the GDG records? Or do you also want to keep the GDG records that don't have a match in FileA?
Ans: I want to keep the records in FILE A which dont have a match among the GDG records.

Q2. Can there be duplicates within FileA? Can there be duplicates among the 5 GDG files?
Ans: There would not be any duplicates in any of the files.

Q3.You need to show a better example of the input files that covers all of the variations and show the expected output. What is the RECFM and LRECL of each file? What is the starting position, length and format of the key?

As of now, my need is just to know on a high level how i can do this comparison between GDG base and another file and get the records that do not match...

Cheers icon_smile.gif
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: Thu Apr 05, 2007 8:42 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for based on what you said. I assumed your key is in positions 1-5 and your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other situations:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//FILEA DD DSN=...  input fileA (FB/80)
//GDGS DD DSN=...   gdgs (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN   DD    *
COPY FROM(FILEA) TO(T1) USING(CTL1)
COPY FROM(GDGS) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,5,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'A')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'G')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'A'),
    BUILD=(1,80)
/*
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Fri Apr 06, 2007 6:03 pm
Reply with quote

Thanks a lot Frank icon_smile.gif I will try this out and let you know ...

Many thanks again. icon_biggrin.gif
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Fri Apr 06, 2007 6:29 pm
Reply with quote

GDG base has the following records :

Code:
1234
5678
91011
121314
151617
181920


FILE A has the following records :-

Code:
151617
181920
212223


Output file should have just the following records :-

Code:
212223



Output file should have 212223 record alone. Because all other records are already present in the GDG base !
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Fri Apr 06, 2007 7:38 pm
Reply with quote

Code:
//xu39 JOB (U,NM),                                                 
//         'ICEMAN',                                                   
//         MSGCLASS=X,                                                 
//         CLASS=0,                                                     
//         NOTIFY=&SYSUID                                               
//*JCLLIB  ORDER=xu39.CMLD.PROCLIB                                   
//S1       EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//FILEA    DD DSN=xu39.INPUT.FILE,DISP=SHR                           
//GDGS     DD DSN=xu39.YES.TESTGDG,DISP=SHR                         
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)     
//OUT      DD DSN=xu39.OUTPUT.FILE,DISP=SHR                         
//TOOLIN   DD *                                                         
COPY FROM(FILEA) TO(T1) USING(CTL1)                                     
COPY FROM(GDGS) TO(T1) USING(CTL2)                                     
SELECT FROM(T1) TO(OUT) ON(1,5,CH) NODUPS USING(CTL3)                   
/*                                                                     
//CTL1CNTL DD *                                                         
INREC OVERLAY=(80:C'A')                                                 
/*                                                                     
//CTL2CNTL DD *                                                         
INREC OVERLAY=(80:C'G')                                                 
/*                                                                     
//CTL3CNTL DD *                                                         
OUTFIL FNAMES=OUT,INCLUDE=(80,1,CH,EQ,C'A'),                           
BUILD=(1,80)                                                           
/*                                                                     


Input files are all FB and LRECL = 80.

The job abends with the following : -

Code:
SYT000I  SYNCTOOL RELEASE 1.5.1 - COPYRIGHT 2004  SYNCSORT INC.                 
SYT001I  INITIAL PROCESSING MODE IS "STOP"                                     
SYT002I  "TOOLIN" INTERFACE BEING USED                                         
                                                                               
         COPY FROM(FILEA) TO(T1) USING(CTL1)                                   
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                                 
SYT012E  SYNCSORT COMPLETED UNSUCCESSFULLY                                     
SYT030I  OPERATION COMPLETED WITH RETURN CODE 16                               
                                                                               
SYT015I  PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
                                                                               
         COPY FROM(GDGS) TO(T1) USING(CTL2)                                     
SYT019I  STATEMENT VALID; NOT PROCESSED DUE TO "SCAN" PROCESSING MODE           
                                                                               
         SELECT FROM(T1) TO(OUT) ON(1,5,CH) NODUPS USING(CTL3)                 
SYT019I  STATEMENT VALID; NOT PROCESSED DUE TO "SCAN" PROCESSING MODE           
                                                                               
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 16                     


For some reason copy from filea to t1 doesnt work icon_sad.gif(. Have tried to find out but with no luck. Please help..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 06, 2007 9:03 pm
Reply with quote

Hello,

You are using Syncsort - Frank's solution is for DFSORT. The 2 products do not have all of the same features/syntax.

You will need to find a Syncsort solution or write code to do what you need.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Mon Apr 09, 2007 4:54 pm
Reply with quote

Murali,

I used this code and got the answer fine. Me too using Syncsort

Code:
//STEP2    EXEC PGM=ICETOOL               
//FILEA    DD DSN=XXXXXX.INPUT,DISP=SHR   
//GDGS     DD DSN=YYYYYY.GDGS,DISP=SHR   
//T1       DD DSN=&&T1,DISP=(MOD,PASS)   
//T2       DD DSN=&&T2,DISP=(MOD,PASS)   
//OUT      DD DSN=ZZZZZZ.OUTPUT,DISP=SHR 
//*                                       
//TOOLIN   DD *                           
 COPY FROM(FILEA) TO(T1) USING(CTL1)     
 COPY FROM(GDGS) TO(T1) USING(CTL2)       
 SELECT FROM(T1) TO(T2) ON(1,5,CH) NODUPS
 COPY FROM(T2) TO(OUT) USING(CTL3)       
/*                                       
//CTL1CNTL DD *                           
 INREC OVERLAY=(80:C'A')                 
/*                                       
//CTL2CNTL DD *                           
 INREC OVERLAY=(80:C'G')                 
//CTL3CNTL DD *                               
 OUTFIL FNAMES=OUT,INCLUDE=(80,1,CH,EQ,C'A'),
 BUILD=(1,80)                                 
/*                                           
//TOOLMSG  DD SYSOUT=*                       
//SSMSG    DD SYSOUT=*                       
//* 



I didn't make much change to ur JCL except for adding one more temp file.
BTW, I tried the JCL given in ur post. But it didn't give me any sort of error that u got.. icon_surprised.gif
Tryout this one and let us know what happened... icon_biggrin.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
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
Search our Forums:

Back to Top