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:
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.
Joined: 27 Oct 2009 Posts: 2446 Location: Netherlands, Amstelveen
Here is an example for your sortin processing, the same should be done for your sortout processing :
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
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.
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.