View previous topic :: View next topic
|
Author |
Message |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
The scenario is as follows:
1) There are two files of record length =260.
2) There are two keys in each file both starting from col. no. 20 and col. no. 30 (of length 10 each)
My requirement is:
If the keys in both the files match, but the rest of the data in the record is not same then fill the 260th col. with "C".
Is there any way to do this using SYNCSORT?
I hope I am clear with the above explanation.
Thank you. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Don't double-post. This is the correct forum for SYNCSORT questions. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Also, I realize this is your first post, but this is the point in the process where you need to post your code, showing us what you're doing and where you're having a problem. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Quote: |
then fill the 260th col. with "C". |
For unmatch records from which file the record is selected? Is it both? |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
No, it is just from one file.
Say for eg.:
File A Keys MATCH with File B keys.
But the rest of the record in both the files (for which the keys matched) are not same. In such a case "C" needs to be populated. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi balimanja,
Please show (as suggested some sample input & expected output to get better responses. |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
balimanja,
The following code will help you, provided if file-1 and file-2 having unique key in column 20 and column 30 and both of length 10 and if match not found for other fields of matched key records, letter 'C' will be written in column 260 of file-1 records.
Code: |
// EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//FILE1 DD DSN=FILE1...
//FILE2 DD DSN=FILE2...
//T1 DD DSN=&&T1,DISP=(MOD,PASS)
//T2 DD DSN=&&T2,DISP=(MOD,PASS)
//T3 DD DSN=&&T3,DISP=(MOD,PASS)
//OUTFILE DD DSN=OUTFILE...
//TOOLIN DD *
COPY FROM(FILE1) TO(T1) USING(CTL1)
COPY FROM(FILE2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(T2) ON(20,10,CH) ON(30,10,CH) ALLDUPS
SELECT FROM(T2) TO(T3) ON(1,260,CH) NODUPS USING(CTL3)
SORT FROM(T3) TO(OUTFILE) USING(CTL4)
//CTL1CNTL DD *
INREC OVERLAY=(261:SEQNUM,9,ZD,270:C'1')
//CTL2CNTL DD *
INREC OVERLAY=(270:C'2')
//CTL3CNTL DD *
OUTFIL INCLUDE=(270,1,CH,EQ,C'1'),OVERLAY=(260:C'C')
//CTL4CNTL DD *
SORT FIELDS=(261,9,ZD,A)
OUTREC FIELDS=(1,260) |
|
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Thank You Very Much Shankar, it would be really helpful if I could get your answer for Syncsort users like me. |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
I am getting SD71 abend for CTL2. I could not get much information regarding this abend. I need your help. |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Sorry S7D1 abend.. |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
balimanja,
That code ran fine in my sytem. Can u please post the joblog, jcl and the sysout from TOOLMSG and DFSMSG, to rectify the error. |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Shankar,
Code Logic is excellent...I tried with files having fewer records, but the problem seems to be with space. Initially I tried with UNIT=SYSDA and I got SB37 abend. Then I changed it to UNIT=TAPE and now I am getting S7D1 abend. Files contain nearly 4.5 million records.
And I noticed that the CTL1 has run successfully with RC=0, but the problem is with CTL2.
Is it possible to split your logic into two steps? I am running out of volume.
Thank You, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
shankar.v,
is your solution based on DFSORT or SYNCSORT? |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
dbzTHEdinosauer,
It's SYNCSORT |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Shankar.v or dbzTHEdinosauer,
Man, I feel like like "so close yet so far"... The solution is there but it seems like there is a space problem(tried even TAPE). Unable to correct it.
Shankar, is there any way to bypass this problem of SB37 or S7D1? Like splitting your logic into two parts... Need your help.
Thank You, All |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
Quote: |
the problem seems to be with space. Initially I tried with UNIT=SYSDA and I got SB37 abend |
.
one reason for SB37 abend is space exceeded the allocated amount.
Try with DASD by using more number of cylinders such as
SPACE=(CYL,(500,500),RLSE). |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
THANK YOU ALL For your help!!
I was able to split Shankar's Logic and get it running.
Thank You Shankar |
|
Back to top |
|
|
|