REFRESH SUBSYSPROC command: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
<dl> | <dl> | ||
<dt>Privileges | <dt>Privileges | ||
<dd>Defined in the subsystem definition in the SUBSYSMGMT subsystem. | <dd>Defined in the subsystem definition in the [[System requirements for Application Subsystems#Overview of the Subsystem Management facility|SUBSYSMGMT]] subsystem. | ||
<dt>Function | <dt>Function | ||
<dd>You can replace and refresh procedures in an active subsystem and refresh that procedure in all active subsystems. | <dd>You can replace and refresh procedures in an active subsystem and refresh that procedure in all active subsystems. |
Latest revision as of 16:47, 23 March 2017
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:
- An open permanent group with that name.
- 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.