View previous topic :: View next topic
Author
Message
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
I have two input file A and B. I need the records from both the input files A and B. If A key matches with the B file key, I need to write to output file only from file A not from file B.
for eg :
A- file DATA
-------------
Code:
-----+----1----+-----
AAAAAAAAAAAAAAA
22222222222222222
CCCCCCCCCCCCC
ZZZZZZZZZZZZZZZ
B-File data
-------------
Code:
AAAAAAAAAAAAAAA
22222222222222222
CCCCCCCCCCCCC
ZZZZZZZZZZZZZZZ
Output I need
----------------
Code:
AAAAAAAAAAAAAAA ----->Must be from A file
22222222222222222
CCCCCCCCCCCCC
11111111111111111
ZZZZZZZZZZZZZZZ ------> Must be from A file
Key is 17 byte filed - for eg: "AAAAAAAAAAAAAAA" is a key here.
Please note File B is a VSAM-KSDS file.
I need to fulfill this requirement only with ICETOOL as per the client requirement.
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
there is a language barrier here, or You made a mistake in pasting/describing the content of the files
since in the case posted the A and B file keys are the same all the output records should come file A
please post a more significant sample and use the code tags
and clarify better Your requirement
seems silly to put a requirement on the tool to be used for a task
would it make so much difference if instead of ICETOOL SORT were used ???
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
main_prem,
11111111111111111
Where did this output record come from? It is not in either input file.
It's not clear from your explanation and example what it is you want to do.
What is the RECFM and LRECL of each input file?
Can input file1 have duplicates within it? Can input file2 have duplicates within it?
Please show a better example including duplicates within files if appropriate, and explain clearly the rules for getting from input to output.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
Back to top
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
Hi Frank,
Sorry, I think I did a mistake while copying the example.
Here is my requirement..
File A
------
Code:
AAAAAAAAAAAAAAAAAWSADFGHTK
BBBBBBBBBBBBBBBBBBBZABVCDTGY
CCCCCCCCCCCCCCCCCXCVBNMLKJ
DDDDDDDDDDDDDDDDDWERTYUIOP
File B
------
Code:
AAAAAAAAAAAAAAAAAKLJMBGHFT
1111111111111111111LMKPWASZ
2222222222222222222CXZWTYUH
DDDDDDDDDDDDDDDDDZAWERTYN
Output
-------
Code:
AAAAAAAAAAAAAAAAAWSADFGHTK
BBBBBBBBBBBBBBBBBBBZABVCDTGY
CCCCCCCCCCCCCCCCCXCVBNMLKJ
DDDDDDDDDDDDDDDDDWERTYUIOP
1111111111111111111LMKPWASZ
2222222222222222222CXZWTYUH
1) Key is first 17 bytes of the record.
2)Input File A will be in sorted order and there will not be duplicate.
3)Input File B will be in sorted order and there may be duplicates.
4)Both the Input and output file are FB and LRECL=95.
5)If the file A and B key matched, then record from file A should written to output file(In the above example ouput as 1 and 4 th record)
6)Output file should contain all the records from file A and B(as like records 2,3,4,5 in the output file).
Hope this will be clear. Please let me know if you need any more information.
Thanks!
Back to top
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
Frank,
I am at home now and I cant create the sysout now.
Thanks!
Back to top
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
To Add more:
Input file B is VSAM-KSDS and huge volume data it contains.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
3)Input File B will be in sorted order and there may be duplicates.
Quote:
5)If the file A and B key matched, then record from file A should written to output file(In the above example ouput as 1 and 4 th record)
You need to show an example with duplicates and explain the rules for what you want when file B has duplicates that match/don't match file A.
For example, what would you expect for output if FileA had the records you showed in your example, but File B had these records (with duplicates):
Code:
AAAAAAAAAAAAAAAAAKLJMBGHFT
AAAAAAAAAAAAAAAAAKLJMBGHFU
AAAAAAAAAAAAAAAAAKLJMBGHFV
1111111111111111111LMKPWASZ
2222222222222222222CXZWTYUH
2222222222222222222CXZWTYUI
2222222222222222222CXZWTYUJ
DDDDDDDDDDDDDDDDDZAWERTYN
Back to top
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
Frank,
I did some analysis in my job and found Input File B will not have any duplicate and that is VSAM-KSDS file.
So now Its clear Input file A and B will not have duplicate INSIDE the file while it coming into ICETOOL operation.
When matching the key fields A and B files, there will be duplicates at that scenario we need to take the File A record and write into output file. we should not take the B file record.
Business behind is, daily Input A file will have come up with some updates that same record will be present in file B already, In that case we need to take the record from file A to output file. Needs to ignore the B file record.
I think, Now if you see my reply posted at "Tue Oct 12, 2010 11:17 pm" will be clear.
Thanks for your quick response!
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Here's a DFSORT job that will do what I think you asked for:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file (FB/195)
//IN2 DD DSN=... VSAM input file
//OUT DD DSN=... output file (FB/195)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,17,A)
JOINKEYS F2=IN2,FIELDS=(1,17,A),TYPE=F
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,95,F2:1,95,?)
OPTION COPY
OUTFIL FNAMES=OUT,
IFTHEN=(WHEN=(191,1,SS,EQ,C'B1'),BUILD=(1,95)),
IFTHEN=(WHEN=NONE,BUILD=(96,95))
/*
Back to top
main_prem New User Joined: 16 Mar 2005Posts: 8 Location: chennai
Frank,
Thanks a lot!!!!!
You are really Great!!
Its working perfectly..
One question..Can I attain this through ICETOOL? SYSIN keywords are same?
Anyhow. just a question..I think i requirement is done.
Thanks Again!!!!!
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job to do the same thing:
Code:
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file (FB/195)
//IN2 DD DSN=... VSAM input file
//OUT DD DSN=... output file (FB/195)
//TOOLIN DD *
COPY JKFROM USING(CTL1)
/*
//CTL1CNTL DD *
JOINKEYS F1=IN1,FIELDS=(1,17,A)
JOINKEYS F2=IN2,FIELDS=(1,17,A),TYPE=F
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,95,F2:1,95,?)
OPTION COPY
OUTFIL FNAMES=OUT,
IFTHEN=(WHEN=(191,1,SS,EQ,C'B1'),BUILD=(1,95)),
IFTHEN=(WHEN=NONE,BUILD=(96,95))
/*
Back to top
Please enable JavaScript!