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

SYNCSORT E15 exit routine- tapping the ommitted records


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

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jan 27, 2009 5:27 pm
Reply with quote

Hi,

Do we have a way to tap the omitted records from E15 exit routine?

My requirement is to split the input file into two based on some criteria (Match-merge processing). The processing will be done inside E15. Here we can eliminate the unwanted records. I wanted to check if we have a method to form another sort out file.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jan 27, 2009 5:29 pm
Reply with quote

One method I could think of is writing the unwanted records into a new file inside the program. But, I guess that will increase the I/O processing. It could be efficient if SORT could take care of it.

Thanks,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jan 27, 2009 5:37 pm
Reply with quote

Perhaps if you elaborated on the conditions for omitting records we may be able to suggest
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jan 27, 2009 7:04 pm
Reply with quote

We have something called a rolled out department. I'll have the rolled out departments in an input file which will be compared against SORTIN. If they match, I want the record in SORTIN in SORTOUT. If they do not match, I need the record in another file. I do not have any key in the SORTIN to identify which type of record is it(Rolled out/non-rolled out). We do not want to append anything extra(which could have made the solution simpler).

SORTIN
----------

DEPT13409dknvfkh
DEPT23409dknvfkh
DEPT33409dknvfkh
DEPT43409dknvfkh
DEPT43409dknvfkh
DEPT23409dknvfkh
DEPT33409dknvfkh

ROLL-DEPT
--------------
DEPT1
DEPT4
DEPT9


SORTOUT
-----------
DEPT13409dknvfkh
DEPT43409dknvfkh
DEPT43409dknvfkh

Desired SORTOUT02
-----------------------

DEPT23409dknvfkh
DEPT33409dknvfkh
DEPT23409dknvfkh
DEPT33409dknvfkh

We would set a return code of 0 if matches or 4 if does not match.
0 would write into SORTOUT.
Where will the record go if return code = 4?
Will it be Lost? or could it be found somewhere else somehow?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 27, 2009 7:48 pm
Reply with quote

It looks like You are hiding something...
for a simple two files match problem ( as Your data seems to describe )
there is no need for a E15 exit
search the forums with syncsort two files match and You will find many samples for Your need
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jan 27, 2009 8:06 pm
Reply with quote

Hi,

I'm in agreement with Expat, however, you may check this link www.ibmmainframes.com/about36475.html
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 27, 2009 11:24 pm
Reply with quote

Bharath Bhat,

As already mentioned in this thread, you'll find many examples in this forum for two-file matches using SyncSort JOIN. If you find it difficult to adapt those to your requirement , post your requirement here so that somebody might have alternatives.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jan 28, 2009 9:59 am
Reply with quote

Pardon me.
For I forgot to mention the soul reason for using E15.icon_redface.gif

The reason behind this is, I would append another field to the SORTOUT after processing the rolled out departments. I would use another input file for getting this new field.

So my SORTOUT would look like,

DEPT13409dknvfkhID1
DEPT43409dknvfkhID5
DEPT43409dknvfkhID5


I do not have the liberty to change the LRECL of mentioned SORTOUT02.
If I would go for a sort on the last field, that would result in a file with large LRECL for SORTOUT02 than that of SORTIN. In that case I would need to use E35 exit in the same step to trim SORTOUT02. icon_mad.gif

Till now, the best I could think is to write it into a new file inside E15.

icon_confused.gif

I hope I am clear this time.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jan 28, 2009 10:59 am
Reply with quote

Bharath Bhat wrote:

We would set a return code of 0 if matches or 4 if does not match.
0 would write into SORTOUT.
Where will the record go if return code = 4?Will it be Lost? or could it be found somewhere else somehow?


I am basically looking for answers to the above questions. Probably I am unable to explain the requirement correctly. But E15 is inevitable for me in order to append the new ID.

If we can differentiate records in an input file into desired and undesired records, We can make the SORT select desired records and write into SORTOUT by issueing RETURN-CODE = 0. My question is can we make the SORT to write into another file in case if RETURN-CODE = 4 icon_question.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jan 28, 2009 11:24 am
Reply with quote

Quote:
I do not have the liberty to change the LRECL of mentioned SORTOUT02.
If I would go for a sort on the last field, that would result in a file with large LRECL for SORTOUT02 than that of SORTIN. In that case I would need to use E35 exit in the same step to trim SORTOUT02.
Bharath Bhat,

I m sorry. The above part is still not clear to me. Can you please explain what you meant by this? Also it would be better if you tell us the criteria/logic to attach the 'ID' from the 3rd file to the matching records.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jan 28, 2009 12:48 pm
Reply with quote

Arun,

If you compare the SORTIN and SORTOUT, the LRECL of SORTOUT is incremented by the length of ID. That is acceptable for me. But I want the LRECL of the second file(SORTOUT02) to be same as the LRECL of SORTIN. Had it not been a constraint, I could have just appended the ID on rolled out records and split the file into two, based on the last field.

That would create 2 files having LRECL larger than SORTIN.

The ID has a one to one relationship with Department. That will be unloaded from table to a file. With the help of that file, I'll find out the ID that has to be appended.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jan 28, 2009 1:23 pm
Reply with quote

Bharath Bhat,

From whatever you've posted so far, I believe this can achieved without exit routines. Also are you trying to force an RC=4 if any single record is written into the unmatched file - SORTOUT2?
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jan 28, 2009 2:08 pm
Reply with quote

arcvns wrote:
Bharath Bhat,

From whatever you've posted so far, I believe this can achieved without exit routines. Also are you trying to force an RC=4 if any single record is written into the unmatched file - SORTOUT2?


I need an exit routine because the requirement is not just of 2 file or 3 file match-merge. I am very sorry if my explanation leads you guys that way.

On a high level,
I am getting a file consisting millions of records (existing path). I need to do a match merge with another file on the basis of Departments. We will get two files as output, viz, matched and unmatched file. The unmatched file will go in a path which already exists.

The matched file will be input to a cobol program which has the algorithm to find out the ID for each of the records depending upon Department,segment,brick (these are the fields in matched file).
The cobol program will append the ID to the records in the matched file and write it to output file. This will be used for the new path we are trying to create.

But, since the people I am working for are efficiency concious, They do not want me to read the files twice. i.e., once in Sort (for match-merge) and again in Cobol program(for appending ID). The reason for this is we are expecting Millions of records and the Job can simply go on for hours.

By using an exit routine we are trying to save 1 I/O processing per record.


Regarding the return code,

If we set a RETURN-CODE to 0 inside the Exit routine, SORT will accept the record. If RETURN-CODE is set to 4, It will not write it into SORTOUT.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 28, 2009 2:15 pm
Reply with quote

Hello,

It will probably help if the requirement was posted in terms of what input data (all files) is to be processed and what output (all files) is to be written from the process along with suitable explanations of why each sample input record was selected or not selected and what rules were followed to create the output.

The volume of sample data does not need to be large, but just enough to demonstrate the full requirement.
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts user exit in IBM Infosphere Optim DB2 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top