GETD: Get data

GETD returns data from items in a workmod. The values of the CLASS and SECTION parameters determine which item is returned. If SECTION is omitted, all sections are returned as a single unit. This service can only be performed on a bound workmod.

The syntax of the GETD call is:

FUNC=GETD
Requests that data from 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.
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.
CLASS=class — RX-type address or register (2-12)
Specifies the location of a 16-byte varying character string containing a class name. The class name might have been defined by the binder, a compiler, or an end user. See Understanding binder programming concepts for binder class names. B_PMAR is also accepted as a class name, although it is not an actual class in a binder workmod.
SECTION=section — RX-type address or register (2-12)
Specifies the location of a varying character string that contains the name of the section to be processed. If omitted, this defaults to a concatenation of all sections in the specified class. If the processing intent is bind, the sections are ordered by virtual address. If the processing intent is access, they are returned in the same order that they were included in the workmod.
AREA=buffer — RX-type address or register (2-12)
Specifies the location of a buffer to receive the data. The binder returns data until either this buffer is filled or the specified items have been completely moved. 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 contains the position within the item(s) where the binder should begin processing. Specifying a zero for the argument causes the binder to begin processing at the start of the item. The cursor value is specified in bytes for items in the TEXT class, in records for all other classes. The value is relative to the start of the item. The cursor value is modified before returning to the caller.
COUNT=count — RX-type address or register (2-12)
Specifies the location of a fullword that is to receive the number of bytes of TEXT or the number of entries returned by the binder.
RELOC=reloc
Specifies a base address to be used for relocation. You can only use this parameter with VERSION=6 or higher. You will need to know the load segment for the data you are requesting. You can map text classes into load segments using GETN. reloc is a single 8–byte address. The relocation address will relocate the adcons in the returned text buffer as though the program segments had been loaded at the designated address. If you do not use the RELOC parameter, it should set to zero.

Processing notes

The CURSOR value identifies an index into the requested data beginning with 0 for the first data item. Each of the buffer formats defined in Binder API buffer formatscontains an entry length field in its header. Multiplying the cursor value by the entry length provides a byte offset into the data. Note that CUI, LIB, PMAR, and text data is always treated as having entry length 1. The CURSOR value is both an input and output parameter. On input to the service, the cursor specifies the first item to return. On exit from the service, it is updated to an appropriate value for continued sequential retrieval if not all data has yet been retrieved. For text data, this may or may not be the next byte after the last one returned, because pad bytes between sections and uninitialized data areas within sections may have been skipped. Any data skipped should be treated by the calling application as containing the fill character (normally X'00').

On the next GETD request, the binder begins processing where the last request left off.

If you interrupt a series of successive GETD calls, you should reset the value of the cursor before continuing. Otherwise, the cursor value might be invalid and the results of a GETD request are unpredictable.

If a section name is not passed on a GETD API invocation for a text class and the target is an overlay module, the cursor is interpreted as an offset into the module and laid out sequentially in segment order, using the alignment as specified in the object modules.

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 83000800 Normal completion. Some data might have been returned in the buffer, and an end-of-data condition was encountered. There is no message associated with this condition.
04 83000801 The requested item did not exist or is empty. No data has been returned.
08 83000750 The buffer is not large enough for one record. No data is returned.
08 83000813 The buffer version is not compatible with the module content. No data is returned.
08 83002349 Not all adcons were successfully relocated. This condition could occur because relocation addresses for all the segments were not passed, or because the adcon length was insufficient to contain the address.
12 83002379 Binder encountered a bad cursor for class B_PARTINIT and processing has been stopped.
12 83000102 Workmod was in an unbound state. GETD request could not be processed.
12 83002375 The class was not a text class.

Parameter list

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

Table 1. GETD parameter list
       
PARMLIST DS 0F  
  DC A(GETD) Function code
  DC A(RETCODE) Return code
  DC A(RSNCODE) Reason code
  DC A(WORKMOD) Workmod token
  DC A(CLASS) Class name
  DC A(SECTION) Section name
  DC A(BUFFER) Data buffer
  DC A(CURSOR) Starting position
  DC A(COUNT+X'80000000') Data count and end-of-list indicator
  DC A(RELOC) Relocation address
GETD DC H'61' GETD function code
  DC H'version' Interface version number