Anyone can send a job to the CMS batch machine. Either the batch machine can use the minimum authority for running the job granted to that batch machine's ID, or it can use the authorization granted to some user through the CONNECT command. The CONNECT command must be used to enable a user to access data in batch mode with the same authorization that user has when working with QMF interactively.
If you or your users create a procedure to run in batch, and save that procedure with SHARE=YES, anyone can display it. If the procedure also has your CONNECT ID in it, then anyone who can display that procedure can see your CONNECT ID and its associated password.
A batch machine's authority depends on your installation setup. It is possible for users to run a job and save queries, procedures, and forms under the batch machine's ID. If users are allowed to save things under the batch machine's ID instead of their own IDs, you or the database administrator must clean up the database periodically and purge what is owned by the batch machine. If items are saved in this way, let users know that what they save under the ID of the batch machine might be purged from the database on a periodic basis.
To provide a user with CONNECT authority, you must grant them access using the following query:
GRANT CONNECT TO userid IDENTIFIED BY password
You need to ensure that your own or your user's IDs are not made public.
You can use one of the following procedures:
If you are using an NLF: Users at a multilingual installation can choose the language environment for their batch QMF sessions, just as they can for their interactive sessions.
Users can execute procedures in batch mode by sending jobs to the CMS batch machine. They can then continue their sessions without waiting for those procedures to be run. For example, a user can send the following exec and continue to work:
/* Sends batch job file to batch machine */ /* Syntax: BATCHJOB fn ft <fm <batmach>> */ /* where batmach is the name of the batch machine */ /* (default is CMSBATCH) */ /* */ Parse upper arg fn ft fm batmach If batmach = '' then batmach = 'CMSBATCH' 'PUSH PUN' 'CP SPOOL PUN NOHOLD NOCONT TO' batmach 'PUNCH ' fn ft fm 'POP PUN'
You also need to tell the CMS batch machine to execute the procedure in batch mode.
Figure 255 is a sample job to start QMF in batch mode. Lowercase words in it are parts of commands filled in by you.
/* /JOB userid acctnum jobname /SET TIME 10 PUNCH 3000 PRINT 3000 *---Spool PRINTER, PUNCH and CONSOLE to userid CP SPOOL 00E CONT DIST userid TO userid NOHOLD CP SPOOL 009 NOHOLD TO userid CP SPOOL 00D NOHOLD TO userid CP SPOOL 009 START *--- Link to userid's disk CP LINK userid 191 192 RR readpass ACCESS 192 B/A *---------------------------------------------------------------* * Tailor the QMF invocation EXEC DSQ2EINV which * first links to GDDM, ISPF, DB2 for VM, QMF, and then * creates the FILEDEFs to run the job. * The result from this tailoring can be invoked * as an EXEC or can be coded in line with this * sample job. *---------------------------------------------------------------* * QMF invocation follows: * Run with code in BATCHMODE, and pass the name * of an invocation QMF PROC to run. * EXEC ISPSTART PGM(DSQQMFE) NEWAPPL(DSQE) * PARM(dcssname(DSQSMODE=B,DSQSRUN=userid.myproc)) * Other forms of QMF invocation which can be used are as follows: * DSQQMFE dcssname(DSQSMODE=B,DSQSRUN=userid.myproc)) * when QMF is started independent of ISPF * EXEC ISPSTART PGM(appl_name) * where "appl_name" is the name of the application program. * EXEC ISPSTART DCSS(dcssname) NEWAPPL(DSQE) * PARM(DSQSMODE=B,DSQSRUN=userid.myproc)) * See Customizing Your Start Procedure for more * information on these forms of QMF invocation. *----------------------------------------------------------------* * MAKE THE NLF RESOURCES NEEDED FOR THE RUN AVAILABLE *----------------------------------------------------------------* EXEC QMFBATCH DEUTSCH LMN.PROCA *---Close the PRINTER--------------------------------------------* CP SPOOL 00E NOCONT CP CLOSE 00E * You can also run an application in batch without ISPF. * You would use the following command: * EXEC MYAPEXEC /*
The job first spools the printer, punch, and console, and then accesses the user's A-disk as an extension of the batch machine's A-disk. Having done this, it invokes an exec to allocate the necessary resources and start QMF.
Sample job notes:
EXEC QMFBATCH language procwhere language is the language for the session and proc is the name of the QMF procedure to be run.