Referencing STL programs in your network definition

A network definition defines resources and operation options for your simulated network. Your network definition statements tell WSim which STL programs generate messages for each simulated resource. As explained in Creating WSim Scripts, you can specify a set of message generation decks or STL procedures for an entire network, or you can specify a different sequence for each line, terminal, and device.

If you create your STL programs as recommended previously, they each perform independent tasks that are part of the whole simulation. Also, they each have one main procedure call the other procedures defined in the program.

To refer to a program in a network definition statement, just code the main procedure name.

The following statements and operands let you specify where STL programs are to be used and other requirements for your network:
  • PATH statements in your network definition list the main procedures representing STL programs to be used by each resource in your simulated network. For each simulated resource, you can code a PATH statement to specify the main procedure names representing the STL programs to be executed by the resource and the order of execution. The programs are executed repeatedly until the simulation is ended. See Creating WSim Scripts for more information about how the procedures (message generation decks) can be listed.
  • The PATH operand specifies which PATH statement defines the main procedures representing the STL programs to be used for a particular resource.
  • INCLUDE statements in your network definition let you include any procedures used by the network during the simulation run. You need to code an INCLUDE statement for any procedure used in your simulation that is not either included in a PATH statement or explicitly called or executed within your program. For example, this can be procedures called on a new path the operator specifies by issuing the A (Alter) operator command.
  • The FRSTTXT operand defines the main procedure representing an STL program to be used as the first program in a simulation. It is used only once and not repeated. Typically this procedure contains your logon logic.
  • The ATRDECK operand specifies the name of the main procedure representing an STL program to be invoked automatically to provide automatic terminal recovery.
Note: Be sure that the CNTRS operand is not coded in your network definition. This operand can cause problems when using STL programs.

The PATH and INCLUDE statements are coded in your network definition. The PATH and FRSTTXT operands are coded on the DEV, TP, or LU statement defining the resource for which they are used or on higher-level statements such as NTWRK, VTAMAPPL, TCP/IP, and APPCLU statements. The ATRDECK operand is coded on the DEV or LU statement.

See Creating WSim Scripts for a more complete explanation of these statements and operands. You should be familiar with these books so that you are aware of the range of possibilities available to you when designing the messages to be simulated with your STL programs.

The example below shows a portion of a network definition.
testnet  ntwrk   uti=100,bufsize=6000,delay=f(5),
                 stltrace=yes,mlog=yes,logdsply=both
mypath   path    test1,coffee
*                ***** ******
appl1    vtamappl
mylu     lu      lutype=lu2,path=(mypath),init=sec,maxsess=(0,1),
                 display=(24,80),frsttxt=logon
In the network definition shown above, the LU first executes the main procedure named LOGON referenced on the FRSTTXT operand. Then it executes the programs represented by the main procedures named on the PATH statement MYPATH: TEST1 and COFFEE.

Each main procedure, representing a program, named on a path statement is called a path entry. When a represented program is named on a path entry, WSim executes that main procedure representing the program and any procedures called by that program in the course of its execution.

Suppose that you have written two STL programs, one designed to start a full-screen editor and the other designed to start a compiler. Each program consists of a single STL procedure. Figure 1 shows what the source data sets might look like.
Figure 1. Two STL programs
┐
│                              │
│      /* Program #1 */        │
│ @program = program1          │
│ edit: msgtxt                 │
│                              │
│ /**************************/ │
│ /*                        */ │
│ /* This data set contains */ │
│ /* an STL program that    */ │
│ /* edits a data set.      */ │
│ /*                        */ │
│ /**************************/ │
│  .                           │
│  .                           │
│  .                           │
│ endtxt                       │
│ @endprogram                  │
│                              │
│                              │
│      /* Program #2 */        │
│ @program = program2          │
│ compile: msgtxt              │
│                              │
│ /**************************/ │
│ /*                        */ │
│ /* This data set contains */ │
│ /* an STL program that    */ │
│ /* invokes a compiler.    */ │
│ /*                        */ │
│ /**************************/ │
│  .                           │
│  .                           │
│  .                           │
│ endtxt                       │
│ @endprogram                  │
│                              │
└
The main procedure in each program should be named on a PATH statement in your network definition. For example, if you have defined an LU named LU1 in your network definition, you can have it execute EDIT first and COMPILE second as shown in the network definition that appears in Figure 2.
Figure 2. Network definition to use two STL programs
*NETWORK DEFINITION STATEMENTS
*
     (This is
      the PATH --> LU1PATH  PATH     EDIT,COMPILE
      definition)  .
                   .
     (This is      .
      the LU   --> LU1      LU       PATH=LU1PATH,...
      definition)  .
                   .
                   .
The path entries specified on the PATH statement correspond to the procedure names coded in the two example programs. Figure 3 illustrates this relationship.
Figure 3. Relationship of PATH statement and STL programs
*WSim NETWORK DEFINITION STATEMENTS
 .
 .
 .
LU1PATH   PATH     EDIT,COMPILE
                    │     │
   ┌┘     └┐
   │                                   │
   │ ┌┐  │ ┌┐
   │ │                              │  │ │                              │
   │ │      /* Program #1 */        │  │ │      /* Program # 2 */       │
   │ │ @program = program1          │  │ │ @program = program2          │
   └─┼→edit: msgtxt                 │  └┼→compile: msgtxt              │
     │                              │    │                              │
     │ /**************************/ │    │ /**************************/ │
     │ /*                        */ │    │ /*                        */ │
     │ /* This data set contains */ │    │ /* This data set contains */ │
     │ /* an STL program that    */ │    │ /* an STL program that    */ │
     │ /* edits a data set.      */ │    │ /* invokes a compiler.    */ │
     │ /*                        */ │    │ /*                        */ │
     │ /**************************/ │    │ /**************************/ │
     │  .                           │    │   .                          │
     │  .                           │    │   .                          │
     │  .                           │    │   .                          │
     │ endtxt                       │    │  endtxt                      │
     │ @endprogram                  │    │  @endprogram                 │
     └┘    └
As another example, you might design an editor program that contains three procedures: “edit”, the main procedure; “locate”, which performs an editor locate instruction; and “change”, which performs an editor change instruction. The program appears in Figure 4.
Figure 4. STL program containing multiple STL procedures
                      /* STL Program */
               edit: msgtxt
               /**********************************/
               /*                                */
               /* This data set contains an      */
               /* STL program that edits a data  */
               /* set.                           */
               /*                                */
               /**********************************/
                .
                .
                .
               call locate
                .
                .
                .
               call change
                .
                .
                .
               endtxt
               locate: msgtxt
                .
                .
                .
               endtxt
               change: msgtxt
                .
                .
                .
               endtxt
The network definition for this program would look like the one shown below.
* NETWORK DEFINITION STATEMENTS
⋮
LUPATH  PATH  EDIT
Note that only the EDIT procedure is referenced on the PATH statement.