V5R4-High-Level-Language-API
V5R4-High-Level-Language-API
APIs by category
APIs
These are the APIs for this category.
The Application Development Manager/400 APIs allow a control language (CL) command such as the
Build Part (BLDPART) command to determine, for example, the includes and external references that
were used by certain processors when processing a source member. The term processor is used in these
APIs to mean compiler or preprocessor. A part can be either a source member or an object, such as a file.
The Get and Set Status APIs are used to query and initialize the build information space that is to contain
the Application Development Manager/400 information. The Write and Read Build Information APIs are
used to write or read records of build information to and from the space.
For additional information, see “Using Application Development Manager/400 APIs” on page 56.
For information on the different types of records that can be read or written using the Application
Development Manager/400 APIs, see:
v “Record Types” on page 32
v “Examples of Records Written” on page 55
The Get Space Status (QLYGETS) API obtains the status of the space.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
Message ID Error Message Text
CPF3CF1 E Error code parameter not valid.
CPF3C90 E Literal value cannot be changed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.
The Read Build Information (QLYRDBI) API reads one or more records from the space.
After QLYRDBI has read the final record, the next call to QLYRDBI starts reading the space from the
beginning again.
QLYRDBI reads one or more records depending on the value specified on the Read mode parameter.
QLYRDBI does not read more records than can fit in the buffer. The buffer is determined by the
Maximum-size parameter.
Buffer length
OUTPUT; BINARY(4)
The length of the data returned. If records are not read, 0 is returned.
Number of records
OUTPUT; BINARY(4)
The number of records read. Number of records is 0 if no records were read, 1 if one record was
read or greater than 1 if *MULTIPLE was specified on read mode and more than one record
could fit in the buffer.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
The LIBxxxx error messages are located in the message file QLIBMSG in the QSYS library.
The Set Space Status (QLYSETS) API sets the status of the space.
When QLYSETS is first called to create the space (if the space does not exist already) or to initialize the
space so the information can be written to it by compilers or preprocessors, the Status parameter should
be set to *READY. Then QLYSETS writes a special record (called the HEADER record) at the beginning of
the space and initializes a status flag in that record to *READY. Now the space is ready to accept records
containing build information. Compilers write to the space using the QLYWRTBI API. QLYWRTBI writes
records to the space concatenated to each other. QLYRDBI later reads them sequentially in the order in
which they are written.
Use the QLYSETS API to set the status flag in the space to *COMPLETE after the information in the space
is processed using the QLYRDBI API. This indicates that the information in the space has been processed
and the space can be reused.
*READY Initialize the space. If the space does not exist, it is created.
*COMPLETE Information in the space has been processed. The space can now be used by setting it to *READY
with another call to QLYSETS.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
The Write Build Information (QLYWRTBI) API writes one or more records to the space.
QLYWRTBI writes records to the space concatenated to each other. QLYRDBI later reads them
sequentially in the order in which they are written.
QLYWRTBI continues to write records to the API space concatenated to previous records written, until
QLYSETS is called. See “Record Types” on page 32 for the records that can be written. See “Examples of
Records Written” on page 55 for examples of the sequence of records written.
The first field in each record indicates the record length. This allows all the records to be read
sequentially using the QLYRDBI API.
COBOL/400 APIs
The OPM and ILE COBOL/400(R) APIs let you control run units and error handling.
Refer to Using COBOL Program to Call APIs and Error Handler for Example COBOL Program in the API
Examples for illustrations of how to use these APIs.
For a description of how to use the ILE COBOL/400 APIs, refer to the chapter about error and exception
handling in the WebSphere Development Studio: ILE COBOL Programmer″s Guide book.
The Change COBOL Main Program (QLRCHGCM) API allows you to create an additional run unit by
assigning a different System/36-compatible COBOL, System/38-compatible COBOL, or iSeries OPM
COBOL/400 program to serve as a main program. You can call it from any programming language.
Note: By creating more than one run unit, you cantreat files, storage, and error conditions differently than
you would using an ordinary subprogram.
After you call this API, the next nonactive COBOL program that runs becomes the main program in a
new run unit. An active COBOL program is a program that has been called, and is not in its initial state.
In the following example, System/38-compatible COBOL Program A calls iSeries COBOL/400 Program B.
Because Program A is the first COBOL program, it is the main COBOL program.
Program C must start a new COBOL application that will pass control back to it, regardless of error
conditions. To accomplish this, Program C calls the QLRCHGCM API before calling the new COBOL
application.
When program C calls the new COBOL application in the form of Program D, Program D becomes the
main program in a new run unit. When Program D’s run unit ends, control returns to the original run
unit, and Program A becomes the current main program again.
If, at the time a run unit is created, a program is active as a subprogram in an existing run unit, and this
program is then called within the new run unit, it will be made available in its last-used state.
Required Parameter
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
LBE7040 E Format of error code parameter is not correct.
The Dump COBOL (QlnDumpCobol) API allows you to perform a formatted dump of an ILE
COBOL/400 program. You can call it from any ILE program; however, if the calling program is not an
ILE COBOL/400 program, only a data dump will be performed. Message CPF955F will be issued if this
API is called to dump any module other than those created by the ILE COBOL/400 compiler.
This API provides two types of dumps, a data dump and an extended dump. The data dump contains
the following information:
v The name of each variable
v The data type
v The default value
v The hexadecimal value
Note: Only the first 250 characters of the values will be shown in the dump.
Variable values may only be requested if an active call stack entry exists for the module object specified
in the job in which this API is called. Values existing in program static or automatic storage are not
accessible by this API unless the program object has a current call stack entry. All variables that were
defined by the compiler and stored in the module object’s HLL symbol table will be returned.
Also, the module object for which variable information is requested must contain debug data. Thus, the
module object must be compiled with a *DBGVIEW option other than *NONE.
Dump type
INPUT; CHAR(1)
The type of dump.
Valid values are:
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
Message ID Error Message Text
CPF3C21 E Format name &1 is not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF9549 E Error addressing API parameter.
CPF954F E Module &1 not found.
CPF955F E Program &1 not a bound program.
CPF9562 E Module &1 cannot be debugged.
The Retrieve COBOL Error Handler (QlnRtvCobolErrorHandler) API allows you to retrieve the procedure
pointer of the current COBOL error-handling procedure. You can call it from any ILE programming
language; however, this API only retrieves the procedure pointer of the error handling program that is
called when an error occurs in an ILE COBOL/400 program.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error code
parameter.
The Retrieve COBOL Error Handler (QLRRTVCE) API allows you to retrieve the name of the current or
pending COBOL error-handling program. You can call it from any programming language; however, this
API only retrieves the name of the error handling program that is called when an error occurs in an OPM
COBOL/400 program.
library-name
The library where the program object existed.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
LBE7040 E Format of error code parameter is not correct.
LBE7051 E Scope parameter not valid.
LBE7052 E Run unit specified for error handler does not exist.
LBE7055 E Severe error while addressing parameter list. The API did not complete.
The Set COBOL Error Handler (QLRSETCE) API allows you to specify the identity of a COBOL
error-handling program. You can call it from any programming language; however, this API only sets the
name of the error handling program that is called when an error occurs in an OPM COBOL/400
program.
After you call this API, any COBOL/400 program that issues an inquiry message with options C, D, or F
will first call the defined error-handling program. This program receives the message identification and
substitution text, as well as the name of the program that received it, and a list of valid one-character
responses. The defined program is responsible for returning a one-character code (blank, C, D, F, or G)
indicating whether the COBOL program should continue or not.
Note: All messages issued by the operating system during the running of a COBOL program are
monitored by the COBOL program. Only some of the system messages issued will result in a COBOL
inquiry message.
For more information about error handling and the issuing of COBOL inquiry messages, see the chapter
on error handling in the WebSphere Development Studio: ILE COBOL Programmer’s Guide book.
Only one error-handling program can be active at a time. If an error occurs in the error-handling
program, the COBOL program does not call the error-handling program again. (In other words, recursive
calls do not occur.) Instead, the inquiry message would be issued as if no error-handling program were
defined.
You cannot change the name of the error-handling program while it is responding to an error in a
COBOL program.
If an error occurs during the calling of the error-handling program, an informational message (LBE7430)
is issued, and processing continues as if no error-handling program were defined.
The error-handling program is defined by the user. The parameters are described under “OPM COBOL
Error-Handling Exit Program” on page 30.
Error code
I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error Code
Parameter.
Error Messages
Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
LBE7040 E Format of error code parameter is not correct.
LBE7050 E Error handler is already responding to an error in the same run unit.
LBE7051 E Scope parameter not valid.
LBE7052 E Run unit specified for error handler does not exist.
LBE7055 E Severe error while addressing parameter list.The API did not complete.
LBE7060 E Error in program name or availability.
LBE7061 E Error in library name or availability.
LBE7062 E Error in library list.
The Set COBOL Error Handler (QlnSetCobolErrorHandler) API allows you to specify the identity of a
COBOL error-handling procedure. You can call it from any ILE programming language; however, this API
only sets the procedure pointer of the error-handling program that is called when an error occurs in an
ILE COBOL/400 program.
After you call this API, any ILE COBOL/400 program that issues an inquiry message with options C, D,
or F will first call the defined error-handling procedure. This procedure receives the message
identification and substitution text, as well as the name of the program that received it, and a list of valid
1-character responses. The defined procedure is responsible for returning a 1-character code (blank, C, D,
F, or G) indicating whether the COBOL program should continue or not.
Note: All messages issued by the operating system during the running of a COBOL program are
monitored by the COBOL program. Only some of the system messages issued will result in a COBOL
inquiry message.
You can define a different error-handling procedure for each activation group.
Only one ILE error-handling procedure can be active at a time. If an error occurs in the error-handling
procedure, the COBOL program does not call the error-handling procedure again. (In other words,
recursive calls do not occur.) Instead, the inquiry message would be issued as if no error-handling
procedure were defined.
You cannot change the error-handling procedure while it is responding to an error in a COBOL program.
If an error occurs during the calling of the error-handling procedure, an informational message
(LNR7430) is issued, and processing continues as if no error-handling procedure were defined.
The error-handling procedure is defined by the user. The parameters aredescribed under “ILE COBOL
Error-Handling Exit Procedure” on page 28.
Error Messages
Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
LNR7074 E Error code not valid.
LNR7075 E Error addressing API parameters.
LNR7077 E Procedure reference not valid.
REXX/400 Functions
Exit Programs
These are the Exit Programs for this category.
This is a user-defined program that acts as an error handler for an ILE COBOL/400 program. Use the Set
COBOL Error Handler (QlnSetCobolErrorHandler) API to establish this relationship between the two
programs.
CG
CDFG
blank Issue the COBOL message that was passed to the error-handling program.
G Continue running the COBOL program.
C End the current COBOL run unit.
D Same as C, but produce a formatted dump of user-defined COBOL variables.
F Same as D, but also dump COBOL’s file-related internal variables.
Message text
INPUT; CHAR(*)
The substitution text of the message. Its length is determined by Parameter 5.
Module name
INPUT; CHAR(10)
The module within the program object that issued the error.
COBOL program name
INPUT; CHAR(256)
The name of the COBOL program, from the PROGRAM-ID paragraph, that issued the error.
This is a user-defined program that acts as an error handler for an OPM COBOL program. Use the Set
COBOL Error Handler (QLRSETCE) API to establish this relationship between the two programs.
CG
CDFG
Message text
INPUT; CHAR(*)
The substitution text of the message, its length determined by Parameter 6.
Length of passed message text
INPUT; Binary(31)
If the original message was a system message, the substitution text for the system message is
passed. In the absence of an original system message, Parameter 4 has a value of *NONE, and the
substitution text for the COBOL message is passed.
blank Issue the COBOL message that was passed to the error-handling program.
G Continue running the COBOL program.
C End the current COBOL run unit.
D Same as C, but produce a formatted dump of user-defined COBOL variables.
F Same as D, but also dump COBOL’s file-related internal variables.
Concepts
These are the concepts for this category.
Record Types
This section describes the information contained in all the different record types. Typically a compiler
writes records and an application reads them.
Names, field types and other information passed through the different record types are not validated and
no authority is checked by QLYWRTBI. The QLYWRTBI API assumes that all that validation and
checking has been done.
The following table shows the records that can be written by each compiler.
The following is true for the Library specified fields for all records and compilers:
v When *CURLIB is specified for the Library specified fields, *CURLIB is passed.
v When *LIBL is specified for the Library specified fields, or implied by not being specified, *LIBL is
passed.
Notes and restrictions are explained in the footnotes following the tables.
DDS:
CRTPF
RPG/400(R): COBOL/400(R):CLD: CRTLF CL: CMD:
Record Type Record ID
CRTRPGPGMCRTCBLPGM CRTCLD CRTDSPF CRTCLPGM CRTCMD
CRTICFF
CRTPRTF
Processor ’01’ X(1, 3) X X(1, 3) X X(1, 3, 5) X(1)
member start
Processor ’50’
object start
Normal ’20’ X X X X X(5) X
processor
end
Normal ’21’
processor
end call next
Normal ’65’
multiple end
record
Abnormal ’30’ X X X X X(5) X
processor
end
Include ’02’ X(11) X
File reference ’03’ X X X X(1, 5)
Module ’55’
reference
Service ’60’
program
reference
Bind ’75’
directory
reference
Record ’04’ X X X X(1, 5)
format
reference
Field ’05’ X(2)
reference
Message ’06’ X(2, 9) X(1, 2, 6, 9)
reference
ILE UDT:
ILE UIM: UDT:
Record Type Record ID SRVPGM: CRTMNU SYSTYPE
CRTPGM CRTPNLGRP member
CRTSRVPGM (*NONE)
Processor ’01’ X(18) X X(17) X
member start
Processor ’50’ X(16) X(19)
object start
Normal ’20’ X X X X X
processor
end
Normal ’21’ X
processor
end call next
Normal ’65’ X(19)
multiple end
record
Abnormal ’30’ X X X X X(19) X
processor
end
Include ’02’ X X X
File reference ’03’ X
Module ’55’ X X
reference
Service ’60’ X X
program
reference
Note: This record was previously called the processor start record, but the format remains the same.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Processor command
18 12 CHAR(10) Source object name specified
28 1C CHAR(10) Source library name specified
38 26 CHAR(7) Source object type
45 2D CHAR(10) Source member name specified
55 37 CHAR(10) Source object name used
65 41 CHAR(10) Source library name used
75 4B CHAR(10) Source member name used
85 55 CHAR(10) Target object name specified
95 5F CHAR(10) Target library name specified
105 69 CHAR(7) Target object type
112 70 CHAR(10) Target member name specified
122 7A CHAR(2) Reserved
Field Descriptions
Processor command. The compiler or preprocessor that wrote this record, for example, CRTRPGPGM.
Source library name used. The actual name of the library that was used. The library name could be
different from the specified library name because *LIBL or *CURLIB was specified, or an override was
used. This field contains the name the library resolves to.
Source library name specified. The library name of the source file specified on the compiler or
preprocessor command.
Source member name used. The actual name of the source member that was used. This field is required,
even if the two member names are the same.
Source member name specified. The source member name specified on the compiler or preprocessor
command.
Source object name used. The actual name of the object that was used. The object name could be
different from the specified object name if an override was used.
Source object name specified. The object name specified on the compiler or preprocessor command.
Source object type. The i5/OS(TM) type of the source object (for example, *FILE).
Target library name specified. The library of the target object specified on the compiler or preprocessor
command.
Target member name specified. The name of the member to be created, if applicable, specified on the
compiler or preprocessor command.
Target object name specified. The name of the object to be created, called the target object, specified on
the compiler or preprocessor command. The actual name of the object that was created is passed through
the Normal processor end record. (See “Normal processor end record” on page 40.)
Target object type. The i5/OS type of the object to be created (for example, *FILE).
User-defined types added with SYSTYPE(*NONE) on the ADDADMTYPE command must write this
record before any other record.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Processor command
18 12 CHAR(10) Object name specified
28 1C CHAR(10) Object library name specified
38 26 CHAR(7) Object type specified
45 2D CHAR(10) Object name used
55 37 CHAR(10) Object library name used
65 41 CHAR(7) Object type used
72 48 CHAR(10) Target object name specified
82 52 CHAR(10) Target object library name specified
92 5C CHAR(7) Target object type specified
99 63 CHAR(1) Reserved
Field Descriptions
Object library name specified. The library name of the object specified on the compiler or preprocessor
command. If the object type specified is a user-defined type with SYSTYPE(*NONE), the library name
specified should be the group library name.
Object library name used. The actual name of the library that the object was found in. The library name
could be different from the specified library name because, for example, *LIBL or *CURLIB was specified.
This field contains the name the library resolves to.
Object name specified. The object name specified on the command. If the object type specified is a
user-defined type with SYSTYPE(*NONE), the object name specified should be the part name.
Object name used. The actual name of the object that was used. The object name could be different from
the specified object name if an override was used.
Object type specified. The object type specified on the command. For user-defined types this must be left
blank. If the object type specified is a user-defined type with SYSTYPE(*NONE), the object type specified
should be the part type.
Object type used. The actual type of the object used. For example, *MODULE. For user-defined types
this can be left blank.
Processor command. The compiler or preprocessor that wrote this record, for example, CRTPGM.
Target object library name specified. The library of the target object specified on the command. For
user-defined types, the library where the output members are created, as specified on the command.
Target object name specified. The name of the object to be created, or modified as specified on the
command. For user-defined types this can be left blank.
Target object type specified. The type of the object to be created. For example, *PGM. The actual name of
the object that was created is passed through the Normal processor end record. (See “Normal processor
end record.”) For user-defined types, the names of the output members are passed through the Normal
multiple end record. For user-defined types this value must be *MBR.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Object name created
18 12 CHAR(10) Library
28 1C CHAR(7) Object type
35 23 CHAR(10) Member
45 2D CHAR(7) Message identifier
Field Descriptions
Library name. The library where the object was created.
Object name created. The object created by the compiler or preprocessor. If an object is not created, this
field stores the value of ’*NONE’.
The Normal processor end call next record has the following format:
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Object name
18 12 CHAR(10) Library name
28 1C CHAR(7) Object type
35 23 CHAR(10) Member name
45 2D CHAR(7) Message identifier
Field Descriptions
Library name. The library where the object was created.
Note: It is possible that the processor generated 10 members on the last build, and because of a change,
now needs to regenerate just 2 of those members. For the build process to preserve the relationships to
the remaining 8 members, the processor must write all members to the API, regardless of whether the
member was actually regenerated. The build process ignores those parts (members) that have either not
changed (because the processor did not regenerate them), or do not exist (because the processor did not
generate them, and they may exist higher in the hierarchy).
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Library
18 12 CHAR(10) File name created
28 1C CHAR(10) Member
38 26 CHAR(32) Part type
70 46 CHAR(32) Part language
102 66 CHAR(22) Reserved
Field Descriptions
File name created. The file name that was created or used to hold the member.
If the command failed because an external reference to a file, message file, module, bind directory or
service program could not be found, the command passes the External reference error record before
passing this one. See “External reference error record” on page 52 for more information on this record.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(7) Message identifier
15 F CHAR(1) Reserved
Field Descriptions
Message identifier. The message identification of the completion message.
Include record
This record is passed when the compiler or preprocessor processes an include. An include statement is a
statement that causes the compiler to replace the include statement with the contents of the specified
header or file. If the include is not found, the compiler or preprocessor passes the Abnormal processor
end record.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 BINARY(4) Nesting level
12 C CHAR(10) Include file name specified
22 16 CHAR(10) Include file library name specified
32 20 CHAR(10) Include file member name specified
Field Descriptions
Include file used. The actual name of the include file that was used. For example, the default include file
used by the compiler and implied in the source, or the file different from the one specified in the source
as a result of an override. This name must always be filled in.
Include file specified. The name of the file that contains the include. This is the name specified in the
source (if the include was file qualified), otherwise it is blank.
Include file library used. The name of the actual library that contains the include file that was used (for
example, a specific library name instead of *CURLIB or *LIBL, as specified in the source, or a library
different from the one specified in the source, as a result of an override).
Include file library specified. The name of the library where the include file resides, as specified in the
source (if the include was library qualified), otherwise it is blank.
Include file member used. The actual name of the source member containing the include that was used.
This name must always be filled in.
Include file member specified. The name of the source member containing the include, as specified in
the source.
Nesting level. The level of nesting of the include. Includes found in the root source have a nesting level
of 1, includes found in level 1 have a nesting level of 2 and so on.
Object type. The object type of the object containing the include, for example *FILE.
The nesting level should be indicated even by those compilers that do not allow include nesting. In that
case, the nesting level passed should be equal to 1.
For example, a reference is made in DDS source using the PFILE or JFILE keywords. Another example is
when a compiler or preprocessor copies all the record format declares from a file. This is not considered
to be a dependency on any specific record format and is treated as a dependency on the file, so this
record must be passed, not the Record format reference records for all the individual record formats.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) File name specified
18 12 CHAR(10) File library name specified
28 1C CHAR(1) Based on indicator
29 1D CHAR(10) File name used
39 27 CHAR(10) File library name used
49 31 CHAR(3) Reserved
52 34 BINARY(4) Nesting level
Field Descriptions
Based on indicator. Indicates whether the referenced file is used to base another file on. Possible values
are N (no) and Y (yes).
File name used. The name of the actual file that was referenced. This name must always be filled in.
File name specified. The name of the file referenced, as specified in the source.
File library name used. The name of the actual library that contains the file that was referenced. The
library name could be different from the specified library name because *LIBL or *CURLIB was specified,
or an override was used.
File library name specified. The name of the library of the file referenced, as specified in the source.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Module name specified
18 12 CHAR(10) Module library name specified
28 1C CHAR(10) Module name used
38 26 CHAR(10) Module library name used
Field Descriptions
Module name used. The name of the actual module that was referenced. This name must always be
filled in.
Module name specified. The name of the module referenced, as specified on the command, or in the
bind directory.
Module library name used. The name of the actual library that contains the module that was referenced.
The library name could be different from the specified library name because *LIBL or *CURLIB was
specified.
Module library name specified. The name of the library of the module referenced, as specified on the
command, or in the bind directory.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Service program name specified
18 12 CHAR(10) Service program library name specified
28 1C CHAR(10) Service program name used
38 26 CHAR(10) Service program library name used
48 30 CHAR(16) Service program signature used
Field Descriptions
Record length. The length of this record is 64.
Service program name used. The name of the actual service program that was referenced. This name
must always be filled in.
Service program name specified. The name of the service program as specified on the command.
Service program library name used. The name of the actual library that contains the service program
that was referenced. The library name could be different from the specified library name because *LIBL or
*CURLIB was specified.
Service program library name specified. The name of the library of the service program referenced, as
specified on the command.
Service program signature used. The current signature of the service program used.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
Field Descriptions
Bind directory name used. The name of the actual bind directory that was referenced. This name must
always be filled in.
Bind directory name specified. The name of the bind directory referenced, as specified on the command.
Bind directory library name used. The name of the actual library that contains the bind directory that
was referenced. The library name could be different from the specified library name because *LIBL or
*CURLIB was specified.
Bind directory library name specified. The name of the library of the bind directory referenced, as
specified on the command.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) File name specified
18 12 CHAR(10) File library name specified
28 1C CHAR(10) Record format name
38 26 CHAR(13) Record format level ID
Field Descriptions
File name used. The name of the actual file that was referenced. This name must always be filled in.
File name specified. The name of the file being referenced, as specified in the source.
File library name used. The name of the actual library that contains the file that was referenced. The
library name could be different from the specified library name because *LIBL or *CURLIB was specified,
or an override was used. This field contains the name the library resolves to.
File library name specified. The name of the library of the file being referenced, as specified in the
source.
Nesting level. If this record format reference is made within an include, this field has value of N + 1,
where N is the nesting level of the include. Otherwise, the value of this field is 1.
Record format level ID. The level ID of the record format referenced.
Field Descriptions
Data type. The field data type in DDS. For example, P, S, B, F, A, or H.
Decimal positions. The number of decimal positions if the field is numeric, otherwise 0.
Field length. The length of the field in bytes. If the field is a variable-length field, the maximum length
should be passed.
File name used. The name of the actual file that was referenced. This name must always be filled in.
File name specified. The name of the file being referenced, as specified in the source.
Fixed/variable length indicator. Contains F if the field is of fixed length, or V if variable length.
File library name used. The name of the actual library that contains the file that was referenced.
File library name specified. The name of the library of the file being referenced, as specified in the
source.
Record format level ID. The level ID of the record format referenced.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(7) Message identifier
15 F CHAR(10) Message file name specified
25 19 CHAR(10) Message file library name specified
35 23 CHAR(10) Message file name used
45 2D CHAR(10) Message file library name used
55 37 CHAR(1) Reserved
56 38 BINARY(4) Nesting Level
Field Descriptions
Message file library used. The name of the actual library that contains the message file. This may be
*CURLIB or *LIBL if the compiler does not resolve to the library name.
Message file library specified. The name of the library that contains the message file, as specified in the
source.
Message file name used. The name of the actual message file that was referenced. This name must
always be filled in.
Message file name specified. The name of the message file referenced, as specified in the source.
After passing one or more of these records, the compiler or preprocessor also passes the Abnormal
processor end record (see “Abnormal processor end record” on page 43).
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Object name specified
18 12 CHAR(10) Object library name specified
28 1C CHAR(7) Object type
35 23 CHAR(10) Object name used
45 2D CHAR(10) Object library name used
55 37 CHAR(1) Based on indicator
Field Descriptions
Based on indicator. Whether the referenced file is used to base another file on. Possible values are N (no)
and Y (yes). This field is used by the CRTLF processor.
Object library name used. The actual name of the library that contains the object that was referenced.
Object library name specified. The name of the library that contains the object that was not found.
Object name specified. The name of the object referenced that was not found.
After passing this record, the compiler or preprocessor must also pass the Abnormal processor end record
(see “Abnormal processor end record” on page 43).
The Object already exists error record has the following format:
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) Object name that already exists
18 12 CHAR(10) Object library name
28 1C CHAR(7) Object type
35 23 CHAR(1) Reserved
Field Descriptions
Object library name. The name of the library that contains the object that already exists. A specific
library name, not *CURLIB or *LIBL must be passed.
Object name that already exists. The name of the object that already exists and could not be replaced.
Offset
Dec Hex Type Field
0 0 BINARY(4) Record length
4 4 CHAR(2) Record type
6 6 CHAR(2) Reserved
8 8 CHAR(10) New program name
18 12 CHAR(10) Object name created
28 1C CHAR(10) Object library name
38 26 CHAR(7) Message identifier
45 2D CHAR(3) Reserved
48 30 CHAR(7) Object type
55 37 CHAR(1) Reserved
Field Descriptions
Message identifier. The message ID of the completion message.
New program name. The name of the new program, per IDENTIFICATION DIVISION.
Object library name. The library where the object was created. This field contains blank if an error
occurred.
Object name created. The name of the object created in the previous step. If an object was not created
because of syntax errors or because REPLACE(*NO) was specified and the object already existed, this
field contains ’*ERROR’.
Object type. The type of object created. For example, *PGM or *MODULE.
It is also assumed that a cleanup is done after the compile by calling QLYSETS again to set the status of
the space to *COMPLETE.
Example 1
RPG/400(R) compiler successfully compiles source that has one include in it.
The compiler first calls QLYGETS and determines that it was started by the BLDPART command. Then it
calls QLYWRTBI to pass records of the following record types and in the following order:
1. Processor member start
2. Include
3. Normal processor end
Example 2
DDS compiler successfully compiles source of type LF and creates a logical file based on two physical
files.
The compiler first calls QLYGETS and determines that it was started by the BLDPART command. Then it
calls QLYWRTBI to pass records of the following record types and in the following order:
1. Processor member start
2. File reference
This record is called for the first physical file on which the logical file is based. The based-on indicator
is set to Y (yes).
3. File reference
This record is called for the second physical file on which the logical file is based. The based-on
indicator is set to Y (yes).
4. Normal processor end
Example 3
COBOL/400(R) compiler fails when compiling source that has one include in it because the include was
not found in *LIBL.
The compiler first calls QLYGETS and determines that it was started by a BLDPART command. Then it
calls QLYWRTBI to pass records of the following record types and in the following order:
1. Processor member start
2. Abnormal processor end
Example 4
COBOL/400 compiler fails when compiling source that references a record format of a database file
because the file was not found in *LIBL.
The compiler first calls QLYGETS and determines that it was started by a BLDPART command. Then it
calls QLYWRTBI to pass records of the following record types and in the following order:
1. Processor member start
Example 5
ILE C CRTBNDC compiler successfully compiles a *PGM from a source that has one include in it.
The compiler calls QLYGETS and determines that it was started by the BLDPART command. Then it calls
QLYWRTBI to pass records of the following record types and in the following order:
1. Processor member start
2. Include
3. Normal processor end call next
4. Processor object start
5. Normal processor end
Note: The Processor object start and the Normal processor end records are written by the CRTPGM
processor internally called by the CRTBNDC compiler.
Example 6
CRTPGM binder successfully binds objects from 2 modules, and references a bind directory and a service
program.
The compiler calls QLYGETS and determines that it was started by the BLDPART command. Then it calls
QLYWRTBI to pass records of the following record types and in the following order:
1. Processor object start
2. Module reference
3. Module reference
4. Bind directory reference
5. Service program reference
6. Normal processor end.
Table 1. Compilers and preprocessors that can be used with the Application Development
Manager/400 feature
ILE CL No
ILE C Yes
CRTPF, CRTLF, CRTDSPF, CRTPRTF, Not applicable
CRTICFF
CL CRTCLPGM Yes
CLD CRTCLD Yes
CMD CRTCMD Not applicable
CRTSQLRPG, CRTSQLCBL, Yes
CRTSQLCI
CRTSQLRPGI, CRTSQLCBLI No
CRTSRVPGM CRTSRVPGM Yes
CRTPGM CRTPGM Yes
MENU CRTMNU TYPE(*UIM) Not applicable
PNLGRP CRTPNLGRP Not applicable
Notes:
1. Default command is used by the BLDPART command.
2. Appropriate default compiler command is used based on the part type and the language.
The following diagram shows the proper usage and order in which the APIs should be called.
The following table describes the API space status values that can be received by calling the QLYGETS
API, and the action that should be taken by the application or compiler that is calling the API.
Compilers use the APIs to write to the space. Applications use the APIs to read from the space.
Note: Unpredictable results can occur when the APIs are not properly used or are used in the incorrect
order.
Calling multiple API-supporting compilers simultaneously in a single interactive session (one possible
way of doing this is by pressing the Attention key and then command key F9 to get to the command
line) may cause unpredictable results. The compiler can fail, for example, or incorrect or incomplete
information can be put in the work space.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program,
or service that does not infringe any IBM intellectual property right may be used instead. However, it is
the user’s responsibility to evaluate and verify the operation of any non-IBM product, program, or
service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can send
license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some
states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this
statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
Such information may be available, subject to appropriate terms and conditions, including in some cases,
payment of a fee.
The licensed program described in this information and all licensed material available for it are provided
by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement,
IBM License Agreement for Machine Code, or any equivalent agreement between us.
Any performance data contained herein was determined in a controlled environment. Therefore, the
results obtained in other operating environments may vary significantly. Some measurements may have
been made on development-level systems and there is no guarantee that these measurements will be the
same on generally available systems. Furthermore, some measurements may have been estimated through
extrapolation. Actual results may vary. Users of this document should verify the applicable data for their
specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs
in any form without payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for
which the sample programs are written. These examples have not been thoroughly tested under all
conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs.
Each copy or any portion of these sample programs or any derivative work, must include a copyright
notice as follows:
(C) IBM 2006. Portions of this code are derived from IBM Corp. Sample Programs. (C) Copyright IBM
Corp. 1998, 2006. All rights reserved.
If you are viewing this information softcopy, the photographs and color illustrations may not appear.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Appendix. Notices 63
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other
countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other company, product, and service names may be trademarks or service marks of others.
Personal Use: You may reproduce these Publications for your personal, noncommercial use provided that
all proprietary notices are preserved. You may not distribute, display or make derivative works of these
Publications, or any portion thereof, without the express consent of IBM.
Commercial Use: You may reproduce, distribute and display these Publications solely within your
enterprise provided that all proprietary notices are preserved. You may not make derivative works of
these Publications, or reproduce, distribute or display these Publications or any portion thereof outside
your enterprise, without the express consent of IBM.
Except as expressly granted in this permission, no other permissions, licenses or rights are granted, either
express or implied, to the Publications or any information, data, software or other intellectual property
contained therein.
IBM reserves the right to withdraw the permissions granted herein whenever, in its discretion, the use of
the Publications is detrimental to its interest or, as determined by IBM, the above instructions are not
being properly followed.
You may not download, export or re-export this information except in full compliance with all applicable
laws and regulations, including all United States export laws and regulations. IBM MAKES NO
GUARANTEE ABOUT THE CONTENT OF THESE PUBLICATIONS. THE PUBLICATIONS ARE
PROVIDED ″AS-IS″ AND WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY,
NON-INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE
Printed in USA