USE PROC command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
 
Line 10: Line 10:
</p>
</p>
   
   
<b>Where:</b>
Where:
<table>  
<table>  
<tr>
<tr>
Line 24: Line 24:
<caption>Spooling output to a temporary procedure</caption>
<caption>Spooling output to a temporary procedure</caption>
      
      
<tr> <th>
<tr class="head"> <th>Option</th>  
<p>Option</p>
<th>Meaning</th>  
</th> <th>
<th>Description</th> </tr>
<p>Meaning</p>
</th> <th>
<p>Description</p>
</th> </tr>
    
    
<tr> <th><var>
<tr> <th><var>HDRS</var></th>  
<p>HDRS</p>
<td>Headers</td>  
</var></th> <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>
<p>Headers</p>
</td> <td>
<p>Allows the HDRCTL parameter and the SET HEADER and SET TRAILER User Language statements to be recognized for the output. See the Rocket <var class="product">Model&nbsp;204</var> User Language Manual for details on these statements.</p>
</td> </tr>
<tr> <th><var>
<p>CC</p>
</var></th> <td>
<p>Carriage Control</p>
</td> <td>
<p>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.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>CC</var></th>  
<p>A</p>
<td>Carriage Control</td>  
</var></th> <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.
<p>Append</p>
</td> <td>
<p>Adds the USE data output to the end of the current procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>A</var></th>  
<p>I</p>
<td>Append</td>  
</var></th> <td>
<td>Adds the USE data output to the end of the current procedure.
<p>Insert</p>
</td> <td>
<p>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.) </p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>I</var></th>  
<p>R</p>
<td>Insert</td>  
</var></th> <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.)
<p>Replace</p>
</td> <td>
<p>Deletes the old procedure and creates a new one.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>R</var></th>  
<p>S</p>
<td>Replace</td>  
</var></th> <td>
<td>Deletes the old procedure and creates a new one.</td> </tr>
<p>Shift</p>
</td> <td>
<p>Shifts all procedures down one and creates a new one. Procedure&nbsp;0 is overlaid by the lowest level procedure.</p>
</td> </tr>
 
</table>
</td>
</tr>
   
   
<tr> <th><var>S</var></th>
<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>
</table></td></tr>
</table>
</table>
==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 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.  

Revision as of 18:16, 16 April 2014

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 HDRS, CC, A, I, R, or S (default = A). The following table describes these options.

Note: The HDRS and/or CC options are specified in the command line before the other options.

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.
A Append Adds the USE data output to the end of the current procedure.
I 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.)
R Replace Deletes the old procedure and creates a new one.
S 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'

Insert a new procedure at Procedure -1 and shift the lower level procedures down one:

USE PROC -1 I

Result:

PROC = 0 = 'A' PROC = -1 = 'New_procedure' 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 replace procedure -1:

USE PROC -1 S

Result:

PROC = 0 = [no procedure exists] PROC = -1 = 'New_procedure' 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.