PROCEDURE command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (misc formatting)
Line 6: Line 6:
<dd>Defines a new procedure or replaces an existing procedure
<dd>Defines a new procedure or replaces an existing procedure
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax">PROCEDURE {procnumber | procname
<p class="syntax">PROCEDURE { <span class="term">procnumber</span> | <span class="term">procname</span>
  [ALIAS=alias[,alias]...]
  [ALIAS=<span class="term">alias</span>[,<span class="term">alias</span>]...]
  [PCLASS=pclass}
  [PCLASS=<span class="term">pclass</span>] }
</p>
</p>
   
   
<b>Where:</b>
Where:
<table>  
<table>  
<tr>
<tr><th>procnumber</th>
<th>procnumber</th>
<td>Zero or a negative number (representing a temporary procedure).</td></tr>
<td> is zero or a negative number (representing a temporary procedure).</td>
</tr>
   
   
<tr>
<tr>
<th>procname</th>
<th>procname</th>
<td> is the name of the procedure to be defined (1 to 255 characters). The name can contain any letters, numbers, or symbols except:  
<td>The name of the procedure to be defined (1 to 255 characters). The name can contain any letters, numbers, or symbols except:  
<table>
<table>
<tr class="head"><th>Character name</th>
<th>Keyboard display</th> </tr>
    
    
<tr> <th>
<tr><th><var>Carriage return</var></th>  
<p>Character name </p>
<td></td> </tr>
</th> <th>
<p>Keyboard display</p>
</th> </tr>
 
<tr> <th><var>
<p>Carriage return</p>
</var></th> <td></td> </tr>
   
   
<tr> <th><var>
<tr><th><var>Comma</var></th>  
<p>Comma </p>
<td>( , )</td> </tr>
</var></th> <td>
<p>( , ) </p>
</td> </tr>
   
   
<tr> <th><var>
<tr><th><var>Equal sign</var></th>  
<p>Equal sign </p>
<td>( = )</td> </tr>
</var></th> <td>
<p>( = )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr><th><var>Semicolon</var></th>  
<p>Semicolon </p>
<td>( ; )</td> </tr>
</var></th> <td>
<p>( ; )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr><th><var>Single quote</var></th>  
<p>Single quote </p>
<td>( ' )</td> </tr>
</var></th> <td>
<p>( ' )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>Space</var></th>  
<p>Space</p>
<td></td> </tr>   
</var></th> <td></td> </tr>   
</table>
</table>
In addition:
In addition:
<ul>
<ul>
<li>
<li>In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.</li>
In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.</li>
 
<li>
<li>As of version 7.7:
As of version 7.7:
<ul>
<ul>
<li>Most of the above characters are permitted if <var>CUSTOM=42</var> is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See [[CUSTOM_parameter#Using_CUSTOM=(42)|Using CUSTOM=(42)]] for details.</li>
<li>Most of the above characters are permitted if <code>CUSTOM=42</code> is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See [[CUSTOM parameter#Using CUSTOM=(42)|Using CUSTOM=(42)]] for details.</li>
 
<li>The procedure name can begin with a zero.</li>
<li>The procedure name can begin with a zero.</li>
<li>Alphanumeric procedure names can begin with a minus sign character (-), which is interpreted as a dash. For example, -1myproc and -myproc are valid procedure names.</li>
 
<li>Alphanumeric procedure names can begin with a minus sign character (-), which is interpreted as a dash. For example, <code>-1myproc</code> and <code>-myproc</code> are valid procedure names.</li>
</ul>
</ul>
</li>
</li>
</ul>
</ul>


<p>Rocket Software recommends that you limit the length of your procedure name to less than 210 bytes. Although a name in excess of 210 bytes is not incorrect and will not cause compile errors, it could be truncated by MSGCTL processing.</p>
<p>Rocket Software recommends that you limit the length of your procedure name to less than 210 bytes. Although a name in excess of 210 bytes is not incorrect and will not cause compile errors, it could be truncated by <var>MSGCTL</var> processing.</p>
</td>
</td></tr>
</tr>
   
   
<tr>
<tr><th>alias</th>
<th>alias</th>
<td>The procedure alias. It follows the rules for <var class="term">procname</var> presented above. An alias can be specified only for a permanent procedure.</td></tr>
<td> is the procedure alias. It follows the rules for procname presented above. An alias can be specified only for a permanent procedure.</td>
</tr>
<tr>
<th>pclass</th>
<td> is the number of the procedure class; the number must be in the range 1 to 255.</td>
</tr>
   
   
<tr><th>pclass</th>
<td>The number of the procedure class; the number must be in the range 1 to 255.</td></tr>
</table>
</table>
===Syntax notes===
===Syntax notes===
Commas are required between aliases.
Commas are required between aliases.


==Usage notes==
==Usage notes==
<p>The PROCEDURE command allows you to create a new procedure or to replace an existing one. A procedure can contain User Language requests, commands, or nonexecutable text. The name or number specified in this command is used to refer to this procedure in subsequent procedure commands such as INCLUDE, DELETE, and DISPLAY.</p>
<ul>
<p>The following example illustrates the use of the PROCEDURE command: </p>
<li>The <var>PROCEDURE</var> command lets you create a new procedure or replace an existing one. A procedure can contain SOUL requests, commands, or nonexecutable text. The name or number specified in this command is used to refer to this procedure in subsequent procedure commands such as <var>INCLUDE</var>, <var>DELETE</var>, and <var>DISPLAY</var>.</li>
 
<li>The following example illustrates the use of the PROCEDURE command:  
<p class="code"><b>PROCEDURE PAY ALIAS=PAYCHECK</b>
<p class="code"><b>PROCEDURE PAY ALIAS=PAYCHECK</b>
<b></b>*** M204.1144: DEFINE PROCEDURE PAY
<b></b>*** M204.1144: DEFINE PROCEDURE PAY
Line 108: Line 87:
<b>END PROCEDURE</b>
<b>END PROCEDURE</b>
<b></b>*** M204.1146: PROCEDURE PAY DEFINITION ENDED
<b></b>*** M204.1146: PROCEDURE PAY DEFINITION ENDED
</p>
</p></li>
<p>A file or group must be open at the time that a permanent procedure is entered. If a procedure is associated with a file, it is stored in that file for subsequent use. If a procedure is associated with a group, it is stored in that group's procedure file, if one is available. The INCLUDE command is used to execute the procedure, and the DELETE command is used to delete it. </p>
 
<p>When it processes PROCEDURE, <var class="product">Model&nbsp;204</var> ends any current User Language update unit and begins a non-backoutable update unit. If a <var class="product">Model&nbsp;204</var> command non-back outable update unit is in progress, PROCEDURE is included in that update unit. See [[File_integrity_and_recovery#Update_units_and_transactions|Update units and transactions]] for more information.</p>
<li>A file or group must be open at the time that a permanent procedure is entered. If a procedure is associated with a file, it is stored in that file for subsequent use. If a procedure is associated with a group, it is stored in that group's procedure file, if one is available. The <var>INCLUDE</var> command is used to execute the procedure, and the <var>DELETE</var> command is used to delete it. </li>
<p><b>Procedure aliases</b></p>
 
<p>A permanent procedure can have more than one name. A procedure might have a short name that is easy to enter, and one or more longer, more descriptive names. Every procedure has one formal name and can have any number of alternative names or aliases. All of the names can be used interchangeably; however, access to a procedure by its official name is slightly faster than access by an alias. The rules for constructing aliases are the same as those for official procedure names.</p>
<li>When it processes <var>PROCEDURE</var>, <var class="product">Model&nbsp;204</var> ends any current SOUL update unit and begins a non-backoutable update unit. If a <var class="product">Model&nbsp;204</var> command non-backoutable update unit is in progress, <var>PROCEDURE</var> is included in that update unit. See [[File integrity and recovery#Update units and transactions|Update units and transactions]] for more information.</li>
<p>An alias can be defined in the PROCEDURE command using the ALIAS entry. An alias also can be defined at a later time by means of the ASSIGN command. If an invalid alias is specified in a list of several aliases, only the invalid alias is rejected.</p>
</ul>
<p class="note"><b>Note:</b> Once the PROCEDURE command with an ALIAS option is issued, the alias is created. Deleting the procedure does not delete the alias. Only the DEASSIGN command removes the alias.   </p>
 
<p><b>Procedure classes</b> </p>
===Procedure aliases===
<p>A procedure can be secured, or protected from unauthorized access, by identifying it as a member of a particular procedure class. You are identified as a member of a particular user class when you open a file or group. A table included in each file assigns to particular user classes the access rights to particular procedure classes.</p>
<p>
<p>The system manager and file manager have responsibility for most of the security functions. However, you can secure a new procedure by assigning it a class in the PROCEDURE command using the PCLASS entry.</p>
A permanent procedure can have more than one name. A procedure might have a short name that is easy to enter, and one or more longer, more descriptive names. Every procedure has one formal name and can have any number of alternative names or aliases. All of the names can be used interchangeably; however, access to a procedure by its official name is slightly faster than access by an alias. The rules for constructing aliases are the same as those for official procedure names.</p>
<p><var class="product">Model&nbsp;204</var> determines whether you are allowed to define procedures of the specified class. If you are allowed to define such a procedure, procedure definition continues. </p>
<p>
<p>If you redefine an existing nonsecured procedure by adding a class to it, you must have the right to change procedures of the specified class. If you redefine an existing secured procedure, you cannot change its class. </p>
An alias can be defined in the <var>PROCEDURE</var> command using the <var>ALIAS</var> entry. An alias also can be defined at a later time by means of the <var>ASSIGN</var> command. If an invalid alias is specified in a list of several aliases, only the invalid alias is rejected.</p>
====Desecuring====
<p class="note"><b>Note:</b> Once the <var>PROCEDURE</var> command with an <var>ALIAS</var> option is issued, the alias is created. Deleting the procedure does not delete the alias. Only the <var>DEASSIGN</var> command removes the alias. </p>
<p>Only the file manager can desecure a procedure. See [[DESECURE PROCEDURE command: Removing procedure security|DESECURE PROCEDURE: Removing procedure security]].</p>
 
===Procedure classes===
<p>
A procedure can be secured, or protected from unauthorized access, by identifying it as a member of a particular procedure class. You are identified as a member of a particular user class when you open a file or group. A table included in each file assigns to particular user classes the access rights to particular procedure classes.</p>
<p>
The system manager and file manager have responsibility for most of the security functions. However, you can secure a new procedure by assigning it a class in the <var>PROCEDURE</var> command using the <var>PCLASS</var> entry.</p>
<p>
<var class="product">Model&nbsp;204</var> determines whether you are allowed to define procedures of the specified class. If you are allowed to define such a procedure, procedure definition continues. </p>
<p>
If you redefine an existing nonsecured procedure by adding a class to it, you must have the right to change procedures of the specified class. If you redefine an existing secured procedure, you cannot change its class. </p>
 
===Desecuring===
<p>
Only the file manager can desecure a procedure. See [[DESECURE PROCEDURE command: Removing procedure security|DESECURE PROCEDURE: Removing procedure security]].</p>


[[Category: General user commands]]
[[Category: General user commands]]
[[Category:Commands]]
[[Category:Commands]]

Revision as of 00:30, 6 July 2016

Summary

Privileges
Any user
Function
Defines a new procedure or replaces an existing procedure

Syntax

PROCEDURE { procnumber | procname [ALIAS=alias[,alias]...] [PCLASS=pclass] }

Where:

procnumber Zero or a negative number (representing a temporary procedure).
procname The name of the procedure to be defined (1 to 255 characters). The name can contain any letters, numbers, or symbols except:
Character name Keyboard display
Carriage return
Comma ( , )
Equal sign ( = )
Semicolon ( ; )
Single quote ( ' )
Space

In addition:

  • In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.
  • As of version 7.7:
    • Most of the above characters are permitted if CUSTOM=42 is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See Using CUSTOM=(42) for details.
    • The procedure name can begin with a zero.
    • Alphanumeric procedure names can begin with a minus sign character (-), which is interpreted as a dash. For example, -1myproc and -myproc are valid procedure names.

Rocket Software recommends that you limit the length of your procedure name to less than 210 bytes. Although a name in excess of 210 bytes is not incorrect and will not cause compile errors, it could be truncated by MSGCTL processing.

alias The procedure alias. It follows the rules for procname presented above. An alias can be specified only for a permanent procedure.
pclass The number of the procedure class; the number must be in the range 1 to 255.

Syntax notes

Commas are required between aliases.

Usage notes

  • The PROCEDURE command lets you create a new procedure or replace an existing one. A procedure can contain SOUL requests, commands, or nonexecutable text. The name or number specified in this command is used to refer to this procedure in subsequent procedure commands such as INCLUDE, DELETE, and DISPLAY.
  • The following example illustrates the use of the PROCEDURE command:

    PROCEDURE PAY ALIAS=PAYCHECK *** M204.1144: DEFINE PROCEDURE PAY . . . text . . . END PROCEDURE *** M204.1146: PROCEDURE PAY DEFINITION ENDED

  • A file or group must be open at the time that a permanent procedure is entered. If a procedure is associated with a file, it is stored in that file for subsequent use. If a procedure is associated with a group, it is stored in that group's procedure file, if one is available. The INCLUDE command is used to execute the procedure, and the DELETE command is used to delete it.
  • When it processes PROCEDURE, Model 204 ends any current SOUL update unit and begins a non-backoutable update unit. If a Model 204 command non-backoutable update unit is in progress, PROCEDURE is included in that update unit. See Update units and transactions for more information.

Procedure aliases

A permanent procedure can have more than one name. A procedure might have a short name that is easy to enter, and one or more longer, more descriptive names. Every procedure has one formal name and can have any number of alternative names or aliases. All of the names can be used interchangeably; however, access to a procedure by its official name is slightly faster than access by an alias. The rules for constructing aliases are the same as those for official procedure names.

An alias can be defined in the PROCEDURE command using the ALIAS entry. An alias also can be defined at a later time by means of the ASSIGN command. If an invalid alias is specified in a list of several aliases, only the invalid alias is rejected.

Note: Once the PROCEDURE command with an ALIAS option is issued, the alias is created. Deleting the procedure does not delete the alias. Only the DEASSIGN command removes the alias.

Procedure classes

A procedure can be secured, or protected from unauthorized access, by identifying it as a member of a particular procedure class. You are identified as a member of a particular user class when you open a file or group. A table included in each file assigns to particular user classes the access rights to particular procedure classes.

The system manager and file manager have responsibility for most of the security functions. However, you can secure a new procedure by assigning it a class in the PROCEDURE command using the PCLASS entry.

Model 204 determines whether you are allowed to define procedures of the specified class. If you are allowed to define such a procedure, procedure definition continues.

If you redefine an existing nonsecured procedure by adding a class to it, you must have the right to change procedures of the specified class. If you redefine an existing secured procedure, you cannot change its class.

Desecuring

Only the file manager can desecure a procedure. See DESECURE PROCEDURE: Removing procedure security.