Iam having 2 sequential Files. Both files are having common Records and uncommon Records.
My Requirement is I wanted to write common Records into one file and Uncommon records which is having in the first file needs to write into one file and in the same way i need to write uncommon records which is having in the second file, i need to write into a seperate file.
So finally 3 output files will come.
1. Common Records in 2 files.
2. Uncommon Records in First file
3. Uncommon Records in 3rd file.
Could you please help me out how to write a JCL for this requirement.
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
Hi Samba,
What sort do you have?
Did you scan some of the posts in the DFSORT/ICETOOL forun? Your solution is probably already there.
Quote:
1. Common Records in 2 files.
2. Uncommon Records in First file
3. Uncommon Records in 3rd file.
Did you mean the 2nd file?
Could you provide sample input for both files and what you want the input to look like in your 3 output files? Use the "CODE" button for your sample data and "preview" to see how it looks.
Include recform and lrecl and anything special, like the "commen" key and the presense of duplicates on one or the other inputs.
Information leads to knowledge and knoledge is power.
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
sambasivarao wrote:
Using the SPLICE parameter 11, 12 and 22 adding as identifiers.
Why we are doing this one. Iam not clear about this.
The two digits show which file the record was in to start while splicing the second digit on a match leaves the output of the matches altered. 11 or 22 were no match and 12 was a match making it easy for the outfil include to split the combined data to the three required outputs.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Using the SPLICE parameter 11, 12 and 22 adding as identifiers.
Why we are doing this one.
Samba,
I actually explained that in the discussion of that Topic:
Quote:
The trick here is to add an identifier of '11' to the File1 records, add an identifier of '22' to the File2 records, and splice the second id byte for matching records so we get '12' for names in both files, '11' for names only in File1 and '22' for names only in File2.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Ekta,
I'm not sure why you're showing this "alternative" to the Smart DFSORT Trick for the same thing, but if you're going to continue to show it, would you please, please stop using concatenation as it can cause problems due to the system restriction discussed in the second bullet at:
Use one T1 MOD data set instead of T1 and T2 and concatenation.
I've fixed your job above to use a T1 MOD data set. If you feel the need to post this example again, please post the T1 MOD version, not the concatenation version.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
We put a '11' in positions 12-13 for each file1 record and a '22' in positions 12-13 for each file2 record. When file1 and file2 have a "match", WITH(13,1) splices position 13 from the file2 record (the "overlay" record) into position 13 of the file1 record (the "base" record) giving a '12'. So matching records will have a '12' in positions 12-13, whereas file1 only records will have a '11' in position 12-13 and file2 only records will have a '22' in positions 12-13.
For complete information on the SPLICE operator of DFSORT's ICETOOL, see:
Here iam having one more doubt.... Could you please let me clarify.....
After putting the DFSORT coding in JCL....where i need to mention output files in JCL and how it will recognize that.....matching records will go to the particular Sequential file and unmatched the records will go to particular Sequential file.....
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
If you followed the example in Frank's Smart DFSORT Tricks,
Code:
* Write matching records to OUT12 file. Remove id.
OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10)
* Write FILE1 only records to OUT1 file. Remove id.
OUTFIL FNAMES=OUT1,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10)
* Write FILE2 only records to OUT2 file. Remove id.
OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10)
The FNAMES keyword points to the DD.
Did that help?
I can mention like this for this.
[* Write matching records to OUT12 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT12.DEL365,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10)
* Write FILE1 only records to OUT1 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT1.DEL365,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10)
* Write FILE2 only records to OUT2 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT2.DEL365,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10)]
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
Frank Yaeger wrote:
Quote:
Using the SPLICE parameter 11, 12 and 22 adding as identifiers.
Why we are doing this one.
Samba,
I actually explained that in the discussion of that Topic:
Quote:
The trick here is to add an identifier of '11' to the File1 records, add an identifier of '22' to the File2 records, and splice the second id byte for matching records so we get '12' for names in both files, '11' for names only in File1 and '22' for names only in File2.