View previous topic :: View next topic
|
Author |
Message |
Thanatopsis
New User
Joined: 02 Dec 2010 Posts: 7 Location: Houston
|
|
|
|
Hi forum,
I'm hoping someone could help me get some insight. I'm using the system macro LINK to call DFSORT from an ASM routine, and I am so close to having it working.
I want to supply an input routine and an output routine (each of which I have written and debugged already).
What i do is, point R1 at the parameter list (of course) and code this:
Code: |
LINK EP=SORT
LTR R15,R15
BNZ RTNERR
|
I'm getting the info messages from DFSORT printed in the SYSOUT DD, and they confirm that the settings I'm passing to it are being read correctly. Also, I set up a "dummy" input and output routine just to print the records as they get them, and the records are getting put into the sort, and the output routine is fetching them all. It seems to be going well, right?
But then somewhere between the final output exit call (when I have it return 8, signaling the sort to exit) and when I should be getting control back its throwing a S0C6.
I wondered if anyone has done this sort of thing before and might have a suggestion where to look for the problem. Its bewildering my what I could be telling sort to do that makes it come up with a S0C6. I thought those only happen when something didn't align where it needed to. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Did you do the saving/restoring, setup base register(s) like you would do
at the start/end of your program? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Here is an example for your sortin processing, the same should be done for your sortout processing :
Code: |
SORTIN EQU * 04610000
STM R14,R12,12(R13) SAVE SOME REGISTERS 04620000
LR R9,R15 LOAD ENTRY POINT 04630000
USING SORTIN,R9 SET UP ADDRESSABILITY 04640000
LR R14,R13 04650000
LA R13,SAVEIN 04660000
ST R14,4(R13) 04670000
ST R13,8(R14) 04680000
B SORTIN1 04690000
SAVEIN DC 18F'0' 04700000
SORTIN1 EQU *
other processing code
EOFE15 LA R15,8 SET UP END OF DATA INDICATOR 04950000
B SORTINX 04960000
SORTIN12 LA R15,12 SET UP INSERT RECORD INDICATOR 04970000
SORTINX L R13,SAVEIN+4 RESTORE 04980000
L R14,12(R13) SOME 04990000
LM R2,R12,28(R13) REGISTERS 05000000
BR R14 RETURN TO SORT 05010000
|
|
|
Back to top |
|
|
Thanatopsis
New User
Joined: 02 Dec 2010 Posts: 7 Location: Houston
|
|
|
|
Thanks for the input. Yep, I'm using standard entry/exit linkage for input and output routines. Each of them are getting called many times and exiting fine, it is only after I issue the return code 8 from my output exit that SORT gets a S0C6.
Small update: I didn't realize the address constants for my exits had to have the high order bits on to indicate the exits should be entered in AMODE31, so I added some OI instructions to turn those on. Now its the same situation, but with a S0C1 instead.
I'm chipping away at it, but any help is appreciated. Thanks again. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
0C6, 0C1 abends can mean the following :
Invalid or missing DD statement.
Reading or writing an unopened file.
Do you close your input/output correctly after finishing your sort input/output routines? And if yes not doing any IO again against the datasets?
I used the default AMODE (that is AMODE24) and never had a problem
with linking sort. |
|
Back to top |
|
|
Thanatopsis
New User
Joined: 02 Dec 2010 Posts: 7 Location: Houston
|
|
|
|
Problem solved. After your suggestion, I carefully looked at all the in's and out's of the input file I'm dealing with, and I found I was calling the read routine incorrectly. It turns out the read routine is designed to be called in a different way from cobol than from assembler, (with a flag byte to indicate the type of caller) and I based my parameter list on a COBOL example I had access to. (silly me). Something probably lined up wrong, since I'm using the assembler macro to generate the record DSECT.
Aren't the gnarliest of problems always caused by something equally as simple?
Anyway, long story short: It works now. Thanks everyone for the suggestions. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
Thanks everyone for the suggestions.
|
Well it was only me. But whatever you are welcome. |
|
Back to top |
|
|
|