Couple of questions. First, did you link your program as reentrant? If so, it isn't. SAVEAREA is in your assembled CSECT.
Second, what release of z/OS are you on? I don't recall which release it was, but if REFPROT is ON, then regardless of whether the program comes from an authorized library or not, if it's linked as reentrant its reentrancy will be enforced. That may explain the S0C4, but not the S0C1. Chuck Charles (Chuck) Hardee Senior Systems Engineer Database Administration Information Technology Services Thermo Fisher Scientific 300 Industry Drive Pittsburgh, PA 15275 724-517-2633 (Office) [email protected] -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Staffan Tylen Sent: Monday, February 13, 2012 12:31 PM To: [email protected] Subject: Abend S0C4 in an internal sort I can't get my head around this one, I'm 100% sure the answer is starring at me but I just don't see it. I'm writing an assembler program that invokes SORT using LINK. There are E15 and E35 exits to handle records going in and out of the sort, but it keeps abending with S0C4 and sometimes S0C1, depending on whether the exit routines are half or fullword aligned :( To eliminate other possible causes I created the following very simple program where the E15 exit returns RC=16 to tell SORT just to terminate without doing anything. But it also abends in the same way. The PSW seems to point at an unrelated ISPF module in the LPA, but I haven't investigated that further. This is the code: TEST60 CSECT TEST60 AMODE 31 TEST60 RMODE ANY SAVE (14,12) LR 12,15 USING TEST60,12 LA 11,SAVEAREA ST 11,8(,13) ST 13,4(,11) LR 13,11 LA 1,SORTPARM LINK EP=SORT L 13,4(,13) ST 15,16(,13) LM 14,12,12(13) BR 14 DS 0F SAVEAREA DS 18F SORTPARM DC A(SORTSTMT) DC A(E15_EXIT) DC A(E35_EXIT) DC F'-1' SORTSTMT DC AL2(SORTEND-SORT) SORT DC C' SORT FIELDS=(1,1,CH,A)' DC C' RECORD TYPE=F,LENGTH=80' SORTEND EQU * E15_EXIT DS 0F LA 15,16 Terminate SORT BR 14 E35_EXIT DS 0F LA 15,8 BR 14 END TEST60 It can't be more simple than this, like any piece of "Hello World" code. I've tried linkedit as either RENT or NORENT, same result. The sort program produces diagnostic messages on SYSOUT as expected, so it gets called OK. So, who is the first to spot the obvious flaw that I can't see? Thanks for helping out. Staffan ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

