REFRESH SUBSYSPROC command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 36: Line 36:
</ul>
</ul>
<p>
<p>
A <var>STOP SUBSYS</var> command can override a <var>REFRESH SUBSYS</var> command. If an APSY subsystem procedure with the subsystem precompile prefix is compiled, and the procedure is found in an unlocked subsystem procedure file, the following message is issued:</p>
A <var>STOP SUBSYS</var> command can override a <var>REFRESH SUBSYSPROC</var> command. If an APSY subsystem procedure with the subsystem precompile prefix is compiled, and the procedure is found in an unlocked subsystem procedure file, the following message is issued:</p>
<p class="code">M204.0468: COMPILATION NOT SAVED - INCLUDE FROM UNLOCKED FILE
<p class="code">M204.0468: COMPILATION NOT SAVED - INCLUDE FROM UNLOCKED FILE
</p>
</p>
Line 54: Line 54:
====Update active subsystems simultaneously from a file====
====Update active subsystems simultaneously from a file====
<p>
<p>
Procedure C-TEST is defined in active subsystem PRODSYS1 and PRODSYS2 in subsystem procedure file, PROCS. The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. Procedure C-TEST is copied from file DATA and replaced in subsystem file PROCS and is refreshed in every active subsystem in which the procedure is defined.</p>
Procedure <code>C-TEST</code> is defined in active subsystem <code>PRODSYS1</code> and <code>PRODSYS2</code> in subsystem procedure file <code>PROCS</code>. The following command attempts to refresh procedure <code>C-TEST</code> in subsystem file <code>PROCS</code> from file <code>DATA</code>. Procedure <code>C-TEST</code> is copied from file <code>DATA</code> and replaced in subsystem file <code>PROCS</code> and is refreshed in every active subsystem in which the procedure is defined.</p>


<p class="code">OPEN PROCS
<p class="code">OPEN PROCS
Line 66: Line 66:
====Updating an active subsystem from a group====
====Updating an active subsystem from a group====
<p>
<p>
Procedure C-TEST is defined in active subsystem PRODSYS1 in subsystem procedure group PROCGRP. PRODSYS1 is defined with NUMLK=2. PROCGRP is created with TEMPPROC, PROCF1, PROCF2. C-TEST can be found in files TEMPROC and PROCF1. </p>
Procedure <code>C-TEST</code> is defined in active subsystem <code>PRODSYS1</code> in subsystem procedure group <code>PROCGRP</code>. <code>PRODSYS1</code> is defined with <code>NUMLK=2</code>. <code>PROCGRP</code> is created with <code>TEMPPROC</code>, <code>PROCF1</code>, <code>PROCF2</code>. <code>C-TEST</code> can be found in files <code>TEMPROC</code> and <code>PROCF1</code>. </p>
<p>
<p>
The following command attempts to refresh procedure C-TEST in subsystem group PROCGRP from group TESTGRP. Procedure C-TEST is copied from the first file in group TESTGRP that contains procedure C-TEST and replaces procedure C-TEST in the file PROCF1 in group PROCGRP. The procedure is refreshed in every active subsystem in which the procedure is defined.</p>
The following command attempts to refresh procedure <code>C-TEST</code> in subsystem group <code>PROCGRP</code> from group <code>TESTGRP</code>. Procedure <code>C-TEST</code> is copied from the first file in group <code>TESTGRP</code> that contains procedure <code>C-TEST</code>, and it replaces procedure <code>C-TEST</code> in the file <code>PROCF1</code> in group <code>PROCGRP</code>. The procedure is refreshed in every active subsystem in which the procedure is defined.</p>
<p class="code">OPEN PROCGRP
<p class="code">OPEN PROCGRP
OPEN TESTGRP
OPEN TESTGRP
REFRESH SUBSYSTEM C-TEST IN PROCGRP FROM TESTGRP  
REFRESH SUBSYSPROC C-TEST IN PROCGRP FROM TESTGRP  
M204.2666 C-TEST REPLACED IN FILE PROCF1 IN GROUP PROCGRP
M204.2666 C-TEST REPLACED IN FILE PROCF1 IN GROUP PROCGRP
M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS1
M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS1
Line 78: Line 78:
====Trying to refresh an inactive subsystem====
====Trying to refresh an inactive subsystem====
<p>
<p>
Procedure C-TEST is not defined in any active subsystems. The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. The REFRESH command fails and the procedure is not copied or refreshed.</p>
Procedure <code>C-TEST</code> is not defined in any active subsystems. The following command attempts to refresh procedure <code>C-TEST</code> in subsystem file <code>PROCS</code> from file <code>DATA</code>. The <var>REFRESH</var> command fails and the procedure is not copied or refreshed.</p>


<p class="code">OPEN PROCS
<p class="code">OPEN PROCS
Line 91: Line 91:
====Trying to refresh a missing procedure====
====Trying to refresh a missing procedure====
<p>
<p>
The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. However, procedure C-TEST does not exist in file DATA. The REFRESH SUBSYSTEM command fails and the procedure is not copied or refreshed.</p>
The following command attempts to refresh procedure <code>C-TEST</code> in subsystem file <code>PROCS</code> from file <code>DATA</code>. However, procedure <code>C-TEST</code> does not exist in file <code>DATA</code>. The <var>REFRESH SUBSYSPROC</var> command fails and the procedure is not copied or refreshed.</p>
<p class="code">OPEN PROCS
<p class="code">OPEN PROCS
OPEN DATA
OPEN DATA
Line 102: Line 102:
<p>
<p>
No other user may be running the procedure that is being refreshed, otherwise the following error is issued:</p>
No other user may be running the procedure that is being refreshed, otherwise the following error is issued:</p>
<p class="code">M204.2669: PROCEDURE procname IS IN USE BY SUBSYSTEM subsys-name
<p class="code">M204.2669: PROCEDURE <i>procname</i> IS IN USE BY SUBSYSTEM <i>subsys-name</i>
</p>
</p>


====Refreshing a procedure successfully====
====Refreshing a procedure successfully====
<p>
<p>
Procedure C-TEST is defined in active subsystem PRODSYS1 in subsystem file PROCS. The following command attempts to refresh procedure C-TEST in subsystem file PROCS. </p>
Procedure <code>C-TEST</code> is defined in active subsystem <code>PRODSYS1</code> in subsystem file <code>PROCS</code>. The following command attempts to refresh procedure <code>C-TEST</code> in subsystem file <code>PROCS</code>: </p>
<p class="code">OPEN PROCS
<p class="code">OPEN PROCS
REFRESH SUBSYSPROC C-TEST IN PROCS
REFRESH SUBSYSPROC C-TEST IN PROCS
Line 113: Line 113:
</p>
</p>
<p>
<p>
This form of the command is useful if a user wishes to recompile a procedure when the included code in that procedure has been modified.</p>
This form of the command is useful if you want to recompile a procedure when the included code in that procedure has been modified.</p>


[[Category:Commands]]
[[Category:Commands]]

Revision as of 01:10, 7 November 2014

Summary

Privileges
Defined in the subsystem definition in the SUBSYSMGMT subsystem.
Function
You can replace and refresh procedures in an active subsystem and refresh that procedure in all active subsystems.

Syntax

REFRESH SUBSYSPROC procname IN [GROUP | FILE] name [FROM [{[PERM | TEMP] GROUP}| FILE] name]

Where:

  • procname specifies the name of the procedure you plan to replace.
  • IN clause specifies the Model 204 group or file where the procedure will be replaced.
  • name specifies a specific group name or file name into which to put procname. If neither the GROUP or FILE keyword is specified, then REFRESH SUBSYSPROC looks for:
    1. An open permanent group with that name.
    2. If no open permanent group is found, then REFRESH SUBSYSPROC looks for an open file with that name.
  • The optional FROM clause specifies a specific, temporary or permanent group name or file name from which procname is refreshed. However, the procedure is updated only when a FROM clause is specified.

Usage

REFRESH SUBSYSPROC consists of two operations:

  • Updating the procedure

  • Causing the recompiling of the procedure

A STOP SUBSYS command can override a REFRESH SUBSYSPROC command. If an APSY subsystem procedure with the subsystem precompile prefix is compiled, and the procedure is found in an unlocked subsystem procedure file, the following message is issued:

M204.0468: COMPILATION NOT SAVED - INCLUDE FROM UNLOCKED FILE

See also "Generating success messages" and "Generating error messages" in Dynamically refreshing procedure compilation with the REFRESH SUBSYSPROC command.

Using the optional FROM clause

If the FROM clause is not specified, the copy operation does not occur but the refresh operation does. It is useful to issue the REFRESH SUBSYSPROC command without the FROM clause when the included code in a procedure has changed, but the procedure itself has not. This forces the procedure to be recompiled, which in turn picks up the newly updated included code.

For example, suppose you change a procedure that is included in other precompiled procedures. Even though the other precompiled procedures have not changed, you would want to refresh them so that they get recompiled with the new included code. Whether or not the copy operation occurs, the refresh operation causes the procedure to be discarded and recompiled the next time it is invoked.

You must open the source and destination file (or groups) before issuing the command. Therefore, it is essential that Lock File/Groups on the SUBSYSMGMT Operational Parameters screen is set to N.

Examples

Update active subsystems simultaneously from a file

Procedure C-TEST is defined in active subsystem PRODSYS1 and PRODSYS2 in subsystem procedure file PROCS. The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. Procedure C-TEST is copied from file DATA and replaced in subsystem file PROCS and is refreshed in every active subsystem in which the procedure is defined.

OPEN PROCS OPEN DATA REFRESH SUBSYSPROC C-TEST IN PROCS FROM DATA M204.2666 C-TEST REPLACED IN FILE PROCS M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS1 M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS2

Updating an active subsystem from a group

Procedure C-TEST is defined in active subsystem PRODSYS1 in subsystem procedure group PROCGRP. PRODSYS1 is defined with NUMLK=2. PROCGRP is created with TEMPPROC, PROCF1, PROCF2. C-TEST can be found in files TEMPROC and PROCF1.

The following command attempts to refresh procedure C-TEST in subsystem group PROCGRP from group TESTGRP. Procedure C-TEST is copied from the first file in group TESTGRP that contains procedure C-TEST, and it replaces procedure C-TEST in the file PROCF1 in group PROCGRP. The procedure is refreshed in every active subsystem in which the procedure is defined.

OPEN PROCGRP OPEN TESTGRP REFRESH SUBSYSPROC C-TEST IN PROCGRP FROM TESTGRP M204.2666 C-TEST REPLACED IN FILE PROCF1 IN GROUP PROCGRP M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS1

Trying to refresh an inactive subsystem

Procedure C-TEST is not defined in any active subsystems. The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. The REFRESH command fails and the procedure is not copied or refreshed.

OPEN PROCS OPEN DATA REFRESH SUBSYSPROC C-TEST IN PROCS FROM DATA M204.2668 C-TEST NOT FOUND IN ACTIVE SUBSYSTEM M204.2683 REFRESH COMMAND FAILED

If there are no active subsystems containing the procedure, you can issue the COPY PROC command to update the procedure.

Trying to refresh a missing procedure

The following command attempts to refresh procedure C-TEST in subsystem file PROCS from file DATA. However, procedure C-TEST does not exist in file DATA. The REFRESH SUBSYSPROC command fails and the procedure is not copied or refreshed.

OPEN PROCS OPEN DATA REFRESH SUBSYSPROC C-TEST IN PROCS FROM DATA M204.1158 CAN'T COPY PROCEDURE C-TEST M204.2683 REFRESH COMMAND FAILED

Trying to refresh a procedure that is in use

No other user may be running the procedure that is being refreshed, otherwise the following error is issued:

M204.2669: PROCEDURE procname IS IN USE BY SUBSYSTEM subsys-name

Refreshing a procedure successfully

Procedure C-TEST is defined in active subsystem PRODSYS1 in subsystem file PROCS. The following command attempts to refresh procedure C-TEST in subsystem file PROCS:

OPEN PROCS REFRESH SUBSYSPROC C-TEST IN PROCS M204.2665 C-TEST REFRESHED IN SUBSYSTEM PRODSYS1

This form of the command is useful if you want to recompile a procedure when the included code in that procedure has been modified.