ABSTRACT

The use of parameters in GPSS/H is so important (and often the most difficult part of learning GPSS/H) that further discussion of them will be presented in this chapter.

Some examples of the ASSIGN Block are given next. Assume that the values stored in the parameters are as follows:

PH1 = 3 PL1 = 1.370 PH2 = 4 PL2 = –4.60 PH3 = 8 PL3 = 9.870 PH4 = –20 PL4 = 1.77

(a) ASSIGN 1,PH2,PH (b) ASSIGN PH3,PH4,PH (c) BLET PH(JOE) = PL4 (d) ASSIGN 2-,PH3,PL

(e) ASSIGN PH1,PH4,PH (f) ASSIGN 3,PL1+PL2+PL3+PL4,PH (g) ASSIGN PH2,PH1*PL2,PH (h) ASSIGN 3-,PH3+PH4,PH

In (a), the value stored in half-word parameter 1 is now 4. In (b), the value stored in half-word parameter 8 is now −20. In (c), the value stored in half-word parameter JOE is now 1. GPSS/H truncates

numbers. In (d), the value of real parameter 2 is now −4. Its value was 4, and the value stored

in PH3 was 8 and this is subtracted from 4. In (e), the value stored in half-word parameter 3 is now −20. In (f), the value stored in half-word parameter 3 is now 8. The algebraic sum of the

four real parameters is 8.41 and GPSS/H truncates this to 8. In (g), the value stored in half-word parameter 4 is now −14 In (h), the value stored in half-word parameter 3 is now 20. (PH3 + PH4 is −12 and

this is subtracted from the current value of 8 to obtain 20.)

Remember that the B operand in an ASSIGN statement can be any SNA. Thus, Blocks such as

ASSIGN Q(WAIT),S(TUG)+R(DOCK),PH

may look strange but will work as long as the B operand does not return values that are incorrect such as Q(WAIT) that is zero or less.