decodePC.java

decodePC.sqr as written by David L. Price has been rewritten to decodePC.java and expanded. It's general purpose is decoding PeopleCode stored as BLOB. The PeopleSoft database is accessed via a JDBC connection therefore there is no need to use Application Designer to look at PeopleCode, Application Engine programs, SQL, and XSLT. decodePC.java can read Application Engine programs and Application Packages and output them to a text file so you can get on with solving business problems.



Example of compiling decodePC.java with Oracle JDBC on a Unix box from a command prompt in the directory where decodePC.java exists:



javac -classpath /directorypath/ojdbc14.jar ./decodePC.java



Example of running decodePC.class with Oracle JDBC on a Unix box from a command prompt in the directory where decodePC.class exists:



java -classpath .:/directorypath/ojdbc14.jar decodePC


AttachmentSize
decodePC.java.2007summer92.49 KB
decodePC.java.200709106.76 KB
decodePC.java progtxt is data type longraw118.29 KB
stagePeopleCode.txt4.89 KB
decodePC.java progtxt is data type blob113.66 KB

PeopleCode decoder, project in Source Forge

I haven't myself had time to take this for a test drive (March 2011), but this is a very ambitious effort to make PeopleSoft more like other enterprise applications. The goal seems to be the ability to manage PeopleCode outside of the Application Developer and use tools like Subversion. Looks like a very promising way to manage PeopleSoft from another angle. I'll guess Oracle is heading this general direction (eclipse & Subversion) because it makes sense.

https://sourceforge.net/projects/decodepcode

http://www.peoplesoftwiki.com/decode-peoplecode

decodePC.java progtxt is data type blob is missing lines

"decodePC.java progtxt is data type blob" appears to be missing the last few lines. I copied them from "decodePC.java progtxt is data type longraw" to complete my class.

Thanks for the code. Runs fine in Eclipse on my pc.

Runs in Eclipse and last few lines missing.

Hi,

Thanks for the info about running successfully in Eclipse and about the last few lines missing (now how'd that happen?).

Regards, Jeff

Issue in number decoding with decodePC.java

I am using decodePC.java to decrypt the peoplecode. Since I am using PT4.49 plus Oracle 10g. The numbers are not decrypted properly in the above peoplecode, I dont know where is the issue, Someone please check the above peoplecode with your decodePC.java and see the result..

If None( ENTRY_REASN_TBL.DESCRSHORT) Then
ENTRY_REASN_TBL.DESCRSHORT = Substring( ENTRY_REASN_TBL.DESCR, 1, 10);
End-If;

The result that I got is..

If None( ENTRY_REASN_TBL.DESCRSHORT) Then
ENTRY_REASN_TBL.DESCRSHORT = Substring( ENTRY_REASN_TBL.DESCR, 65536, 655360);
End-If;

See the function argument, it shows "65536, 655360" instead of "1, 10".

Please help me out of this..

Regards
Mohamed

Could not reproduce problem

Hi,

Copied code example into an Application Engine and was able to read it correctly using decodePC.java. (PeopleTools 8.50)

Is the code you are having trouble reading baseline Oracle PeopleSoft code or can you find an example of baseline code that is not working (prefer example in Financials)?

Regards
October 2010

Issue in number decoding with decodePC.java

Hi..

First of all thanks for your response..

We are getting this issue only for reading baseline Oracle PeopleSoft code..
The peoplecode is from financials only
Try to use this below information to test the code..
RECORD - ENTRY_REASN_TBL
FIELD - DESCR
EVENT - FieldChange

If we force a save using app.designer by hitting enter at the end of the code and save the code. Now run the decodePC.java for the same code. it is giving the correct result.

If the code is a fresh and direct copy delivered by the peoplesoft then it is not working.

Thanks & regards
Mohammed

Rediscovery of "Get-Legacy-Number"

Hi,

David L. Price documented this in decodePC.sqr and I lost it in the Java version.

Comments in David's decodePC.sqr:

!*******************************************************************************
begin-procedure Get-Legacy-Number(:$out_Number)
!*******************************************************************************
! Code 0x11 (17) seems to be only used in older code. Any attempts to
! recreated this generates an 0x50 (80)... which is the regular number.
! Without multiple examples, it is next to impossible to determine how this is
! stored. Until I can, I will list examples here.
!
! 11 0000 0000 8000 0000 0000 0000 0000 = 128
! 11 0000 0000 0100 0000 0000 0000 0000 = 1





Original code stores the second Substring argument, i.e., decimal 1, as: 11 00 00 00 00 01 00 00 00 00 00 00 00 00 00 (just like David's comment).

A change to the code stores the second Substring argument as: 50 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Method PCdecode for case 11(hex) has been fixed in "decodePC.java PROGTXT is data type blob".

Thanks, but program keeps

Thanks, but program keeps crashing using

"decodePC.java progtxt is data type longraw"

my progtxt is type longraw.

I get the following message when trying to type anything like

/AP = XXX

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62f0c9a7, pid=3916, tid=5856
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [ocijdbc10.dll+0xc9a7]
#

Would it be possible to try with a different JDBC driver?

The error message seems to indicate a problem with the JDBC driver. The error message does not appear to be a Java error or caught exception in the program.

Are you able to try it using the classes12.jar JDBC driver?

Example from Windows XP with Oracle JDBC

Use JDBC within Oracle client version 11.1 against an Oracle 10gR2 database being used for the PeopleSoft application.


Copy decodePC.java onto a PC in directory c:\decodePC.

Create decodePC_build.bat to compile program decodePC.java into decodePC.class.

Create decodePC.bat to run decodePC.class.

Run the bat files from a Windows command prompt.


decodePC_build.bat contains 2 statements:

pushd c:\decodePC

c:\oracle\ora111\jdk\bin\javac -classpath .;c:\oracle\ora111\jdbc\lib\ojdbc5.jar decodePC.java


decodePC.bat contains 2 statements:

pushd c:\decodePC

c:\oracle\ora111\jdk\bin\java -Xmx350m -classpath .;c:\oracle\ora111\jdbc\lib\ojdbc5.jar decodePC


Oracle client version determined by running: Start > All Programs > Oracle > Application Development > sqlplus.

An Oracle 10gR2 database is most likely using data type Blob to store progtxt.

Excellent!

This is an excellent program and I need to get this up and running within our environment! Nice work!

Jeromy McMahon
ASU

The code fails to extract the string from the PROGTEXT field

Saw your code up on passportgeek that allows you to decode PeopleCode.

I got it running on my PT8.43 environment (bit of work as I am using jdbc:oracle:thin, but it doesn't work in PT8.48. (The code fails to extract the string from the progtext field)

I'm pretty sure the reason is that we have built the PS Portal 8.9 / PT8.48 environment on Oracle 10.2.0.3.0, and now PROGTEXT is stored as a BLOB, whereas in Ora9 it's stored as a LONG RAW.

The line that isn't working is somewhere around

OOB[row_cnt] = resultset.getString("progtxt");

I tried to merge the MySQL codeline as that looked BLOB related, but I started getting confused as to how on earth decoding into UTF-16LE etc is handled when converting from a BLOB to a string. It's just that
little bit out of my comfort zone, so I've backed off.

Anyway, good work on posting the code and I'll let you know if I keep playing with it.

Replacing LONG RAW Oracle code with BLOB MySQL code should work

Hi,

Start with program decodePC.java with comments from Nov 2007.

For example, within method stagePeopleCode comment out the Oracle code used for reading PROGTXT when declared as LONG RAW (Oracle begin, Oracle end) and uncomment the MySQL code which was written for datatype BLOB (MySQL begin, MySQL end), ignore the log entries.

This should work. Notice that David Price originally used a temporary table to copy the data from a table with PROGTXT declared as LONG RAW to one with it declared as BLOB. This allowed him to then use the Oracle version 9 BLOB functions (UTL_...).

Please post errors if you run into problems.

Regards

Code change necessary to read Oracle BLOB pspcmprog.progtxt

Hi,

I was wrong. A code change is necessary to read progtxt when it is defined as BLOB.

As far as I can tell, Oracle implemented progtxt as a BLOB of bytes. It is easily read into a byte array.

Previously progtxt was implemented as LONG RAW. I believe it is because of the limited functionality the Oracle database has with data type LONG RAW that although it's the same data as stored in BLOB it is necessary to read it into a String, convert it to a char array and convert that to a byte array.

The code for MySQL assumes the BLOB data is binary.

Method stagePeopleCode(Connection, String) from decodePC.java for reading pspcmprog when progtxt is of data type BLOB has been posted. decodePC.java will eventually be changed to read the Oracle catalog to determine progtxt's datatype and work with both LONG RAW and BLOB.

Most updated version of DECODEPC.java or DECODEPC.sqr

Where can I get the most updated version of these programs for ORACLE database and SQLSERVER database.

Thanks,

Gerry Adams

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.