Debugging and Tracing

 

Application Engine

Tracing

Use the -TRACE option to trace the SQL executed by an application engine program. You can do this either through the command line debugger or in the override parameters of the process definition.

To trace the PeopleCode executed by an application engine program use the -TOOLSTRACEPC option.

These are the various tracing options and what they do. Like all other PeopleSoft trace flags these are bit fields so if you want trace values 1, 2 and 4, you would set the trace to 1 + 2 + 4 = 7 (-TRACE 7).

Value Trace Setting
0 Disables tracing.
1 Initiates the Application Engine step trace.
2 Initiates the Application Engine SQL trace.
4 Initiates the trace for dedicated temporary table allocation to an Application Engine trace (AET) file. You can trace how the system allocates, locks, and releases temporary tables during program runs.
128 Initiates the statement timings trace to a file, which is similar to the COBOL timings trace to a file.
256 Initiates the PeopleCode detail to the file for the timings trace.
1024 Initiates the statement timings trace, but stores the results in the PS_BAT_TIMINGS_LOG and PS_BAT_TIMINGS_DTL tables.
2048 Requests a database optimizer trace file.
4096 Requests a database optimizer to be inserted in the Explain Plan table of the current database.
8192 Sets a trace for PeopleSoft Integration Broker transform programs.

Note that output from the -TRACE flag goes to the application engine trace (.AET) file. Output from the -TOOLSTRACEPC output goes to the PeopleTools trace file (.TRC).

Command Line Debugging

To run application engine in debug mode, run the following from the command line of %PS_HOME%/bin/client/winx86. You may need to install peopletools locally first.

psae.exe -CT DatabaseType -CD DatabaseInstance -CO OperatorID -CP OperatorPassword 
-R RunControl -I ProcessInstance -AI ApplicationEngineProgramName -DEBUG Y

The app engine will log into the database and present you with the following prompt:

PeopleTools 8.48.12 - Application Engine
Copyright (c) 1988-2007 PeopleSoft, Inc.
All Rights Reserved

Application Engine Debugger - enter command or type ? for help.

{APPENGINENAME}.{SECTION}.{FIRST_STEP}>

Note if you get an error about the environment variable PS_SERVER_CFG not being set, you will need to set up the following environment variables:

  • PS_SERVDIR pointing to your process scheduler location (e.g. %PS_HOME%\appserv\prcs\CS90)
  • PS_SERVER_CFG pointing to your process scheduler configuration file (e.g. %PS_SERVDIR%\psprcs.cfg)

You can view the current values in the state record, step into code - which will take you into app designer if it is a PeopleCode step. But the best feature is that it allows you to modify the contents of a state record.

Note that the following commands are available in the debugger:

Debug Commands:

       (Q)uit           Rollback work and end program
      E(X)it            Commit work and end program (valid between steps)
       (C)ommit         Commit work (valid between steps)
       (B)reak          Set or remove a break point
       (L)ook           Examine state record fields
       (M)odify         Change a state record field
       (W)atch          Set or remove a watch field
       (S)tep over      Execute current step or action and stop
  Step (I)nto           Go inside current step or called section and stop
  Step (O)ut of         Execute rest of step or called section and stop
       (G)o             Resume execution
       (R)un to commit  Resume execution and stop after next commit

COBOL

This article on COBOL SQL Tracing explains how to enable tracing on a COBOL process definition.

PeopleCode

Tracing PeopleCode

In the set trace flags on the signon page use Each Statement or through PeopleTools -> Utilities -> Debug -> Trace PeopleCode use Show Each to log all the PeopleCode that fires during your trace. This will tell you what PeopleCode and events are firing (and what is not firing) and is usually enough to give you an idea of what is going on. The best thing is that this trace produces a much smaller log file than selecting most of the other PeopleCode trace settings, making the PeopleCode trace manageable!

Writing to a log file

Here's a simple example of how to log to a file. Obivously its not a good idea to use hardcoded absolute paths so adjust this code accordingly.

&fileLog = GetFile("C:\temp\LOGFILE.log", "w", "a", %FilePath_Absolute);
&fileLog.WriteLine("Begin");
&fileLog.WriteLine("End");
&fileLog.Close();

Further Information

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值