You're getting the S0C4 because the WTO macro altered the register 1 that was sent to your program.
As a miscellaneous note, an END statement for a program that is intended to be used as a subroutine should not specify an entry point.
As another miscellaneous note: OS/360 save areas should be on a double threaded list. What this means is that when you establish your save area, your caller's save area should point to your save area. I always do something like
The first store connects your save area to the caller's save area; the second store connects the caller's save area to your save area.
There's nothing "wrong" in your code in that respect, but by not doing the complete job dump programs can't do a proper save area trace. Finally, the standard IBM macro library provides a SAVE macro that will do the same STM you do, but it will also insert a character string that the dump program save area trace will insert into the dump:
The bad news is the SAVE macro that inserts a program ID effectively requires that register 15 points to the start of your program. You can do more:
is a very convenient way to add a sort of version control by inserting the date and time of the assembly into the program ID text. The macro library also provides a RETURN macro that will do the same LM you do, and it will also flag the save area to indicate it's no longer in use, though the save area trace in the dump program ignores this flag. The library RETURN macro also proves a mechanism to set a return code in register 15. These conventions have been essentially unchanged for more than 40 years, though they do extract a minor performance penalty in your program on modern hardware, which is one reason IBM developed the XPLINK convention in LE.