Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
GENCB—Generate a control block z/OS Communications Server: SNA Programming SC27-3674-00 |
|
PurposeThe GENCB macroinstruction builds an ACB, EXLST, RPL, or NIB. The advantage of using the GENCB macroinstruction is that the control blocks are generated during program execution. (With the ACB, EXLST, RPL, and NIB macroinstructions, the control blocks are built during program assembly.) GENCB not only builds the control block during program execution, but can also build the control block in dynamically allocated storage. One advantage of this technique is that it can remove application program dependencies on the length of each control block. UsageThe GENCB user specifies the type
of control block to be built and the contents of some of its fields.
The operands used to specify the field contents are exactly the same
as those used in the declarative macroinstruction that builds the
control block during assembly. For example, these macroinstructions
build the same exit list:
To build the control block in the application program's storage, the application program should either reserve enough storage during program assembly to accommodate the control block or issue an operating system storage manipulation macroinstruction to get the necessary storage. If an operating system macroinstruction is used, the location and length of this storage must be coded in the GENCB macroinstruction. Dynamic storage allocation for the control block occurs automatically if the location and length operands (WAREA and LENGTH) are omitted. To free the storage obtained by the GENCB macro, the application program can issue the appropriate operating system instruction. Ordinarily, the storage should be returned to subpool 0. However, if GENCB is issued in a task running in privileged state, return the storage to subpool 252. Dynamic storage allocation can be successful only if (1) the program is operating in virtual mode and (2) enough unallocated virtual storage remains in the program's partition or address space to build the control block. See the description of the LENGTH operand for an explanation of how control block lengths are determined. List, generate, and execute forms of the GENCB macroinstruction are available; they are designated by the MF operand. (See Forms of the manipulative macroinstruction, for more information.) These forms must be used if the invoking routine is reentrant. Because the GENCB operands can be specified in a large variety of formats, format specifications have been tabulated in Summary of operand specifications, and do not appear in this macroinstruction description. Note: Not all control block fields
can be initialized by using GENCB. See Summary of operand specifications,
for those supported. You can initialize other fields at execution
time by using the appropriate control block DSECTs described in Control block formats and DSECTs.
The GENCB macroinstruction can be issued by an application program running in either 24- or 31-bit addressing mode. Refer to 31-bit addressing for information on 31-bit addressing. To use 31-bit addressing, the application must use the VTAM® mapping macroinstructions as well as GETMAIN and FREEMAIN. Syntax>>-+------+--GENCB--BLK--=--+-ACB---+--,--AM--=--VTAM-----------> '-name-' +-EXLST-+ +-NIB---+ '-RPL---' .-,--COPIES--=--1--------. >--+------------------------+--+----------------------+---------> '-,--COPIES--=--quantity-' '-,--keyword--=--value-' >--+----------------------------------------------------------------+--> '-,--MF--=--+-(--E--,--parameter_list_address--)---------------+-' +-(--G--,--parameter_list_address--+----------+--)-+ | '-,--label-' | +-L------------------------------------------------+ '-(--L--,--parameter_list_address--+----------+--)-' '-,--label-' >--+----------------------------------------------------------------+->< '-,--WAREA--=--work_area_address--,--LENGTH--=--work_area_length-' Input parameters
Examples
GEN1 builds an ACB in statically
reserved storage (BLOKPOOL). When GEN1 is executed, register 3 must
contain the address of an application program's symbolic name, and
register 6 must contain the address of the exit list to be pointed
to by the ACB.
In this example,
the application program is building an ACB in dynamically allocated
storage obtained by itself. Using the procedure described in the preceding
LENGTH operand description, the application program has obtained the
length of an ACB and placed it in a fullword called WORKAREA. The
instructions preceding GEN2 obtain the correct amount of storage,
and GEN2 builds the ACB in that storage.
GEN3 creates 10 RPLs in dynamically allocated storage. The address of the beginning of these RPLs is returned in register 1, and the total length is returned in register 0. This length includes all padding for fullword alignment; the RPLLEN field indicates the length of each unpadded RPL. Each RPL is built as though an RPL macroinstruction with no operands had been issued. Completion informationAfter GENCB processing is finished and control is returned to the application program, register 15 indicates whether the operation is completed successfully. If the operation is completed successfully, register 15 is set to 0. If it is completed unsuccessfully, register 15 is set to either X'04', X'08', or X'0C'. If register 15 is set to X'04' or X'0C', register 0 is also set indicating the specific nature of the error (see Return codes for manipulative macroinstructions). After successful completion, register 1 has the address of the generated control blocks, and register 0 has their total length (including padding to a fullword boundary). |
Copyright IBM Corporation 1990, 2014
|