Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT: Keys match but not the rest of the record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
balimanja

New User


Joined: 14 Aug 2007
Posts: 38
Location: Bangalore

PostPosted: Wed Aug 15, 2007 7:19 pm    Post subject: SYNCSORT: Keys match but not the rest of the record
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

Moderator Team Head


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

PostPosted: Wed Aug 15, 2007 7:39 pm    Post subject: Reply to: SYNCSORT: Keys match but not the rest of the recor
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

Moderator Team Head


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

PostPosted: Wed Aug 15, 2007 7:41 pm    Post subject: Reply to: SYNCSORT: Keys match but not the rest of the recor
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    Post subject:
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: 38
Location: Bangalore

PostPosted: Thu Aug 16, 2007 11:20 am    Post subject:
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

Senior Member


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

PostPosted: Thu Aug 16, 2007 12:09 pm    Post subject:
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    Post subject:
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: 38
Location: Bangalore

PostPosted: Thu Aug 16, 2007 4:58 pm    Post subject:
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: 38
Location: Bangalore

PostPosted: Fri Aug 17, 2007 12:29 pm    Post subject:
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: 38
Location: Bangalore

PostPosted: Fri Aug 17, 2007 12:30 pm    Post subject:
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    Post subject:
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: 38
Location: Bangalore

PostPosted: Fri Aug 17, 2007 2:11 pm    Post subject:
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    Post subject:
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    Post subject:
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: 38
Location: Bangalore

PostPosted: Fri Aug 17, 2007 5:51 pm    Post subject:
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    Post subject:
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: 38
Location: Bangalore

PostPosted: Sat Aug 25, 2007 10:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us