Implementing custom display commands in MVS3.8J (OS/VS2)

I let this slide since october last year, but have started looking into it again. As I noted in an earlier post IEE3503D seemed the most likely candidate, and that was a correct guess.


CBT tape 486 file 887 has a way too complicated example of an implementation of adding extra commands. Way too complicated in that it depends on a usermod from the same file to create extra system control blocks… and is not at a TK3 level for SMP either, if used it will actually remove a whole heap of required programs from linklist.
And of course I don’t want to have to re-apply a usermod every time I want a new command anyway.


So, going my own way :-)

  • I used as a base the copy in MVSSRC.SYM101.F13(IEE3503D) in the vague hope it is the latest, I haven’t found a copy in a SMP distribution library yet
  • The changes I made to it were pretty simple. Immediately prior to the jump to the error routine to report a display command was not found I implemented a ‘load ep’ call to locate a MID3503D program,
    • if the program is found in the linklist it will be called to check for additional commands to be processed; if command is processed (rc=0) good, if the command was not found in the linklist module (rc<>0) the origional display command not found routine is still called
    • if the program is not found in the linklist the origional code to report the display command was not found is used (although there will be the obligatory 0806 error message written to the console saying program MID3503D was not found)
  • I used SMP4 to update the source for IEE3503D only. That allowed SMP4 to handle the re-assembly and link editing to all affected OS modules, correctly. The TK3 provided SMPAPP PROC worked OK for that (both in SMP4 install and restore(rollback)).

After IPL’ing with CLPA everything works as expected; prior display commands still work and unknown commands try to locate program MID3503D from the linklist and just write a 806 program not found error message to the console before falling through to the normal bad command message.

And :-) :-) :-) I tested the rollback job to backout the update as well.

I am comfortable my changes will work as intended. Entering valid and invalid display commands show expected results (valid display commands work, invalid display commands try to run MID3503D and correctly handle the missing module as seen below.

WithUsermod

So implementing new commands is just a case of providing them in the MID3503D program, and assembling it into any linklisted library, the module does not need to be APF authorised (unless you are doing something that needs that of course).

Does it work, or course it does. In the screenshot below the batch job assembled my current MID3503D into a linklisted library, and additional commands were available like magic.

In my sample program I copied the “D APF” code from the CBT example mentioned above into my MID3503D module and it works OK with that extra command. Specifically there is no longer a module not found error and the D APF command now works.

WithMID3503D

So adding additional console display commands now is just a case of modifying MID3503D and re-assembling it; although in 3.8J you have to IPL to pickup the changed linklist PDS directory to see the changed module of course.

And deleting the MID3503D module and re-ipl’ing will backout anything you screw up; no messy SMP required.

Anyway, the detailed description and files needed are here should you be a turnkey3 user wanting to create new commands.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in MVS3.8J. Bookmark the permalink.