Pages

Monday, October 22, 2018

AE Analyzer - trace file parser



Peoplesoft AE is the worst application platform I have ever encountered in 30 years of  programming, with last 20 as a PS technical consultant.  It's purely made for revenue purpose (training/certification/consulting) at the expense of coding efficiency and performance. It's a hell when it comes to debugging and analyzing AE "applications". 

You can do every single advertised "strength" of AE in a ton of other languages, except for those "benefits" that are PS proprietary so they can not easily be achieved otherwise, such as "auto" objects update or calling peoplecode snippets.

The result is a bloated, inefficient, debugging & performance nightmare, ugly-ware.  

That said as a consultant I do have to work AE "applications", and it's an academic exercise trying to sort through the trace files. 

Generally there are 2 options to deal with AE: 
  • entire app analysis - nightmarish task; code is broken into pieces and flow is controlled by a dropdown list of actions; no simple, easy to understand if-then-else conditional logic, replaced with awkward 'and EXISTS (...)'. 
  • runtime abend debugging - is error on a sql or peoplecode? 
1. peoplecode -
  1. do not clear AE, rerun to create AET & trc
  2. grep '^\-\- .* \.*(' XXX.AET, this creates indented outline of steps up to abend
  3. check "Iteration n of ..." for cursor 
  4. cross ref (using DTTM value) back to trc to see the variables and logic of abend
2. sql - 


Here are some steps that make the job easier.

AE Trace:

Flag: -TRACE 7 -TOOLSTRACEPC 3596 -TOOLSTRACESQL 121

1. grep ^"\-\- [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.[0-9]\{3\} [\.I]" AE_nnnnnn.AET | sed -e 's/^\.* .* \([\.I].*\)$/\1/'  >xxx

2. sed -e 's/\.(PO_POCALC\.\(.*\)) \(.*\)$/\1 \2/' xxx>yyy

2a. sed -e 's/.(\([A-Z].*\)) /\1 /' xxx | sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/' | m  (no hiding AE prog name)

3. sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1; s/^MAIN\.//;s/^_/|_/' yyy | m


Count # of sqls in AET:

 find . -name *AET -exec echo {} \; -exec ksh -c  "grep \(SQL\) {} |wc -l" \; -exec ksh -c "grep \(SQL\) {} | cut -d' ' -f2 | wc -l" \;



-----------------------------------------------------------------------------------
# include "Iteration of"
sed -n 's/\(^\-\- [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.[0-9]\{3\}\) \([\.I].*\)/\2/p' XXX.AET| grep -v ^Instance > aaa

# switch 1st 2 items so "Iteration ..of"  is lined up with section name
sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2\1\3/' 

# remove 1st set of () 

sed  's/\(^\.\+\)(\(.*\)) \(.*\)/\1\2 \3/' aaa


# putting all together
sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2\1\3/'  aaa| sed  's/\(^\.\+\)(\(.*\)) \(.*\)/\1\2 \3/'|sed 's/^\.\(.*\) /\1 /'| sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/' | m 

# new
sed -n 's/^\-\- \([0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.[0-9]\{3\}\) \([\.I].*\)/\2 \1/p' AE_FS_BP_2740810_1121153646.AET | grep -Ev "(^Instance|Tracing)"   | sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2 \1\3/'  | sed  's/\(^\.\+\)(\(.*\)) \((.*)\) /\1 \2 \3 /' | sed 's/^\.\(.*\) /\1 /' | sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/'| m

------------------------------------------------------------------------------------
This is the result, cross reference between 3 frames: AET source, AET flow, Peoplecode:



-----

Living up to its inferior product status even PS' own AET Analyzer does not work on "large" (140MB) trc file: