CMND statement

Use the CMND statement to specify an SNA or user command to be sent by a logical unit to the system under test. WSim builds default SNA headers for the command, but you can modify the headers with the TH and RH statements. The following example shows how to use the CMND statement to generate an INIT-SELF command.
CMNDDECK  MSGTXT
          CMND    COMMAND=INIT,
                  MODE=LOGLU0,
                  RESOURCE=APPL1,
                  DATA=($ID,8$/PASSWORD),
                  URC=($ID,8$)
          ENDTXT
The following example demonstrates how to use the CMND statement to build a SIGNAL command:
CMND  COMMAND=SIGNAL,SENSE='00010000'    SNA attention key (SIGNAL).
The CMND statement can be used to generate asynchronous SNA data flows. When the CMND statement is the next statement in a message generation deck, the CMND statement is executed, even if the normal requirements for entering message generation have not been met. The following example demonstrates how to use this asynchronous message generation capability:
SLU      MSGTXT
*  Send SNA signal when a chain of data is received which
*  does not allow the terminal to send the next message.
*
0        IF     LOC=RH+0,TEXT='80',THEN=SW1(OFF),  SNA request and
                ELSE=SW1(ON)
1        IF     LOC=RH+0,TEXT='40',THEN=SW1(OFF)   FM ...
2        IF     LOC=RH+0,TEXT='20',THEN=SW1(OFF)   ... data and
3        IF     LOC=RH+0,TEXT='01',ELSE=SW1(OFF)   end of chain and
4        IF     LOC=RH+2,TEXT='40',THEN=SW1(OFF)   not end bracket and
5        IF     LOC=RH+2,TEXT='20',THEN=SW1(OFF)   not change direction.
6        IF     LOC=SW1,THEN=C-SIGNAL              Generate SNA signal.
WAITING  WAIT
         BRANCH LABEL=WAITING
SIGNAL   CMND   COMMAND=SIGNAL,SENSE='00010000'    SNA attention key.
         WTO    (SIGNAL SENT)
         RETURN
         ENDTXT
In this example, if the simulated device receives a chain of data that does not allow the device to transmit a following message (for example, change direction is not received and end bracket is not received), the device sends an asynchronous SIGNAL command.

Two operands of the CMND statement (MODE and RESOURCE) accept variable names that can be dynamically generated or changed during the simulation. These variable names can be stored in and retrieved from save and user areas. Any device in the network can change the names in the network user area. You can use the DATASAVE statement to alter the contents of a save area or user area.

You can specify the name of the save or user area and reference an offset with one of the following operand values:
  • value
  • Ns+value
  • s+value
  • value
N indicates the network user area, Ns is the number of a network save area, s is the number of a device save area, and U indicates a device user area. value is the offset into the area. When you define a name in this manner, the first 8 bytes of data, beginning at the specified offset, are taken as the name. If the area does not exist or if no data is present, a name of eight blanks is used. No validity checking is performed on the name; therefore, you can use a name that cannot be expressed as EBCDIC characters.

For the network and device user area, the name must be padded with blanks in your coding if the length is less than eight.

The following example demonstrates how you can use DATASAVE to place WSIMLU2 into the network user area. A session can then be established for WSIMLU2.
SAVE1  DATASAVE  AREA=N+0,TEXT=(WSIMLU2 )
CMND1  CMND      COMMAND=INIT,RESOURCE=N+0
In the following example, LU11 is placed into the device user area. A session can then be established for LU11.
SAVE5   DATASAVE  AREA=U+0,TEXT=(LU11    )
CMND5   CMND      COMMAND=INIT,RESOURCE=U+0
In the following example, the first name from user table 1 is placed into the network user area.
SAVE3   DATASAVE  AREA=N+0,TEXT=($UTBL,1,0$)
CMND3   CMND      COMMAND=INIT2,RESOURCE=N+0
In this user table, the luname should be coded as follows:
1 UTBL   (LU11    )
In the following example, WSIMLU2 is placed into device save area 1. A session can then be established for WSIMLU2.
SAVE8   DATASAVE  AREA=1+0,TEXT=(WSIMLU2 )
CMND8   CMND      COMMAND=INIT,RESOURCE=1+0
The following example demonstrates that the first name from user table 1 is placed into device save area 2. A session is then established.
SAVE9   DATASAVE  AREA=2,TEXT=($UTBL,1,0$)
CMND9   CMND      COMMAND=INIT2,RESOURCE=2+0