Using the Command Line to Invoke Application Engine Programs

You might invoke an Application Engine program through the command line to:

  • Restart

    When a program abends, a system administrator might restart the program using the command line. If needed, you can locate all of the specific program and process information from Process Monitor in the Process Request Detail dialog box. Normally, users or system administrators perform a restart from the Process Monitor.

  • Develop or test

    Many developers include the command line in a batch file to launch a program they are developing or testing. This way, they can quickly run the batch file as needed. This method also enables separation of development of the application program from its associated pages.

  • Debug

    To debug a program running on the server, you can sign into the server (using telnet, for example) and invoke the program from the command line.

To start an Application Engine program from the command line, you must specify the Application Engine executable (PSAE.EXE) followed by the required parameters, as shown in this example:


            psae -CT dbtype -CS server -CD database_name -CO oprid -CP oprpswd
 -R run_control_id -AI program_id -I process_instance -DEBUG (Y|N)
 -DR (Y|N) -TRACE <trace> value -DBFLAGS<flags> value -<TOOLSTRACESQL> value
 -TOOLSTRACEPC value -OT outtype -OF outformat -FP filepath

Or, if your command line options are stored in a text file, you can enter:


            psae optfilename

Note:

For Microsoft Windows and UNIX servers, you must set the PS_SERVER_CFG environment variable before you invoke an Application Engine program from the command line. PS_SERVER_CFG must contain the fully qualified name of a correctly configured Process Scheduler PSPRCS.CFG file. When Application Engine runs from the command line, it resolves %PS_SERVDIR% to the value of the environment variable PS_SERVDIR instead of the parent directory of a Process Scheduler configuration.

For PeopleTools 8.62 and later versions, in certain scenarios, PSAE may require the following Java options. By default, these options are available in the PSPRCS.CFG file. If this file does not exist on the client system, then the required Java options must be explicitly defined as environment variables in the command line when running the Application Engine program.

Set JAVA_TOOL_OPTIONS=--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED  --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.net.www=ALL-UNNAMED --add-opens=java.base/sun.net=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/sun.security.pkcs10=ALL-UNNAMED --add-opens=java.base/sun.security.pkcs=ALL-UNNAMED

Command Line Options

Field or Control Description

-CT

Specify the type of database to which you are connecting. Values are ORACLE, MSSQL (Microsoft SQL Server), and DB2ODBC (Db2 for z/OS).

-CS

For platforms that require a server name as part of their sign-on, enter the appropriate server name. This option affects Microsoft SQL Server. However, for Microsoft SQL Server, this option is valid but not required.

-CD

Enter the name of the database to which the program will connect.

-CO

Enter the user ID of the person who is running the program.

-CP

Enter the password associated with the specified user ID.

Note: Password may also be passed in encrypted form.

-R

Enter the run control ID to use for this run of the program.

-AI

Specify the Application Engine program to run.

-I

Required for restart, enter the process instance for the program run. The default is 0, which means Application Engine uses the next available process instance.

-DEBUG

This parameter controls the Debug utility. Enter Y to indicate that you want the program to run in debugging mode or enter N to indicate that you do not.

-DR

This parameter controls restart disabling. Enter Y to disable restart or enter N to enable restart.

-TRACE

To enable tracing from the command line, enter this parameter and a specific trace value. The value you enter is the sum of the specific traces that you want to enable. Traces and values are:

1: Initiates the Application Engine step trace.

2: Initiates the Application Engine SQL trace.

128:: Initiates the Application Engine timings file trace, which is similar to the COBOL timings trace.

256: Includes the PeopleCode detail timings in the 128 trace.

1024: Initiates the Application Engine timings table trace, which stores the results in database tables.

2048: Initiates the database optimizer explain, writing the results to the trace file. This option is supported only on Oracle and Microsoft SQL Server.

4096: Initiates the database optimizer explain, storing the results in the Explain Plan table of the current database. This option is supported only on Oracle, Db2, and Microsoft SQL Server.

For example, to enable the 1, 2, and 128 traces, you would enter 131,the sum of 1, 2, and 128. To indicate that you do not want any traces, enter0. If you do not explicitly enter0, Application Engine uses the trace value set in PeopleSoft Configuration Manager.

8192: Sets a trace for PeopleSoft Integration Broker transform programs.

16384: Initiates the statement timings trace but stores the results in the PS_AE_TIMINGS_LG and PS_AE_TIMINGS_DT tables.

-DBFLAGS

To disable %UpdateStats meta-SQL construct, enter 1.

-TOOLSTRACESQL

Enable a SQL trace.

-TOOLSTRACEPC

Enable a PeopleCode trace.

-OT

(Optional) Initialize the PeopleCode meta-variable %OutDestType (numeric).

PeopleCode example of %OutDestType:

&ProcessRqst.OutDestType = %OutDestType ;

-OF

(Optional) Initialize the PeopleCode meta-variable %OutDestFormat (numeric).

PeopleCode example of %OutDestFormat:

Query.RunToFile(Record QryPromptRecord, %OutDestFormat);

-FP

(Optional) Initialize the PeopleCode meta-variable %FilePath (string).

PeopleCode example of %FilePath:

If All(%FilePath) Then
   &FILENAME = %FilePath | &FILENAME;
&MYFILE = GetFile(&FILENAME, "E", %FilePath_Absolute);
Else
  &MYFILE = GetFile(&FILENAME, "E", %FilePath_Relative);
End-If;

optfilename

If you submit a file to Application Engine as the first parameter in the command line, Application Engine reads the contents of the file and interprets the contents as if it were parameters entered on the command line. This option is intended mainly for the Microsoft Windows or UNIX Process Scheduler server environment. For example, you might enter psae $temp/myparmfile.txt.

Note: For security reasons, after Application Engine interprets the contents of the parameter file, it immediately deletes the file.

–NOCOMMIT

(Optional) Set Y/N values for this parameter. If it is set to “Y” then it will not commit any changes to database.

Note: You can only use this parameter in a developer environment. Do not use it in a product environment.