PCML program tag

The PCML program tag can be expanded with the following elements.

<program name="name"
    [ entrypoint="entry-point-name" ]
    [ epccsid="ccsid" ]
    [ path="path-name" ]
    [ parseorder="name-list" ]
    [ returnvalue="{ void | integer }" ]
    [ threadsafe="{ true | false }" ]>
</program>

The following table lists the program tag attributes. Each entry includes the attribute name, the possible valid values, and a description of the attribute.

Attribute Value Description
entrypoint= entry-point-name Specifies the name of the entry point within a service program object that is the target of this program call.
epccsid= ccsid Specifies the CCSID of the entry point within a service program. For more information, see the service program entry notes in the ServiceProgramCall javadoc.
name= name Specifies the name of the program.
path= path-name Specifies the path to the program object. The default value is to assume the program is in the QSYS library.

The path must be a valid integrated file system path name to a *PGM or *SRVPGM object. If a *SRVPGM object is called, the entrypoint attribute must be specified to indicate the name of the entrypoint to be called.

If the entrypoint attribute is not specified, the default value for this attribute is assumed to be a *PGM object from the QSYS library. If the entrypoint attribute is specified, the default value for this attribute is assumed to be a *SRVPGM object in the QSYS library.

The path name must be specified as all uppercase characters.

Do not use the path attribute when the application needs to set the path at run time, for example, when a user specifies what library is used for the install. In this case, use the ProgramCallDocument.setPath() method.

parseorder= name-list Specifies 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.

Some programs return information in one parameter that describes information in a previous parameter. For example, assume a program returns an array of structures in the first parameter and the number of entries in the array in the second parameter. In this case, the second parameter must be processed in order for the ProgramCallDocument to determine the number of structures to process in the first parameter.

returnvalue= void The program does not return a value.

integer The program returns a 4-byte signed integer.

Specifies the type of value, if any, that is returned from a service program call. This attribute is not allowed for *PGM object calls.
threadsafe=

true The program is considered to be thread-safe.

false The program is not thread-safe.

When you call a Java™ program and an iSeries™ program that are on the same server, use this property 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.