Friday, December 30, 2005

Send SQR Generated Files to Report Repository

When we use SQR file open to generate a file, it normally get's
generated in FILEPREFIX directory which is set by setfile.sqc included
in setenv.sqc which is normally defaulted to /usr/tmp. This file is not
transferred to report repository and user needs to manually ftp the
file from unix server. There is a way by which we can send the
generated file to report repository.

Call this procedure in your
sqr. This initializes the $directory variable which can be then be used
in place of '{FILEPREFIX}' to set the filepath. This generates the file
in the sqr log directory which is then transferred to report repository.

BEGIN-PROCEDURE GET-FILE-PATH
!Taken Code from fin2025.sqr
do Get-Directory
let $directory = rtrim($directory, ' ')
! database platform


#ifdef MVS
let $direct_temp = translate($directory, '','.')
let $directory = $direct_temp
let #drive_length = instr($directory, ':', 1)
let #path_length = length($directory)
add 1 to #drive_length
let $directory = {PS-SUBSTR}($directory, #drive_length, #path_length)
let $directory = 'DSN:' || $directory
#else
#ifdef OS400
let $direct_temp = translate($directory, '','.')
let $directory = $direct_temp
let #drive_length = instr($directory, ':', 1)
let #path_length = length($directory)
add 1 to #drive_length
let $directory = {PS-SUBSTR}($directory, #drive_length, #path_length)
let $directory = 'DSN:' || $directory
#else
#ifdef UNIX !UPD110341
let $direct_temp = translate($directory, '','/')
let $directory = $direct_temp
#else
!continue
#end-if
#end-if
#end-if

DISPLAY 'Destination Directory : ' NOLINE
DISPLAY $DIRECTORY
PRINT 'Destination Directory : ' (+1,1,)
PRINT $DIRECTORY ()

END-PROCEDURE


BEGIN-PROCEDURE Get-Directory

begin-select
ORIGOUTDEST,
PRCSOUTPUTDIR
! if isblank(rtrim (upper( ' '))
if rtrim (upper( ' ') = '%%LOG/OUTPUT DIRECTORY%%'
let $directory = rtrim( ' ') || ''
else
let $directory = rtrim( ' ')
end-if
from PSPRCSPARMS where
PRCSINSTANCE = #prcs_process_instance
end-select

END-PROCEDURE

Friday, December 23, 2005

Refresh webserver Cache without restarting it

You can set auditPWD parameter in configuration.properties (pre 8.44) or web profile (> 8.44) to refresh the webserver cache dynamically without restarting it. This is really helpfull when you do not want to disturb your developer population. auditPWD=dayoff Set this to something unique for e.g. dayoff and fireoff this url to refresh the cache http://myserver:port/psp/ps/?cmd=purge&pwd=dayoff To view configuration.properties http://myserver:port/psp/ps/?cmd=viewconfig&pwd=dayoff http://myserver:port/psp/ps/?cmd=viewsprop To Reset Timeout http://abc.abc.com:5500/psp/ps/?cmd=resettimeout&pwd=abcd

Thursday, December 22, 2005

Debug PeopleCode using GetFile

To debug a peoplecode (See complete document), we can use File write very effectively.

Step 1

Declare a file variable
Local File &MYFILE;

Step 2
Add the following Code. replace ketan with your username to uniquely identify your name.

&MYFILE = GetFile("debugketan.txt", "W");
If &MYFILE.IsOpen Then
&MYFILE.WriteLine("your text");
&MYFILE.WriteLine("ketan");
&MYFILE.Close();
End-If;

Step 3:

This file will be created in unix under respective appserver

PS_HOME\APPSERV\\files

For e.g. if peoplecode is running on hrdev appserver the file will be created on

/disk01/psoft/hr84x/appserv/hrdev/files directory.

PeopleSoft Record Types

0 - table
1 - View
2 - Derived/Work
3 - Subrecord
5 - Dynamic View
6 - Query View
7 - Temp table

Extract PeopleCode

If you want to create a file that contains all the PeopleCode for a project (or database) you can use the Find In. . .feature, and search for ";". Be sure to select Save PeopleCode to File. (Do not use double quotes).