Previous Topic

Next Topic

Book Contents

Book Index

Using a Preset KOA Environment

Execution of DO KSL statements can be optimized by indicating (in the INITPROC subparameter) a script that handles a preset environment. In the text below, KOA scripts for preset environments are discussed in detail.

For information about DO KSL statements see the DO KSL parameter in the Control-O User Guide. For server-related installation details see the INCONTROL for z/OS Installation Guide.

The sample rule below invokes KOA script CICSINQ to check whether or not a data set is open. If the data set is closed, the rule invokes script CICSOPEN to open the data set. Script CICST specified in the INITPROC subparameter handles the preset environment.

Note the following about the sample rule below:

If scripts are to be executed by a General server, either INITPROC should be blank or there must not be a special server defined by the specified name (CICST).

Figure 4 Sample Control-O for Optimizing DO KSL Statements using KOA Scripts

 RL: CICSOPEN   LIB CTOW.WORKO.RULES                             TABLE: AA

COMMAND ===>                                                    SCROLL===> CRSR

------------------------------------------------------------------------------

  ON COMMAND  = CICSOPEN *

     JNAME          JTYPE         SMFID        SYSTEM       USERID

     ROUTE          DESC          CONSOLEID    CONSOLE                     

     APPEARED     TIMES IN      MINUTES                          And/Or/Not

  OWNER IOAADMIN GROUP                         MODE PROD    RUNTSEC       

  DESCRIPTION   CHECK IF A FILE IS OPEN FOR CICS USAGE. IF NOT, OPEN IT

  DESCRIPTION

  ===========================================================================

  /* GET THEFILENAME FROM THE COMMAND LINE

  DO SET      = %%FILE = %%$V2                                      GLOBAL  N

  DO

  /* INVOKE KOA CICSINQ (CEMT INQUIRY FILE ( ))

  DO KSL      = CICSINQ %%FILE

    WAITMODE   Y                                      TIMEOUT 9999    STOP Y

     INITPROC   CICST         SHARELOC Y               IMMEDIATE N

  DO

  /* IF NEEDED INVOKE KOA CICSOPEN (CEMT SET FILE( ) OPEN)

  IF       %%DSTATUS NE O

  DO KSL      = CICSOPEN %%FILE

     WAITMODE   Y                                      TIMEOUT 9999    STOP Y

     INITPROC   CICST         SHARELOC Y               IMMEDIATE N

FILL IN RULE DEFINITION. CMDS: EDIT, SCHED, OPT, SHPF                  07.55.22

Figure 5 Sample KOA Script (CICST) invoked by Control-O Rule Subparameter INITPROC to handle the Preset Environment

IFVAR `%A1’ EQ INIT  GOTO INIT

IFVAR `%A1’ EQ TERM  GOTO TERM

IFVAR `%A1’ EQ RESET GOTO RESET

GOTO EXIT

LABEL INIT

LOGON APPLID CICSTEST SESSID CICS

CLEAR

GOTO EXIT

LABEL RESET

CLEAR

GOTO EXIT

LABEL TERM

SCREENMODE NORECEIVE

TYPE `CESF LOGOFF’

ENTER

LOGOFF

GOTO EXIT

LABEL EXIT

RETURN

Figure 6 Sample KOA Script (CICSINQ) invoked by Control-O Rule to Check whether a Data Set is Open

TYPE `CEMT INQUIRY FILE( %A1 )’

ENTER

SETVAR %STATUS SCREEN 3 22 1

SETOLOC %%DSTATUS = %STATUS

PF03

RETURN

Figure 7 Sample KOA Script (CICOPEN) invoked by Control-O Rule to Open a Closed Data Set

TYPE  `CEMT SET FILE( %A1 ) OPEN’

ENTER

PF03

RETURN

TYPE  `CEMT SET FILE( %A1 ) OPEN’

ENTER

PF03

RETURN

Execution of the DO KSL statements mentioned in the above rule depends on which type of server is used. Below is a step-by-step description of how these statements are executed for each type of server.

Table 27 Step-by-Step Description of DO KSL Statements in Sample Control-O Rule

Rule

Immediate Server

General Server

Special Server

DO KSL =
CICSINQ

1. An Immediate server is created.

1. A General server is created if one does not already exist.

1. A Special server is created if one does not already exist for the necessary environment.

2. Server invokes CICST with the INIT parameter.

2. Server invokes CICST with the INIT parameter.

2. Server invokes CICST with the INIT parameter.

3. Server invokes CICSINQ.

3. Server invokes CICSINQ.

3. Server invokes CICSINQ.

4. Server invokes CICST with the RESET parameter.

4. Server invokes CICST with the RESET parameter.

4. Server invokes CICST with the RESET parameter.

5. Server invokes CICST with the TERM parameter.

5. Server invokes CICST with the TERM parameter.

5. Special server is ready for a new request.

6. Immediate server is terminated.

6. General server is ready for a new request.

 

DO KSL =
CICSOPEN

1. An Immediate server is created.

1. Server invokes CICSOPEN.

1. Server invokes CICSOPEN.

2. Server invokes CICST with the INIT parameter.

2. Server invokes CICST with the RESET parameter.

2. Server invokes CICST with the RESET parameter.

3. Server invokes CICSOPEN.

3. Server invokes CICST with the TERM parameter.

3. Special server is ready for a new request.

4. Server invokes CICST with the RESET parameter.

4. General server is ready for a new request.

4. As the server is being shut down, it invokes CICST with the TERM parameter.

5. Server invokes CICST with the TERM parameter.

 

 

6. Immediate server is terminated.

 

 

Parent Topic

KOA Implementation Considerations