MDSVC34 - issue MVS console command

Most Turnkey3 users will be using the BSPOSCMD that is installed as standard with TK3 and TK4- if they want to issue console commands from batch jobs. That works perfectly well but uses RAKF facility SVC244 for authorisation, I don't know why ?. This used RAKF rule SVC34 which makes more sense to me.

Origional Purpose

The origional, and still main purpose of this program for my use, is for it to be called (via link ep=mysvc34,...) so all my programs that need to issue console commands can use this single program that ensures consistent error messages and activity logging.

While that takes more coding than just using inline SVC34 coding it is a large part of my cleanup of messages :-).

Purpose as documented here

To replace BSPOSCMD in any of my batch jobs that need to issue console commands. While that may seem a dangerous thing to allow there is obviously a need or programs such as BSPOSCMD would not exist... programs being needed pn all sites that wisely disallow the "// command" JCL method.
The advantaged to me over BSPOSCMD are

If you do not have any security product installed change the &USERAKF flag in the source code from 1 to 0, and all the RACF accedd checking code will be removed from the assembled object deck.
If you use RAKF note that this program uses FACILITY SVC34 to manage who can execute it.

For single command execution the command may be passed to the program using the standard "PARM='command' on the EXEC JCL card.

If you need to issue multiple commands instead of using a PARM value include in the JCL deck a DD for MDSVC34X to provide data cards containing the commands to be issued.

My MDSVC34 program is available here if you are interested in downloading it to tweak for you own needs.

Example usage is shown in the "testnnnn" jobsteps at the end of the JCL, but replicated here so you can see how it can be used from batch.


//* TEST0001 - Should issue the command
//*            EXPECT RC=00
//TEST0001 EXEC PGM=MDSVC34,
// PARM='D U,TAPE,OFFLINE'
//*
//* TES00002 - Should issue commands from DD card
//*            MDSVC34X ignoring comment cards
//*            EXPECT RC=00
//TEST0002 EXEC PGM=MDSVC34
//MDSVC34X DD   *
* A jolly comment card
D U,TAPE,OFFLINE
* Another jolly comment card
D U,TAPE,ONLINE
/*
//* TEST0003 - Should complain that PARM and DD card
//*            MDSVC34X cannot both be provided
//*            EXPECT RC=04
//TEST0003 EXEC PGM=MDSVC34,
// PARM='D U,TAPE,OFFLINE'
//MDSVC34X DD   *
D U,TAPE,OFFLINE
/*
//* TEST0004 - Should complain that PARM or DD card
//*            is required
//*            EXPECT RC=04
//TEST0004 EXEC PGM=MDSVC34