Add program

Use the Add Program page in the Program Call wizard to define the program object or service program object that you want to call. You can find more information about each field in the IBM Toolbox for Java information under PCML program tag.

Option Description
Java bean name The name for the generated class for this program object. It must be a valid Java class name.
Program object The name of a program object or a service program object. It must be a valid iSeries object name. Click Browse and connect to an iSeries server to look up the program object that you want to call. See Browse for Object for more details.
Library The name of the library that contains the program object. It must be a valid iSeries library name. You can also select the following from the drop-down list: *LIBL if the library that contains the program object is your library list, or *CURLIB if the library that contains the program object is your current library. The resulting path will be /QSYS.LIB/%LIBL%/programName.pgm.
Program type *PGM if the object is a program object, or *SRVPGM if the object is a service program object. The default value is *PGM.
Entry point The name of the procedure or function within a service program object. The target of this program call, to be supplied if the object is a service program object. You can click Browse to display the Browse For Procedure dialog. It will list all the service programs in the selected library, and you can select a procedure. If a library is already specified in the Library field, then the library will be added automatically to the dialog as a library filter. If a program object is already specified in Program object field, then that program object will be automatically highlighted when the dialog comes up. If the selected procedure is different from the specified program object, it will overwrite the original values.
CCSID of entry point The CCSID of the entry point within a service program. For more information, see the service program entry notes in the ServiceProgramCall javadoc.
Return type The type of value, if any, that is returned from a service program call. Only *SRVPGM objects can have a return type.
void:
The program does not return a value.
integer:
The program returns a 4-byte signed integer.

The default value is void.

void and integer are the only valid return types. The only way to have the service program return other data types is to specify an output parameter, or an input & output parameter, using Add parameter.

Parse order The order in which output parameters will be processed. The value specified is a blank separated list of parameter names in the order in which the parameters are to be processed. The names in the list must be identical to the names specified on the name attribute of tags belonging to the program. The default value is to process output parameters in the order the tags appear in the document.
Thread safe When you call a Java program and an iSeries program that are on the same server, use this field to specify whether you want to call the iSeries program in the same job and on the same thread as the Java program. If you know your program is thread-safe, setting the property to true results in better performance.

To keep the environment safe, the default is to call programs in separate server jobs. The default value is false.

Source location If you want to view the program source to determine program or parameter attributes, specify where to browse: Click View to see the source.
Note: In order to remotely call a service program object or procedure, you must meet the following requirements:
  • The service program must be on an iSeries or AS/400e server running OS/400 V4R4 or later.
  • You can pass no more than seven parameters to the service program.
  • The return value of the service program is void or a 4-byte signed integer.

After adding a program, you can define its parameters using Add Parameter.

Browse for Object

Allows you to select an object in the iSeries native libraries.

  1. If you have not defined a connection to your iSeries server, expand New Connection to define a connection; otherwise expand the connection that you want to browse for an object.
  2. If you want to browse for a program object from your logon profile library list, expand *LIBL; otherwise expand Your libraries to create a new library filtering string.
  3. Expand the library that you want to browse.
  4. Select a program or service program object.
  5. Click OK.
    • The Program object field populates with the name of the object that you select.
    • The Library field is populated with the library name.
    • The Program type field is set to either *PGM or *SRVPGM.

Browse iSeries native files

Allows you to select a file in the iSeries native libraries.

  1. If you have not defined a connection to your iSeries server, expand New Connection to define a connection; otherwise, expand the connection that you want to browse for a file.
  2. If you want to browse for a file from your logon profile library list, expand *LIBL; otherwise, expand Your libraries to create a new library filter string.
  3. Expand the library that you want to browse.
  4. Expand a source physical file.
  5. Select a source file.
  6. Click OK.
    • The Source location field of the Add Program page shows the name of the source file.
  7. Click View to view the source listing.

Browse iSeries IFS

Allows you to select a file in the iSeries integrated file system or a local file system.

  1. If you want to browse for a file from your local file system, expand Local and select a file.
  2. If you want to browse for a file from the IFS, then define a connection to your iSeries server by expanding New Connection, or expand an already defined connection and select a file.
  3. Click OK.
    • The Source location field of the Add Program page shows the name of the source file.
  4. Click View to view the source listing.

Browse workspace

Allows you to select a file from your IDE workspace.

  1. Select the file that you want to view.
  2. Click OK. The Source location field of the Add Program page shows the full path name of the file.
  3. Click View to view the file.
Related tasks
Calling an iSeries program from your Java application