Stopping a Sink Machine

In this section:

Stopping a Sink Machine from the Server User ID

Stopping a Sink Machine Remotely From a Source Machine

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.


Top of page

Stopping a Sink Machine from the Server User ID

In this section:

Allowing SU Mode to Continue

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:

STOP [END]
STOP shuts down the sink machine normally. SHUTDOWN is a synonym for STOP. Use STOP END if you want to shut down the sink machine immediately, and users are still active.

HX
Shuts down the sink machine immediately. This is the same as STOP END.

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.


Top of page

Allowing SU Mode to Continue

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:

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:

  1. Log back onto the sink machine.

  1. When the RECONNECT message appears, enter the ? USERS command.

  2. After the list of current users is displayed, enter the #CP DISCONN command. The source machines hanging in wait state will then resume processing.

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.


Top of page

Stopping a Sink Machine Remotely From a Source Machine

Example:

Sample STOPSINK COBOL Program

Sample EXEC for Compiling and Linking the STOPSINK Program

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.


Top of page

Example: Sample STOPSINK COBOL Program

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:

STOPSINK
Is the required value for FN in the FCB.

SU
Is the required value for SU in the FCB.

sinkid
Is the sink machine user ID. It must be eight bytes long. If it is shorter, pad it with blanks on the right.

password
Is the sink machine password. It must be eight bytes long. If it is shorter, pad it with blanks on the right.


Top of page

Example: Sample EXEC for Compiling and Linking the STOPSINK Program

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