In this section: |
The server administrator can stop the server by logging onto the server user ID and issuing a STOP command. In addition, an authorized user can stop the server from a source machine.
In this section: |
When preparing to stop a sink machine, first log onto it.
If you want to determine whether any users are active on the sink machine, issue the following command:
? USERS
Issue one of the following commands to stop the sink machine. Your choice will depend on whether there are any active users and, if so, whether you want to wait for them to finish processing or shut down immediately:
You can also shut down the sink machine from a source machine by running an HLI program named STOPSINK. See Stopping a Sink Machine Remotely From a Source Machine.
If you log onto the sink machine to shut it down and then decide not to, you can disconnect the terminal from the sink machine and leave the sink machine running. The procedure for doing this depends on when you decide to disconnect:
#CP DISCONN
If you issue the #CP DISCONN command after pressing Enter and without first issuing the ? USERS command, the source machines may hang in wait state when they try to use the sink machine. To remedy this:
When using a line terminal, do not enter the #CP DISCONN command after stopping the server. Instead, shut down the sink machine by entering the STOP command and restart it using the FOCUS SU or IUCVMAIN command. If you entered the #CP DISCONN command by mistake, log back on and shut down the sink machine.
Example: |
An authorized user (that is, one who knows the password for the sink machine) can stop the sink machine remotely by running a COBOL HLI program.
A COBOL program named STOPSINK similar to the following sample will remotely stop an active sink machine when compiled, link-edited, and executed from native CMS.
The highlighted words STOPSINK and SU are required. The field named SINKID must contain the user ID of the sink machine. The field named PASSWORD must contain the password used to start the sink machine. For example, If the sink machine was started with the following command, VMPSWD must be the value in the PASSWORD field of the COBOL program.
IUCVMAIN VMPSWD
If the STOPSINK COBOL program is to be used to stop more than one sink machine, it must be changed to reflect the new user ID and password combination, re-compiled, re- linked and re-executed. No other changes to the body of the sample program are needed:
IDENTIFICATION DIVISION.
PROGRAM-ID. STOPSINK.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FCB.
05 FN PIC X(8) VALUE "STOPSINK".
05 FT PIC X(8) VALUE " ".
05 FM PIC X(4) VALUE " ".
05 SU PIC X(4) VALUE "SU ".
05 FILLER PIC X(8) VALUE SPACES.
05 SINKID PIC X(8) VALUE "sinkid ".
05 FILLER PIC X(20) VALUE SPACES.
05 BACKKEY PIC X(8) VALUE SPACES.
05 ECHO PIC X(4) VALUE SPACES.
05 PASSWORD PIC X(8) VALUE "password".
05 NEWSEG PIC X(8) VALUE SPACES.
05 SEGNO PIC S9(5) COMP.
05 STATCD PIC S9(5) COMP.
05 RETNO PIC S9(5) COMP.
05 FILLER PIC X(100).
01 COMMNDS.
05 HLI PIC X(4) VALUE "HLI".
PROCEDURE DIVISION.
A100-DOIT.
CALL "FOCUS" USING HLI FCB.
IF STATCD NOT EQUAL 0 GO TO ERR.
GOBACK.
ERR.
DISPLAY "ERROR" STATCD.
GOBACK.
where:
To create the STOPSINK module, you must run the GENHLI EXEC:
/* STOPSINK EXEC */
SAY 'ATTACH COBOL2 COMPILER VIA GETCOBOL EXEC'
EXEC GETCOBOL
SAY 'COMPILE STOPSINK COBOL PROGRAM'
COBOL2 STOPSINK
SAY 'ESTABLISH GLOBALS FOR GENHLI MODULE CREATION'
GLOBAL TXTLIB SCEELKED
SAY 'RUN GENHLI EXEC FROM THE FOCUS DISK'
EX GENHLI STOPSINK '('SU COBOL
SAY 'EXECUTE THE STOPSINK MODULE'
STOPSINK
Information Builders |