View previous topic :: View next topic
|
Author |
Message |
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
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
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
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 |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
Thanks a lot Frank I will try this out and let you know ...
Many thanks again. |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
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 :-
Output file should have 212223 record alone. Because all other records are already present in the GDG base ! |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
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 (. Have tried to find out but with no luck. Please help.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
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..
Tryout this one and let us know what happened... |
|
Back to top |
|
|
|