GETN returns the names of each section or class in the workmod, a count of the total number of sections or classes, and the compile unit (CU) numbers for each section. The names returned also include names generated by the binder to represent private code sections, unnamed common, SEGTAB and ENTAB sections for overlay programs, and any other sections created by the binder. GETN can only be performed on a bound workmod.
The syntax of the GETN call is:
[symbol] | IEWBIND | FUNC=GETN [,VERSION=version] |
Section names will be moved until either the buffer is filled or all names have been moved. This keyword is optional. If it is not specified, only the number of section names in the workmod will be returned.
The CURSOR value identifies an index into the requested data beginning with 0 for the first name list entry. The name list 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 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 the index of the next sequential name list entry if not all entries have yet been retrieved.
The common binder API reason codes are shown in Table 1.
Return Code | Reason Code | Explanation |
---|---|---|
00 | 00000000 | Normal completion. |
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 | No section names exist. No data was returned. |
08 | 83000750 | The buffer is not large enough for one record. No data is returned. |
04 | 83000810 | Cursor is negative or beyond the end of the specified item. No data was returned. |
12 | 83000102 | Workmod is unbound. GETN request rejected. |
If your program does not use the IEWBIND macro, place the address of the GETN parameter list in general purpose register 1.
PARMLIST | DS | 0F | |
DC | A(GETN) | Function code | |
DC | A(RETCODE) | Return code | |
DC | A(RSNCODE) | Reason code | |
DC | A(WORKMOD) | Workmod token | |
DC | A(BUFFER) | Data buffer | |
DC | A(CURSOR) | Starting position | |
DC | A(COUNT) | Data count | |
DC | A(TCOUNT) | Total count | |
DC | A(NTYPE+X'80000000') | Name type to return and end-of-list indicator | |
GETN | DC | H'60' | GETN Function code |
DC | H'version' | Interface version number | |
NTYPE | DC | CL1'C' | 'C' = class; 'S' = section |