Set Program Information (SETPGMINF)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Set Program Information (SETPGMINF) command is used with the extended program model (EPM) languages to associate all the program objects in an application. The SETPGMINF command defines the application environment, based on the information you supply on the ROOTPGM, SUBPGM, and LIBFILE parameters. The C/400*, FORTRAN/400*, and Pascal languages work within the extended program model.

EPM programs that refer to external symbols in other EPM programs must be specified on the SETPGMINF command. External symbols are calls to other compilation units or external storage. You do not need to use this command if your program consists of only one compilation unit, or if the program calls only non-EPM programs. If the programs you specify on the ROOTPGM and SUBPGM parameters have not been successfully compiled, SETPGMINF fails.

Error messages for SETPGMINF

*ESCAPE Messages

PSE4017
Errors occurred in SETPGMINF command.
Top

Parameters

Keyword Description Choices Notes
ROOTPGM Root program Qualified object name Required, Positional 1
Qualifier 1: Root program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
SUBPGM Sub-programs Values (up to 200 repetitions): Element list Optional, Positional 2
Element 1: Program Qualified object name
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
LIBFILE Library information files Values (up to 16 repetitions): Element list Optional, Positional 3
Element 1: File Qualified object name
Qualifier 1: File Name, *SAME, *NONE, *PASLIB, *FTNLIB, *CLIB
Qualifier 2: Library Name, *LIBL, *CURLIB
LISTDETAIL Listing detail *NONE, *BASIC, *FULL Optional
PRTFILE Print file Qualified object name Optional
Qualifier 1: Print file Name, QSYSPRT
Qualifier 2: Library Name, *LIBL, *CURLIB
RUNATTR Run attributes Element list Optional
Element 1: Maximum non-fatal errors 0-100, 20, *NOMAX
Element 2: Fatal error severity 0-40, 40
Element 3: External Type Checking *YES, *NO
Element 4: Computational Attributes *LANG, *ALL, *NONE
PFROPT Performance options Element list Optional
Element 1: Access group storage *NONE, *ALL
HEAPSIZE Initial size of heap spaces Element list Optional
Element 1: Dynamic storage heap 1024-16777216, 16000, *NONE
Element 2: Static storage heap 1024-16777216, 32000
STACKSIZE Initial size of auto storage Element list Optional
Element 1: 1024-16777216, 16000
SSNATTR Session file attributes Element list Optional
Element 1: File size 8192-16000000, 32000
Element 2: Buffer size 80-1024, 160
DBGOPT Debug options Element list Optional
Element 1: Debug initialization *ON, *OFF
Top

Root program (ROOTPGM)

Specifies the name of the program which will contain the environment definition necessary to create the EPM run-time environment. This program, called a default entry point or root program, contains the references to external symbols. In C, the default entry point is usually the program that contains a main() function. Pascal defines the main begin block of the program unit as the default entry point. FORTRAN defines the main program (the program defined on the PROGRAM statement) as the default entry point. *Change authority is required.

ROOTPGM is a required parameter.

program-name
The name of the EPM program object that contains the default entry point.

Possible library values are:

*LIBL
The system searches the library list for the root program object.
*CURLIB
The current library is searched. If you have not specified the current library, QGPL is used.
library-name
Enter the name of the library where the root program object is located.
Top

Sub-programs (SUBPGM)

Specifies a list of all the program objects that you want to include in the run-time environment for your application. These programs can be either EPM or non-EPM program objects.

Up to 200 program objects can be specified on the SUBPGM parameter. You can specify more than 200 related program objects for 1 application if you nest SETPGMINF commands.

program-name
Enter the name of the program object. You can specify up to 200 program objects on one SETPGMINF command.

Possible library values are:

*LIBL
The system searches the library list for the library containing the program objects.
*CURLIB
The name of the current library is used. If you have not specified the current library, QGPL is used.
library-name
Enter the name of the library where the program object is located.

These SUBPGMs are sought at run-time, according to the library specifications used when you specify the SETPGMINF command. If you specify a specific library, or use *CURLIB, only that specific library is searched for the program object. If the library designated as the current library changes between the time you issue the SETPGMINF command and the time you run your program, not all of the program objects will be found and you will receive an error message.

Top

Library information files (LIBFILE)

Specifies the library information file that contains information used to resolve any outstanding external references after all of the program objects identified on the ROOTPGM and SUBPGM parameters have been processed. Library information files are searched in the order that they are specified.

Several library information files are IBM-supplied. These files contain the EPM language library functions.

You can create and update your own library information file with the Extract Program Information (EXTPGMINF) command.

*SAME
Use the same library information file as was used in the last environment definition. If this is the first time an environment is defined, the run-time library file for the language object specified on the ROOTPGM parameter is used. For example, if your ROOTPGM was compiled using the C/400 compiler, the default library information file is *CLIB.
*NONE
No library information file is used.
*PASLIB
The Pascal run-time library information file is used.
*CLIB
The C/400 run-time library information file is used.
*FTNLIB
The FORTRAN/400 run-time library information file is used.
file-name
Enter the name of the library information file. This library information file must exist. To create a library information file, use the EXTPGMINF command.

The possible library values are:

*LIBL
The system searches the library list for the specified library information file.
*CURLIB
The current library is used to locate the library information file. If you have not specified the current library, QGPL is used.
library-name
Enter the name of the library that contains the library information file.
Top

Listing detail (LISTDETAIL)

Specifies whether a SETPGMINF listing is created. The listing will have the same name as the program specified on the ROOTPGM parameter and is directed to the library and file specified on the PRTFILE parameter.

The PRTFILE parameter is not displayed unless you request a listing (*BASIC or *FULL) on the LISTDETAIL parameter.

*NONE
A listing is not created.
*BASIC
A listing is created that includes all of the symbol references and definitions that result from the programs specified on the ROOTPGM and SUBPGM parameters.
*FULL
A listing is created that includes all of the symbol references and definitions for the entire application. This includes the symbol references and definitions for all the programs specified on the LIBFILE parameter that are not explicitly referenced in your application.
Top

Print file (PRTFILE)

Specifies the name and library of the printer file where the SETPGMINF listing is directed. The file should have a minimum length of 132. If you specify a file with a record length of less than 132, information may be lost.

This parameter does not appear on the prompting display unless you change the default value on the LISTDETAIL parameter to *BASIC or *FULL.

QSYSPRT
The SETPGMINF listing is placed in the file QSYSPRT.
file-name
Enter the name of the file where the SETPGMINF listing is to be placed.

The possible library values are:

*LIBL
The system searches the library list.
*CURLIB
The name of the current library is used. If you have not specified the current library, QGPL is used.
library-name
Enter the name of the library where the file is stored.
Top

Run attributes (RUNATTR)

Specifies the number of times the non-fatal error counter is incremented before processing ends, and the message severity-level that is interpreted as a fatal error at run-time. A fatal error is an error that stops your application from running. You can also specify whether you want external type checking to take place at program run-time. The computational attributes field allows you to set the attributes for controlling floating point operations in the run-time environment.

20
The non-fatal error counter is incremented up to 20 times before the processing of your application ends.
*NOMAX
The non-fatal error counter has no limit and will not stop the processing of your application.
counter-number
The number of non-fatal errors that are allowed before processing ends.
40
A message with a severity-level of 40 or higher is interpreted as a fatal error.
severity-level
The message severity-level that is interpreted as a fatal error. If a severity-level of 0 is specified, your application stops running if any errors occur.
*YES
External type checking is performed at program run-time.
*NO
External type checking is not performed at program run-time. Any warning messages that occur as a result of checking errors are not issued when you run your program.
*LANG
Computational attributes are set according to the semantics of the EPM language.
*ALL
Floating point exceptions are disabled or masked.
*NONE
Floating point exceptions are enabled or unmasked.
Top

Performance options (PFROPT)

Specifies whether the space allocated for static, automatic, and dynamic program variables is part of the process access group.

*NONE
The storage spaces created are not part of the process access group (PAG).
*ALL
The storage spaces created are part of the process access group (PAG). This option can improve the performance of programs that use limited program variable storage, and are run on a non-dedicated system. Information on performance tools and CL commands you can use to display and analyze the PAG can be found in the Performance Tools Guide.
Top

Initial size of heap spaces (HEAPSIZE)

Specifies the initial size of the heap spaces for the dynamic and static storage heap. The heap size specified will expand as your application progresses.

The dynamic storage heap consists of the storage that you have allocated in your application with the C/400 memory routines (malloc, calloc, realloc) or the NEW procedure in Pascal.

The static storage heap consists of the storage that you have allocated in your application with static and external static variables.

16000
The initial size of the dynamic storage heap is 16000 bytes.
*NONE
No initial dynamic storage is allocated. Use *NONE only if you do not use any EPM memory management functions in your application. If you specify *NONE and use any of the memory functions, you will get pointer exceptions and your application will stop processing.
dynamic-storage-size
Enter the initial size of the dynamic storage heap. The initial size can be between 1024 and 16777216 bytes.
32000
The initial size of the static storage heap is 32000 bytes.
static-storage-size
Enter the initial size of the static storage heap. The initial size can be between 1024 and 16777216 bytes. If you use static variables extensively in your application your performance can improve if you specify a larger storage heap than the default.
Top

Initial size of auto storage (STACKSIZE)

Specifies the initial size of the automatic storage stack. The stack size specified will expand as your application progresses.

The automatic storage stack consists of the storage that you have allocated in your application with automatic variables.

16000
The initial size of the automatic storage stack is 16000 bytes.
automatic-storage-size
Enter the initial size of the automatic storage stack. The initial size can be between 1024 and 16777216 bytes. If your application contains a large number of recursive calls, you should increase the initial size of the stack.
Top

Session file attributes (SSNATTR)

Specifies the file session attributes for the file and buffer size.

32000
The default size for the file is 32000 bytes.
file-size
Specify a value for the file size between 8192 and 16000000 bytes. If your file exceeds the size you specify, the information at the top rolls off the display. This information is lost.
160
The default size for the buffer is 160 bytes.
buffer-size
Specify a value for the buffer size between 80 and 1024 bytes.
Top

Debug options (DBGOPT)

Specifies the use of the extended program model (EPM) debug tool at run-time, if server debug mode is active. To activate server debug mode, enter the STRDBG command.

*ON
EPM debug starts at run-time if server debug mode is active.
*OFF
EPM debug will not start at run-time. You can use server debug to debug your programs, but EPM language variable names, statement numbers, and debugging commands are not available.
Top

Examples

None
Top

Error messages

*ESCAPE Messages

PSE4017
Errors occurred in SETPGMINF command.
Top