I think if you follow the standard rules from IBM for progam-entry and building the savearea-chain and at the end for returning to the caller (system)
then the most will be done ! Everywhere you can find such a simple program in IBM Assembler-Manuals with this standards - something like this,
and there is (as I know) no difference in CICS - but I will have a look. This simple coding normally runs all the time without problems. Only if - start
with your own coding.
STM R14,R12,12(R13) SAVE REGS
LR R12,R15 LOAD BASE REG
USING GETSTORG,R12 ADDRESSABILITY
LR R15,R13 OLD SAVE AREA ADDRESS
LA R13,SAVEA POINT TO NEW SAVE AREA
ST R15,4(R13) PUT OLD SAVE ADDR IN IT
users code starts here....
L R2,0(R1) GET ADDRESS OF STORAGE LENGTH
ICM R2,15,0(R2) GET ACTUAL STORAGE LENGTH
L R3,4(R1) GET ADDRESS OF AREA TO UPDATE
GETMAIN EU,LV=(2),A=(3) GET STORAGE
and ends here
L R13,4(R13) GET OLD SAVE AREA ADDRESS
LM R14,R12,12(R13) RESTORE REGS
LA R15,0 SET RC=0
BR R14 RETURN
SAVEA DC 18F'0' SAVE AREA
LTORG
END GETSTORG