GC - Getting Compile unit information

Compile unit information is primarily data passed to the binder by compilers, identifying the source of each program making up the program object being inspected. As an important special case, though, the first compile unit entry returned when the cursor is specified as zero provides information on the DASD location of the program object itself. The program object source "header record" returned by fast data in the CUI buffer for a program object in a PDSE will never identify the data set containing the object.

When no culist is provided, the cursor is an index into an ordered list of all CUI entries that can be returned. If the application does not modify the cursor during the retrieval process, multiple calls return all CUI records in the order by CU number because the buffer is full. When the culist is provided, the cursor is an index into that application-provided list. CUI records are returned in the order specified in the culist. If the application still does not modify the cursor during the retrieval process, multiple calls continue with subsequent entries in the list because the buffer is full. End of data is signalled when the end of the application-provided list is reached.

Table 1. GC parameter list
Parameter Usage Format Content
1 in structure 'GC', X'0001'
2 in binary word mtoken
3 (optional) in binary words culist

An array of numbers. The first word is the number of additional words that follow it. Each additional word is a compile unit number returned in BNL_SECT_CU by a 'GN' call.

If no compile unit numbers are passed, the first (and only) word must be zero.

4 in/out structure buffer

Must be a CUI buffer formatted by IEWBUFF or as defined in Binder API buffer formats.

5 in/out binary word cursor

Cursor is an index within the culist or into an ordered list of all CUI entries.

6 out binary word count

The number of CUI records returned by the binder.

Sample assembler code

         CALL  (15),(GCIL,MTOKEN,NULL,BUFF,CURS,CNT),VL

GCIL     DC    C'GC',X'0001'
MTOKEN   DS    F             As set at Start call    
NULL     DC    F'0'          Omitted to get all CU's
CURS     DC    F'0'          Start with PO information
CNT      DS    F             Number of records returned 
BUFF  IEWBUFF  FUNC=MAPBUFF,TYPE=CUI,VERSION=6,SIZE=2000