|
View previous topic :: View next topic
|
| Author |
Message |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi,
I have two i/p files whose recl and the format are same. Record length is 500. I have to do comparison as per below condition
Compare first 1-388(key1) and then 393-500 (Key2) . Matched records will go to the Match1 file and unmatched records will go to the UNMAT1 file.
Can anyone plz suggest.
Regards,
Abhijit. |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Have you looked at Smart DFSORT Tricks
The section on "Match and no match, FB, key in same place, no duplicates" seems easily adaptable to your needs. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
Have you looked at Smart DFSORT Tricks
The section on "Match and no match, FB, key in same place, no duplicates" seems easily adaptable to your needs. |
Right. And if you have the Nov, 2009 PTF, you can use JOINKEYS as well - see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
If you need more specific help, show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
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 |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
The two i/p files recfm is fixed and the LRECL is 500. I need to compare the records as follows:
file1's 1-388 length will be compared with file2's 1-388 length and then
file1's - 393-500 length will be compared with file2's 393-500 length and
and from position 389-392 should be ignored.
The o/p file should only contain the unique records.
File1's record count is : RECORD COUNT = 11633753
File2's record count is : RECORD COUNT = 11630895 |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| I can't help you until you supply ALL of the information I asked for. See my previous post for the information I need. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
| Actually I have made some changes to my cobol program. And due to that the file after run is showing more records than before run. I need to find the extra records and need to analyse why these extra records came. I had only done changes from 389-392 position of the file . So, in both the file this particular fields may/may not vary but there should not be no mismatch in the record count. So, that is the reason I need the unique records in my o/p file. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
1st file:
cols---1-----------------------388-389-390----------------------500
value-11111111111a--------100- 0 - 2009010120101231a--
value-11111111111a--------000- 0 - 2008010120081231i--
value-12111111111a--------000- 0 - 20100101 a--
value-12111111111a--------100- 0 - 2009010120091231i--
value-12111111111a--------000- 0 - 2008010120081231i--
2nd file:
cols---1-----------------------388-389-390----------------------500
value-11111111111a--------100- 0 - 2009010120101231a--
value-11111111111a--------100- 0 - 2008010120081231i--
value-12111111111a--------075- 0 - 20100101 a--
value-12111111111a--------100- 0 - 2009010120091231i--
value-12111111111a--------000- 0 - 2008010120081231i--
First 12 bytes are customer numbers and these have multiple records based on effective dates and end dates. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
| Please provide me some tricks....Also I am checking from google and the doc that was posted earlier.... |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
abhijit,
Here's a DFSORT/ICETOOL job that will do what I think you're asking for:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/500)
//IN2 DD DSN=... input file2 (FB/500)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/40)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,388,CH) ON(393,108,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(501:C'1 ')
/*
//CTL2CNTL DD *
INREC OVERLAY=(502:C'1')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
BUILD=(1,40),
TRAILER1=('FILE1 RECORD COUNT = ',
TOT=(501,1,ZD,M10,LENGTH=8),/,
'FILE2 RECORD COUNT = ',
TOT=(502,1,ZD,M10,LENGTH=8))
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you have the Nov, 2009 PTF, you can do the same thing with the following DFSORT JOINKEYS job:
| Code: |
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/500)
//IN2 DD DSN=... input file2 (FB/500)
//SORTOUT DD DSN=... output file (FB/40)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,388,A,393,108,A)
JOINKEYS F2=IN2,FIELDS=(1,388,A,393,108,A)
JOIN UNPAIRED,ONLY,F1,F2
REFORMAT FIELDS=(?)
OPTION COPY
INREC IFOUTLEN=2,
IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),OVERLAY=(C' 1'))
OUTFIL REMOVECC,NODETAIL,
BUILD=(40X),
TRAILER1=('FILE1 RECORD COUNT = ',
TOT=(1,1,ZD,M10,LENGTH=8),/,
'FILE2 RECORD COUNT = ',
TOT=(2,1,ZD,M10,LENGTH=8))
/*
|
|
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi ,
I am getting S0B37 error with the ICETOOL option. Can anyone have idea.
Regards,
Abhijit |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Have you searched what S0B37 is? |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
I reduced the size of the i/p files and now its running fine. But in the output file no records are coming only trailer records are coming.
i.e.
FILE1 RECORD COUNT = 48
FILE2 RECORD COUNT = 48
But i need the unique records also. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
I reduced the size of the i/p files and now its running fine. But in the output file no records are coming only trailer records are coming.
i.e.
FILE1 RECORD COUNT = 48
FILE2 RECORD COUNT = 48
But i need the unique records also. |
Sigh. In my first post, I said:
| Quote: |
| If you need more specific help, show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. |
The only output you showed was the record counts, so that's what I gave you. Now you complain that it isn't the correct output. Sheesh.
If you want the unique records as well as the record counts, change your CTL3CNTL statements to:
| Code: |
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,
BUILD=(1,500),
TRAILER1=('FILE1 RECORD COUNT = ',
TOT=(501,1,ZD,M10,LENGTH=8),/,
'FILE2 RECORD COUNT = ',
TOT=(502,1,ZD,M10,LENGTH=8))
|
If that doesn't give you what you want, then you need to give me ALL of the information I asked for.
| Quote: |
| I am getting S0B37 error with the ICETOOL option. Can anyone have idea |
A B37 means you haven't given large enough SPACE values for the data set that's getting the B37. You need to increase the SPACE values. Of course, since you didn't tell us which data set you got the B37 for, what SPACE parameters you used, how many records you had, etc, we can't help you much.
You really need to learn how to do a better job of giving information if you want people to help you. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi Frank,
Thanks for all ur valuable inputs and I am able to get the results...Again I am very much thankful to u..  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|