When an Entry is generated one of the attributes of the Entry prompted on the "Generate Entry" display is the "PGM data retrieval". By default this attribute contains "*DBMS400". If a data retrieval program must be generated this value must be changed to the name of the program. Another possibility is to change this attribute after the Entry is generated (using option "2=Change" on the "Work with Entries" panel.
The programs can be generated by using option "25=Generate Data retrieval" on the "Work with Entries" panel. If Enter is pressed with option 25 then the default program generator is used with the default generation options. If option 25 is used in conjunction with the function key "F4=Prompt" the "Generate Program 'Data retrieval'" display is prompted where the program generator and other generation options can be changed. The default settings are determined by the choices registered with the "Work with User options GENPGMDTA" from the "User options" menu in "ITP management".
There are currently three program generators present in the ITP/SDK for iSeries:
1. |
GENDTA.RPG |
Generator for RPG programs. |
2. |
GENDTA.CBL |
Generator for COBOL programs. Warning Beware this generator does not include the functionality Key selection in the program. |
3. |
GENDTA.C |
Generator for ILE C programs. |
These generators are all programs located in the program library of the SDK. The generators write the source of programs in a source physical file in the Source library of the current DID-source, and then call the appropriate compiler to create the programs in the Object library of the current DID-source.
The source physical files where the programs will be written to are:
1. |
GENDTA.RPG |
QRPGSRC |
2. |
GENDTA.CBL |
QLBLSRC |
3. |
GENDTA.C |
QCLESRC |
The names of these source physical files cannot be changed. The files (together with the source physical file QDDSSRC) are automatically created in the Source library of the DID-source when the DID-source is created.
Note
ITP does not guarantee correct and compilable programs to be generated. For instance in RPG a file to access cannot have a name with a length of more than eight characters, where DB2 UDB for iSeries does allow file names with a length of up to ten characters. If such a limit of the generators is encountered the source of the incorrect program must be manually changed and compiled to create the program.
After the source of the programs is generated the appropriate compiler is called to create the programs in the Object library of the current DID-source. The compilers are called by a CL program per generator with certain compiler options set explicitly, while other compiler options are default:
1. |
GENDTA.RPG |
DCRTRPGPGM |
CRTRPGPGM with explicit options CVTOPT(*DATETIME *VARCHAR) ALWNULL(*YES) |
2. |
GENDTA.CBL |
DCRTCBLPGM |
CRTCBLPGM with explicit options CVTOPT(*VARCHAR *DATETIME) |
3. |
GENDTA.C |
DCRTBNDC |
CRTBNDC with explicit options OUTPUT(*PRINT) OPTIMIZE(*FULL) LANGLVL(*EXTENDED) REPLACE(*YES) |
To change the compiler options or even the calling of the compiler itself, the sources of these CL programs may be retrieved and changed.
Do not change the program interface, make sure that the CL creates a callable program (no module or service program), and let the CL program be library list neutral (i.e. leave the library list as it was before calling the program).