Please enable JavaScript to view this site.

When you are creating your program to be launched in the CPPD subsystem by JOBLMON you must have the following parameter defined.

Parameter

Type

Length

Description

Return Code

CHAR

1

'0' = Success

Anything else = Fail

Any other parameters that you need must be added via the Maintain Job Launcher Parameters when you add an entry to launch your program to the Work with Job Launcher and then code added to your program to retrieve these parameters.

If you are accessing files outside the CPPD library then you will need to make sure that you create a Job Description to include any additional library.

We have supplied a JOBLMON Job Description that you can copy which has the correct User and Job Queue entries to run in the CPPD Subsystem; all you will then need to do is to add the extra libraries and make sure that you add this Job Description to your Job launcher entry in Work with Job Launcher.

Referencing Job Launcher Parameters in your Program

When an Online job launcher program is running in the CPPD Subsystem the Job Name will be the Launcher Name. You can therefore retrieve the Launcher Name by referencing the Program Status Data Structure to retrieve the Job Name. This can then be used to retrieve the required parameter values by using each pre-defined parameter name from AJOBLAUP. By the use of parameters you should be able to use the same base Job Launcher program where the only difference is a couple of variables. Take the LREFUPD program for instance; you may wish to monitor more than one Docstore Library which has different Document Keys. To save you having to create several almost identical programs you can access previously stored parameters to hold the varying information.

Below we have some sample code which assumes you are using the *STD Launcher Type.

    FAJOBLAUP IF E         K DISK

    *

    * Variables

    D @@PrmN       S             like(JPPRMN)

    D @@Parm1       S          132A

    D @@Parm2       S          132A

    *

    * Parameters

    D YOURPGM       PR             ExtPgm('YOURPGM')

    D   RetCode                1A

    *

    D YOURPGM       PI

    D   RetCode                1A

    *

    * Program Status Data Structure

    D                SDS

    D  @JobName               244     253

 

    /free

    // Retrieve value for PARM1 parameter

     eval @@PrmN =  'PARM1';

     Chain (@@JobName : @@PrmN) AJOBLAUPR;

     If %Found;

          eval @@Parm1 = JPPRMV;

      EndIf;

 

    // Retrieve value for PARM2 parameter

     eval @@PrmN =  'PARM2';

     Chain (@@JobName : @@PrmN) AJOBLAUPR;

     If %Found;

          eval @@Parm2 = JPPRMV;

      EndIf;

 

    // Add your code

 

 

    // End the program

 

    *inlr = *on;

    return;

 

    /End-free