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
 
Compare a file with GDG versions.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Compare a file with GDG versions.
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 Moderator


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

PostPosted: Wed Apr 04, 2007 9:17 pm    Post subject:
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    Post subject: Wt recfm and lrecl signify here?
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 Moderator


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

PostPosted: Thu Apr 05, 2007 12:50 am    Post subject:
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    Post subject: Re: Compare a file with GDG versions.
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    Post subject: Re: Compare a file with GDG versions.
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 Moderator


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

PostPosted: Thu Apr 05, 2007 8:42 pm    Post subject:
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    Post subject: Re: Compare a file with GDG versions.
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    Post subject: Re: Compare a file with GDG versions.
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    Post subject: Re: Compare a file with GDG versions.
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

Site Director


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

PostPosted: Fri Apr 06, 2007 9:03 pm    Post subject:
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    Post subject:
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    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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

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