IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT: Keys match but not the rest of the record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Wed Aug 15, 2007 7:19 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Aug 15, 2007 7:39 pm
Reply with quote

Don't double-post. This is the correct forum for SYNCSORT questions.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Aug 15, 2007 7:41 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Aug 15, 2007 10:35 pm
Reply with quote

Quote:
then fill the 260th col. with "C".


For unmatch records from which file the record is selected? Is it both?
Back to top
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Thu Aug 16, 2007 11:20 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Aug 16, 2007 12:09 pm
Reply with quote

Hi balimanja,

Please show (as suggested some sample input & expected output to get better responses.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Aug 16, 2007 1:35 pm
Reply with quote

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
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Thu Aug 16, 2007 4:58 pm
Reply with quote

Thank You Very Much Shankar, it would be really helpful if I could get your answer for Syncsort users like me.
Back to top
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Fri Aug 17, 2007 12:29 pm
Reply with quote

I am getting SD71 abend for CTL2. I could not get much information regarding this abend. I need your help.
Back to top
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Fri Aug 17, 2007 12:30 pm
Reply with quote

Sorry S7D1 abend..
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Aug 17, 2007 12:54 pm
Reply with quote

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
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Fri Aug 17, 2007 2:11 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 17, 2007 2:16 pm
Reply with quote

shankar.v,

is your solution based on DFSORT or SYNCSORT?
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Aug 17, 2007 2:23 pm
Reply with quote

dbzTHEdinosauer,

It's SYNCSORT
Back to top
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Fri Aug 17, 2007 5:51 pm
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Aug 17, 2007 6:20 pm
Reply with quote

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
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 40
Location: Bangalore

PostPosted: Sat Aug 25, 2007 10:42 pm
Reply with quote

THANK YOU ALL For your help!!

I was able to split Shankar's Logic and get it running.

Thank You Shankar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top