Start Programmer Menu (STRPGMMNU)

Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC)
Threadsafe: No
Parameters
Examples
Error messages

The Start Programmer Menu (STRPGMMNU) command shows the programmer menu. This command can be used instead of the CALL QPGMMENU function, and allows you to pass parameters to specify and control the data which appears in the associated fields on the programmer menu.

NOTES:

  1. A user exit program can be called instead of submitting a job when option 3 is selected.
  2. The first four parameters control the defaults that appear when the menu is first displayed.

More information about using the Programmer Menu is in the CL information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Top

Parameters

Keyword Description Choices Notes
SRCFILE Source file Name, *DFT Optional, Positional 1
SRCLIB Source library Name, *LIBL, *CURLIB Optional, Positional 2
OBJLIB Object library Name, *DFT, *CURLIB Optional, Positional 3
JOBD Job description Name, *USRPRF Optional, Positional 4
ALWUSRCHG Allow changes *YES, *NO Optional
EXITPGM Option 3 exit program Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Option 3 exit program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DLTOPT Delete option *DLT, *PROMPT, *NODLT Optional
Top

Source file (SRCFILE)

Specifies an existing source file that contains source file members to be updated or to which new source file members are to be added.

*DFT
This is the default for the type being specified on the menu. This field is blank when shown on the display station.
name
Specify the name of the source file to be updated.
Top

Source library (SRCLIB)

Specifies the library that is searched for the source file.

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the source file. If no current library entry exists in the library list, QGPL is used.
name
Specify the name of the library where the source file is located.
Top

Object library (OBJLIB)

Specifies the library that is to contain the object.

*DFT
Blanks appear for this field. The library used depends on the menu option you selected.
*CURLIB
The current library for the job is the library that is to contain the object.
name
Specify the name of the library that is to contain the created object.
Top

Job description (JOBD)

Specifies the job description used with the job being submitted.

*USRPRF
The job description defined in the user profile of the user running the STRPGMMNU command is used for the job.
name
Specify the name of the job description used for the job. The job description is found through the library list being used by the job.
Top

Allow changes (ALWUSRCHG)

Specifies whether the menu display fields you specified on the previous parameters in this command can be changed by the user.

*YES
Values on the display can be changed.
*NO
The display fields cannot be changed.
Top

Option 3 exit program (EXITPGM)

Specifies the user-written program that is called as an exit program in place of submitting a batch job when menu option 3 is selected. When the exit program is called, it receives parameters that are sent by the programmer menu. More information about the EXITPGM parameter is in the CL information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Single values

*NONE
No user-written program is called; a batch job is submitted. When *NONE is specified, *DLT must be specified for the Delete option (DLTOPT) parameter.

Qualifier 1: Option 3 exit program

name
Specify the name of the program called when option 3 is selected, instead of submitting the create command as a batch job. When a value is specified on this parameter, the text that appears on the menu for option 3 shows the name and library of the exit program.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the program. If no current library entry exists in the library list, QGPL is used.
name
Specify the library where the program is located.
Top

Delete option (DLTOPT)

Specifies the action to be taken when:

Regardless of the value specified, the system passes a parameter (from among the parameters passed from the Programmer Menu) to the exit program that specifies whether the object exists.

*DLT
This value must be specified if *NONE is specified on the EXITPGM parameter. If an exit program is specified for the EXITPGM parameter, and the object specified to be created with option 3 exists, and the Enter key is pressed, a message is shown; press the F11 key to proceed. When the F11 key is pressed, the system deletes or replaces the object before calling the program specified by the exit program. This is the normal Programmer Menu function when an exit program is not specified.

NOTES:

  1. When the *DLT value is specified, the object is deleted or replaced before the job is submitted or the user exit program is called.
  2. If the source type is one of the following, the object is replaced rather than deleted (an exit program must be used to delete instead of replace):

            BAS       C         CBL
            CBL36     CLP       DSPF
            DSPF36    FTN       ICFF
            MNU36     MSGF36    PAS
            PLI       PRTF      RPG
            RPG36     RPT36
    

*PROMPT
The system does not delete or replace the object, but you are prompted for approval to delete the object. If the object exists, and the Enter key is pressed, a message is displayed. Press the F11 key to proceed; the system does not delete the object. The user confirms whether the object is deleted or replaced, yet the deletion is still controlled by the exit program.
*NODLT
The user exit program is called regardless of the presence of the object.
Figure: Table 1. Actions Taken by the System When an Exit Program Is Called

|-----------+----------+---------+------------|
| DLTOBJ    | F11      | Object  | Value      |
| Specified | Required | Deleted | Passed     |
|           |          |         | to Exit    |
|           |          |         | Program    |
|-----------+----------+---------+------------|
| If object                      |            |
| existed                        |            |
| when                           |            |
| option 3                       |            |
| was                            |            |
| selected                       |            |
|--------------------------------+------------|
| *DLT      | Yes      | Yes     | 1          |
|-----------+----------+---------+------------|
| *PROMPT   | Yes      | No      | 0          |
|-----------+----------+---------+------------|
| *NODLT    | No       | No      | 0          |
|-----------+----------+---------+------------|
| If object                      |            |
| did not                        |            |
| exist when                     |            |
| option 3                       |            |
| was                            |            |
| selected                       |            |
|--------------------------------+------------|
| *DLT      | No       | ---     | 2          |
|-----------+----------+---------+------------|
| *PROMPT   | No       | ---     | 2          |
|-----------+----------+---------+------------|
| *NODLT    | No       | ---     | 2          |
|-----------+----------+---------+------------|

Top

Examples

Example 1: Displaying Programmer Menu

STRPGMMNU

This command displays the Programmer Menu with defaults for all parameters. This has the same result as entering CALL QPGMMENU.

Example 2: Preventing Values from Being Changed

STRPGMMNU   SRCFILE(YOURFILE)  SRCLIB(YOURLIB)  OBJLIB(YOURLIB)
            JOB(YOURJOBD)  ALWUSRCHG(*NO)

This command prevents the values on the menu from being changed from those specified on the command.

Example 3: Calling an Exit Program

STRPGMMNU   EXITPGM(OPT3PGM)  DLTOPT(*PROMPT)

This command calls user exit program OPT3PGM instead of submitting a batch job when option 3 is specified. If the object already exists, DLTOPT(*PROMPT) requires the user to press the F11 key; however, the object is not deleted.

Example 4: Receiving Parameters

The following portion of a CL program is an example of how these parameters would be received by a user exit program. If the specified type is one of those listed, the object is not deleted. The create command with REPLACE(*YES) specified is passed to the exit program. The value passed to the exit program is 0.

PGM   PARM(&OPTION &PARM &TYPE &PARM2 &SRCFILE  +
           &SRCLIB &OBJLIB &JOBD &RQSLEN &RQSDTA512  +
           &F4 &F11 &EXIST)
/* The following values are passed in exactly as  */
/* they appear on the Programmer Menu.            */
DCL   VAR(&OPTION)   TYPE(*CHAR)  LEN(2)
DCL   VAR(&PARM)     TYPE(*CHAR)  LEN(10)
DCL   VAR(&TYPE)     TYPE(*CHAR)  LEN(10)
DCL   VAR(&PARM2)    TYPE(*CHAR)  LEN(21)
DCL   VAR(&SRCFILE)  TYPE(*CHAR)  LEN(10)
DCL   VAR(&SRCLIB)   TYPE(*CHAR)  LEN(10)
DCL   VAR(&OBJLIB)   TYPE(*CHAR)  LEN(10)
DCL   VAR(&JOBD)     TYPE(*CHAR)  LEN(10)
/* The following values are derived by QPGMMENU     */
/* from the information entered to the above fields */
/* and the F keys.                                  */
/* NUMBER OF BYTES OF REQUEST DATA */
DCL   VAR(&RQSLEN)  TYPE(*DEC)  LEN(3 0)
/* DATA FOR RRQSDTA PARAMETER OF SBMJOB COMMAND. */
DCL   VAR(&RQSDTA512)  TYPE(*CHAR)  LEN(512)
/* F4 WAS PRESSED, '1', OTHERWISE '0'.   */
DCL   VAR(&F4)  TYPE(*CHAR)  LEN(1)
/* F11 WAS PRESSED, '1', OTHERWISE '0'.     */
DCL   VAR(&F11)  TYPE(*CHAR)  LEN(1)
/* OBJECT EXISTS- '0 OBJECT WAS DELETED- '1'
OR OBJECT DID NOT EXIST -'2'*/
DCL   VAR(&EXIST)  TYPE(*CHAR)  LEN(1)

Additional information, along with examples of the STRPGMMNU command with the EXITPGM parameter, can be found in the CL Programming book in the Information Center.

Top

Error messages

None

Top