GETE: Get ESD data

GETE returns data from ESD items. GETE must be used on a bound workmod. Four optional parameters allow you to specify selection criteria for the ESD items to be returned: section name, ESD record type, offset in the section or module, and symbol name. Only ESD records that meet all of the selection criteria will be returned. Multiple selection criteria can be specified to retrieve exactly the records you need.

The syntax of the GETE call is:

FUNC=GETE
Requests that data from ESD items in a workmod be returned to a specified location.
VERSION=1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
Specifies the version of the parameter list to be used. The default value is VERSION=1.
Note: If VERSION=1 is specified for the GETE call, CLASS cannot be specified as a macro keyword. The parameter list ends with the COUNT parameter (with the high-order bit set). This exception is for Version 1 only.
RETCODE=retcode — RX-type address or register (2-12)
Specifies the location of a fullword integer that is to receive the return code returned by the binder.
RSNCODE=rsncode — RX-type address or register (2-12)
Specifies the location of a 4-byte hexadecimal string that is to receive the reason code returned by the binder.
WORKMOD=workmod — RX-type address or register (2-12)
Specifies the location of an 8-byte area that contains the workmod token for this request.
SECTION=section — RX-type address or register (2-12)
Specifies the location of a 16-byte varying character string that contains the name of the section to be processed. This argument can be set to blanks to indicate blank common area. Sections will be retrieved in the same order that they were included in the workmod.

The default value is all sections. If this parameter is specified, only the indicated section is searched.

RECTYPE=rectype — RX-type address or register (2-12)
Specifies the location of a varying character string that contains a list of the ESD record types to be returned. If you do not specify this argument, all record types are returned.
Record types must be identified by one- or two-character codes, separated by commas and enclosed in parentheses. Embedded blanks are not allowed. Valid record types are:
SD
Section definition
ED
Element definition
LD
Label definition
PD
Part definition
PR
Part reference
ER
External reference
CM
Common
ST
Segment table
ET
Entry table
DS
Dummy section definition
CM
Common section definition
ET
ENTAB
ST
SEGTAB
PC
Private code section definition
WX
Weak external reference
In addition, you can use a generic code to reference more than one ESD type:
S
Section definition records (SD, CM, ST, ET, PC, and DS)
U
Unresolved external references (ER, ESD_STATUS=unresolved)
CLASS=class — RX-type address or register (2-12)
Specifies the location of a 16-byte varying character string containing the name of the text class referenced by the ESD record to be selected. If class has not been specified, ESD records are returned without regard to class.
OFFSET=offset — RX-type address or register (2-12)
Specifies the location of a fullword integer that contains the offset within the specified section. If a section name has not been specified, a module offset is assumed. If you specify OFFSET you cannot specify SYMBOL but must specify CLASS.
SYMBOL=xsymbol — RX-type address or register (2-12)
Specifies the location of a varying character string that contains a symbol to be used as a selection criterion. If you specify SYMBOL you cannot specify OFFSET.

If neither OFFSET nor SYMBOL is provided, processing begins at the start of the item.

AREA=buffer — RX-type address or register (2-12)
Specifies the location of a buffer to receive the data. This buffer must be allocated and initialized in ESD format. See IEWBUFF - Binder API buffers interface assembler macro for generating and mapping data areas for information on buffer handling.
CURSOR=cursor — RX-type address or register (2-12)
Specifies the location of a fullword integer that indicates the position within the section or module where the binder should begin processing. Specifying a zero for this argument causes the binder to begin processing at the first ESD entry. Offsets are specified in records and are relative to the start of the selected ESD item(s).
COUNT=count — RX-type address or register (2-12)
Specifies the location of a fullword integer in which the binder will store the number of entries it has returned.

Processing notes

The binder returns ESD records that meet the selection criteria specified on the call:
  • If SECTION is specified, only that section of the ESD will be searched. All sections is the default.
  • If RECTYPE is specified, only ESD records of the types appearing in the supplied list are returned.
  • If OFFSET is specified and rectype="S", the ESD record for the control section (or common area) containing the specified offset, is returned for buffer version 1. The SD record mapping in other buffer versions does not contain an offset and no records will be returned. If OFFSET is specified and rectype="LD", then all LD ESD records for the symbols defined at or before that location (within the containing section) will be returned.
  • If SYMBOL is specified, all ESD records of the type(s) specified with that symbol name are returned. If CLASS is specified, only ESD records that define locations in that class are returned. Some records, such as SD and ER, are not associated with any class and are never returned if class is specified.
Note: Processing of the ESD records returned by a GETE call should not make assumptions about the order of the returned ESD records. For example, such processing should not assume that LD type ESD records are returned in the order of their offsets in the section.

The CURSOR value identifies an index into the requested ESD data beginning with 0 for the first ESD. The ESD buffer formats defined in Binder API buffer formats contain an entry length field in their headers. Multiplying the cursor value by the entry length provides a byte offset into the data. CURSOR is an input and output parameter. On input to the service, the cursor specifies the first record to return. On exit from the service, it is updated to the index of the next sequential ESD if not all data has yet been retrieved.

The binder will typically return multiple entries in a single call, depending on the size of the buffer. Data is reformatted, if necessary, to conform to the version identified in the caller's buffer. The COUNT parameter is set to the number of records actually returned in the buffer.

The ESD buffer formats defined in Binder API buffer formats contain a record length field in their headers giving the length of each ESD record. This provides a way for the caller to index through the returned records or to access a specific record in the returned data buffer.

In some cases where OFFSET is specified and the parameter list is version 6 or less, return code 0 and reason code 0 will be returned on an end-of-data condition. The version 7 API call will always return return code 4 and reason code 83000800 on an end-of-data condition, while the COUNT may be non-zero indicating that data was returned.

Return and reason codes

The common binder API reason codes are shown in Table 1.

Return Code Reason Code Explanation
00 00000000 Normal completion.
04 83000705 The specified symbol could not be located in the workmod. No data is returned in the buffer.
04 83000800 An end-of-data condition was detected. Some data might have been returned in buffer. There is no message associated with this condition.
04 83000801 The requested item was not found in the workmod, or was empty, or no records met the specified criteria. No data returned.
04 83000812 The specified offset was negative or beyond the end of the designated item or module. No data is returned in the buffer.
12 83000101 OFFSET and SYMBOL have both been specified. Request rejected.
12 83000102 Workmod is unbound. GETE request rejected.

Parameter list

If your program does not use the IEWBIND macro, place the address of the GETE parameter list in general purpose register 1.

Table 1. GETE parameter list
       
PARMLIST DS 0F  
  DC A(GETE) Function code
  DC A(RETCODE) Return code
  DC A(RSNCODE) Reason code
  DC A(WORKMOD) Workmod token
  DC A(SECTION) Section name
  DC A(RECTYPE) ESD record type(s)
  DC A(OFFSET) Offset in module or section. If not a selection criterion, set to -1.
  DC A(SYMBOL) Symbol name
  DC A(BUFFER) Data buffer
  DC A(CURSOR) Starting position
  DC A(COUNT) Data count
  DC A(CLASS) Text class
GETE DC H'62' GETE function code
  DC H'version' Interface version number
RECTYPE DC H'7',CL7'(SD,CM)' Sample varying string
       
Note: X'80000000' must be added to either the COUNT parameter (for Version 1) or the CLASS parameter (for Version 2 or higher).