Use PM

PURPOSE:  The USE PM command executes a Process Module (PM) object.  This command cannot be used to execute a PM with a Master Data Set declared in the Control Section.  Use the VIA clause with one of the command EXTRACT, REPORT, SELECT, ALTER, DELETE, PURGE, MERGE, UPDATE or SORT.

Syntax

USE PM pm.name [IN DBL dbl_name]

[EQUATE \\ {ds_name; dbl_name; di_name} TO designator\\] [PRESERVE TEXT]

[REPORT n [APPEND/ING/] TO sf_name;

[...[,] REPORT n [APPEND/ING/] TO sf_name;

[...,n [APPEND/ING/] TO sf_name]]

USE PM pm.name

references the PM to be executed and sets that name to @PM_NAME.

IN DBL dbl_name

is used to execute a PM that is stored in a Data Base Library (DBL) other than the current one.

EQUATE ds_name TO designator

gives the name of an auxiliary DS that is to be associated with a designator already assigned to a Schema Definition (SD) in a RELATE statement in the PM.  Any DS that satisfies the SD can be used.  The command must contain an EQUATE subclause for each auxiliary RELATE statement that names a SD instead of a DS.  If all auxiliary DS’s are related in the PM by DS name rather than an SD name, this clause must not be used.  It cannot change an assigned DS but is used only when a SD is assigned in the RELATE statement.

EQUATE di_name TO designator

gives the name of an auxiliary Data Index (DI) that is to be associated with a designator already assigned to an Index Definition (ID) in a RELATE statement in the PM.  Any DI that is associated to the ID can be used.  The command must contain an EQUATE subclause for each auxiliary RELATE statement that names an ID instead of a DI.  If all auxiliary DI’s are related in the PM by DI name rather than ID name, this clause must not be used.  It cannot change an assigned DI, but is used only when an ID is assigned in the RELATE statement. EQUATE dbl_name TO designator gives the name of the DBL that is to be associated with a designator assigned by a RELATE DBL FROM COMMAND statement.

PRESERVE TEXT

prevents the text returned by @COMMAND_TEXT function from being cleared by a subsequent USE CM or USE PM command.  This text is a line image of the most recent command line used to invoke an equated command and can be parsed and used in the equated Command Module (CM) or PM.

REPORT n [APPENDING] TO sf.name

gives the System File (SF) name that is to receive REPORT n.  This subclause is optional, since all report files can be named in the RELATE statement in the PM.  However, using this subclause in the command allows a given report to be sent to a different SF each time the PM is run.  If this clause is used, the parallel RELATE statement for the same report must be:

RELATE SF FROM COMMAND AS REPORT n

REPORT n APPENDING] TO sf.name

If a report is related in the PM as FROM COMMAND, but a SF is not specified in the command to receive that report, the report will display at the terminal.

The APPENDING option in the REPORT TO clause adds the new report data to the end of an existing SF.

If more that one report is needed in a USE PM command, there is no need to repeat the word REPORT for the second and subsequent reports.  If the word REPORT is omitted for the second and subsequent report, a comma must separate each REPORT TO clause.  If the word REPORT is repeated, the comma is optional.

EXAMPLES

*USE PM ...
REPORT 1 TO MTD_SALES &
REPORT 2 APPEND TO YTD_SALES&
REPORT 3 TO PAY_TERMS

In this example, the word REPORT is repeated each time, so a comma is not necessary to separate each clause.  The data for the second report will be appended to existing data in the SF YTD_SALES.

*USE PM ...
REPORT 1 TO MTD_SALES, &
2 APPEND TO YTD_SALES, &
3 TO PAY_TERMS

In this example, the word REPORT is not repeated each time, so a comma must be used to separate each clause.  The data for the second report will be appended to existing data in the SF YTD_SALES.

*USE PM VERIFY<CR>
*USE PM ADD_AUTH EQUATE AUTHORS TO AUX3<CR>

The PM ADD_AUTH, which is executed by the above command, must contain a RELATE statement that relates the Schema Definition (SD) of Data Set (DS) AUTHORS:

00060  RELATE SD AUTHORS AS AUX3

SEE ALSO:  Interactive Command Language, EQUATE command, “Stand-Alone Process Modules”, @COMMAND_TEXT - System Function