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.

!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
#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
#ifdef UNIX !UPD110341
let $direct_temp = translate($directory, '','/')
let $directory = $direct_temp

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



! if isblank(rtrim (upper( ' '))
if rtrim (upper( ' ') = '%%LOG/OUTPUT DIRECTORY%%'
let $directory = rtrim( ' ') || ''
let $directory = rtrim( ' ')
from PSPRCSPARMS where
PRCSINSTANCE = #prcs_process_instance


Friday, December 23, 2005

Refresh webserver Cache without restarting it

You can set auditPWD parameter in (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 http://myserver:port/psp/ps/?cmd=viewconfig&pwd=dayoff http://myserver:port/psp/ps/?cmd=viewsprop To Reset Timeout

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");

Step 3:

This file will be created in unix under respective appserver


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).