USE PROC command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 19: Line 19:
<tr>
<tr>
<th>option</th>
<th>option</th>
<td> is HDRS, CC, A, I, R, or S (default = A). The following table describes these options.
<td> is one of the options described in the following table.
<p class="note"><b>Note:</b> The HDRS and/or CC options are specified in the command line before the other options.</p>
<blockquote class="note"><b>Notes:</b><ul><li>The options shown can be abbreviated, only the first character is required. For example, <code>R</code>, <code>RE</code> or <code>REP</code> all mean the same as <code>REPL</code>.<li>The options are shown in mixed case, but the option (or its abbreviation) must actually be entered in all upper case.<li>The <var>HDRS</var> and/or <var>CC</var> options must be specified in the command line before the other options.<li>If neither <var>APPEND</var>, <var>INSERT</var>, nore <var>SHIFT</var> is specified, <var>REPL</var> is the default.</ul></blockquote>
<table>
<table>
<caption>Spooling output to a temporary procedure</caption>
<caption>Spooling output to a temporary procedure</caption>
Line 28: Line 28:
<th>Description</th> </tr>
<th>Description</th> </tr>
    
    
<tr> <th><var>HDRS</var></th>  
<tr> <th><var>Hdrs</var></th>  
<td>Headers</td>  
<td>Headers</td>  
<td>Allows the HDRCTL parameter and the <var>[[Report generation#SET HEADER statement|SET HEADER]]</var> and <var>[[Report generation#SET TRAILER statement|SET TRAILER]]</var> statements to be recognized for the output. </td> </tr>
<td>Allows the HDRCTL parameter and the <var>[[Report generation#SET HEADER statement|SET HEADER]]</var> and <var>[[Report generation#SET TRAILER statement|SET TRAILER]]</var> statements to be recognized for the output. </td> </tr>
   
   
<tr> <th><var>CC</var></th>  
<tr> <th><var>Cc</var></th>  
<td>Carriage Control</td>  
<td>Carriage Control</td>  
<td>Inserts a one-byte carriage control character at the beginning of each line of output. If you specify the CC option, the maximum line length of lines output to the procedure is reduced by one, to a value of 254 bytes.
<td>Inserts a one-byte carriage control character at the beginning of each line of output. If you specify the CC option, the maximum line length of lines output to the procedure is reduced by one, to a value of 254 bytes.
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>A</var></th>  
<tr> <th><var>Append</var></th>  
<td>Append</td>  
<td>Append</td>  
<td>Adds the USE data output to the end of the current procedure.
<td>Adds the USE data output to the end of the current procedure.
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>I</var></th>  
<tr> <th><var>Insert</var></th>  
<td>Insert</td>  
<td>Insert</td>  
<td>Shifts all procedures down one and creates a new one. Procedures closer to zero are not affected. (If you have procedures in zero to -10 positions and if you insert a procedure at -4 position, the current -4 through -10 must shift, but those in 0 to -3 positions are unmoved.)
<td>Shifts all procedures down one and creates a new one. Procedures closer to zero are not affected. (If you have procedures in zero to -10 positions and if you insert a procedure at -4 position, the current -4 through -10 must shift, but those in 0 to -3 positions are unmoved.)
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>R</var></th>  
<tr> <th><var>Repl</var></th>  
<td>Replace</td>  
<td>Replace</td>  
<td>Deletes the old procedure and creates a new one.</td> </tr>
<td>Deletes the old procedure and creates a new one.</td> </tr>
   
   
<tr> <th><var>S</var></th>  
<tr> <th><var>Shift</var></th>  
<td>Shift</td>  
<td>Shift</td>  
<td>Shifts all procedures down one and creates a new one. Procedure&nbsp;0 is overlaid by the lowest level procedure.</td> </tr>  
<td>Shifts all procedures down one and creates a new one. Procedure&nbsp;0 is overlaid by the lowest level procedure.</td> </tr>  
Line 58: Line 58:


==Usage==
==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.  
Because the <var>USE PROC</var> command manipulates temporary procedures, calling it from within a temporary procedure cannot always be permitted. You cannot issue a <var>USE PROC</var> command where it would manipulate the calling procedure or any procedure on the active <var>INCLUDE</var> chain. Attempts to do so are prevented, the transaction is cancelled, and following message is displayed.  
<p class="code">M204:2478: 'USE PROC' REJECTED, WOULD OVERWRITE CURRENTLY ACTIVE PROC.
<p class="code">M204:2478: 'USE PROC' REJECTED, WOULD OVERWRITE CURRENTLY ACTIVE PROC.
</p>
</p>
<p>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: </p>
<p>
Temporary procedures are stored in CCATEMP. If an additional CCAPTEMP page is required to process a <var>[[$BldProc]]</var> 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 <var>$BldProc</var>, the following message is issued: </p>
<p class="code">*** CANCELLING REQUEST: M204.0441: CCATEMP FULL: "USE PROCEDURE" COMMAND
<p class="code">*** CANCELLING REQUEST: M204.0441: CCATEMP FULL: "USE PROCEDURE" COMMAND
</p>
</p>
==Examples==
==Examples==
====Inserting a new procedure====
====Inserting a new procedure====
<p>In the following example you have five procedures: </p>
<p>
In the following example you have five procedures: </p>
<p class="code">PROC = 0 = 'A'
<p class="code">PROC = 0 = 'A'
PROC = -1 = 'B'
PROC = -1 = 'B'
Line 73: Line 77:
PROC = -4 = 'E'
PROC = -4 = 'E'
</p>
</p>
<p>Insert a new procedure at Procedure -1 and shift the lower level procedures down one: </p>
<p>
<p class="code">USE PROC -1 I
Save the result of <code>VIEW USERID</code> as Procedure -1 and shift the lower level procedures down one: </p>
<p class="code">USE PROC -1 INS
VIEW USERID
</p>
</p>
<p>Result: </p>
<p>
Result: </p>
<p class="code">PROC = 0 = 'A'
<p class="code">PROC = 0 = 'A'
PROC = -1 = 'New_procedure'
PROC = -1 = 'USERID    xxxxxxxx    User id'
PROC = -2 = 'B'
PROC = -2 = 'B'
PROC = -3 = 'C'
PROC = -3 = 'C'
PROC = -4 = 'D'
PROC = -4 = 'D'
</p>
</p>
<p>The procedures lower than -1 shift down one, a new procedure replaces Procedure -1, the original Procedure -3 overlays the original Procedure -4. </p>
<p>
The procedures lower than -1 shift down one, a new procedure replaces Procedure -1, the original Procedure -3 overlays the original Procedure -4. </p>
 
====Shifting down a procedure====
====Shifting down a procedure====
<p>You have the following procedures: </p>
<p>
You have the following procedures: </p>
<p class="code">PROC = 0 = 'A'
<p class="code">PROC = 0 = 'A'
PROC = -1 = 'B'
PROC = -1 = 'B'
Line 92: Line 102:
PROC = -4 = [no procedure exists]
PROC = -4 = [no procedure exists]
</p>
</p>
<p>Shift the procedures down and replace procedure -1: </p>
<p>
<p class="code">USE PROC -1 S
Shift the procedures down and then replace procedure -1 with the result of the <code>VIEW USERID</code> command: </p>
<p class="code">USE PROC -1 SH
VIEW USERID
</p>
</p>
<p>Result: </p>
<p>
Result: </p>
<p class="code">PROC = 0 = [no procedure exists]
<p class="code">PROC = 0 = [no procedure exists]
PROC = -1 = 'New_procedure'
PROC = -1 = 'USERID    xxxxxxxx    User id'
PROC = -2 = 'B'
PROC = -2 = 'B'
PROC = -3 = 'C'
PROC = -3 = 'C'
PROC = -4 = [no procedure exists]
PROC = -4 = [no procedure exists]
</p>
</p>
<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>
<p>
[[Category: General user commands]]
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: 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.

Notes:

  • The options shown can be abbreviated, only the first character is required. For example, R, RE or REP all mean the same as REPL.
  • The options are shown in mixed case, but the option (or its abbreviation) must actually be entered in all upper case.
  • The HDRS and/or CC options must be specified in the command line before the other options.
  • If neither APPEND, INSERT, nore SHIFT is specified, REPL is the default.
Spooling output to a temporary procedure
Option Meaning Description
Hdrs Headers Allows the HDRCTL parameter and the SET HEADER and SET TRAILER statements to be recognized for the output.
Cc Carriage Control Inserts a one-byte carriage control character at the beginning of each line of output. If you specify the CC option, the maximum line length of lines output to the procedure is reduced by one, to a value of 254 bytes.
Append Append Adds the USE data output to the end of the current procedure.
Insert Insert Shifts all procedures down one and creates a new one. Procedures closer to zero are not affected. (If you have procedures in zero to -10 positions and if you insert a procedure at -4 position, the current -4 through -10 must shift, but those in 0 to -3 positions are unmoved.)
Repl Replace Deletes the old procedure and creates a new one.
Shift Shift Shifts all procedures down one and creates a new one. Procedure 0 is overlaid by the lowest level procedure.

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.