USE PROC command: Difference between revisions
No edit summary |
|||
(One intermediate revision by one other user not shown) | |||
Line 79: | Line 79: | ||
<p> | <p> | ||
Save the result of <code>VIEW USERID</code> as Procedure -1 and shift the lower level procedures down one: </p> | Save the result of <code>VIEW USERID</code> as Procedure -1 and shift the lower level procedures down one: </p> | ||
<p class="code"> | <p class="code">USE PROC -1 INS | ||
USE PROC -1 | VIEW USERID | ||
</p> | </p> | ||
<p> | <p> | ||
Line 118: | Line 118: | ||
The procedures shift down one; a new procedure replaces Procedure -1; Procedure 0 is empty because Procedure -4, which was empty, overlays Procedure 0.</p> | The procedures shift down one; a new procedure replaces Procedure -1; Procedure 0 is empty because Procedure -4, which was empty, overlays Procedure 0.</p> | ||
[[Category: | [[Category: User commands]] | ||
[[Category:Commands]] | [[Category:Commands]] |
Latest revision as of 16:30, 22 March 2017
Summary
- Privileges
- Any user
- Function
- Model 204 can spool the USE data set output into a temporary user procedure. This option lets you save various system command outputs or program output into a temporary procedure.
Syntax
USE PROC number option
Where:
number | is the temporary procedure number (default = 0), for example, -1 or -2. | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
option | is one of the options described in the following table.
|
Usage
Because the USE PROC command manipulates temporary procedures, calling it from within a temporary procedure cannot always be permitted. You cannot issue a USE PROC command where it would manipulate the calling procedure or any procedure on the active INCLUDE chain. Attempts to do so are prevented, the transaction is cancelled, and following message is displayed.
M204:2478: 'USE PROC' REJECTED, WOULD OVERWRITE CURRENTLY ACTIVE PROC.
Temporary procedures are stored in CCATEMP. If an additional CCAPTEMP page is required to process a $BldProc call, but CCATEMP is full, then the request is cancelled and the entire temporary procedure is deleted. After the request is cancelled, the procedure does not contain everything up to the point of failure. In the event of CCATEMP filling while processing $BldProc, the following message is issued:
*** CANCELLING REQUEST: M204.0441: CCATEMP FULL: "USE PROCEDURE" COMMAND
Examples
Inserting a new procedure
In the following example you have five procedures:
PROC = 0 = 'A' PROC = -1 = 'B' PROC = -2 = 'C' PROC = -3 = 'D' PROC = -4 = 'E'
Save the result of VIEW USERID
as Procedure -1 and shift the lower level procedures down one:
USE PROC -1 INS VIEW USERID
Result:
PROC = 0 = 'A' PROC = -1 = 'USERID xxxxxxxx User id' PROC = -2 = 'B' PROC = -3 = 'C' PROC = -4 = 'D'
The procedures lower than -1 shift down one, a new procedure replaces Procedure -1, the original Procedure -3 overlays the original Procedure -4.
Shifting down a procedure
You have the following procedures:
PROC = 0 = 'A' PROC = -1 = 'B' PROC = -2 = 'C' PROC = -3 = [no procedure exists] PROC = -4 = [no procedure exists]
Shift the procedures down and then replace procedure -1 with the result of the VIEW USERID
command:
USE PROC -1 SH VIEW USERID
Result:
PROC = 0 = [no procedure exists] PROC = -1 = 'USERID xxxxxxxx User id' PROC = -2 = 'B' PROC = -3 = 'C' PROC = -4 = [no procedure exists]
The procedures shift down one; a new procedure replaces Procedure -1; Procedure 0 is empty because Procedure -4, which was empty, overlays Procedure 0.