Friday, November 21, 2008

COBOL - Configuring instance specific CBLBINs

Sharing a file server to multiple instances is a common practice in may PeopleSoft Infrastructures... Many a times scenerio occurs where we want to have applied some bundles or Maintenance Packs to few of these instances... In such cases many of the external objects like SQRs, CRYSTALs, COBOLs etc would be different for bundled and non-bundled environemtns. For such cases, we would require to have a separate directory for COBOL executable other than the shared one or default one.

Here are the setting required to be done for such scenerio:

1) Create new CBLBIN directory for each instance INS1, INS2, INS3, etc under $PS_HOME (or any other prefered location) like $PS_HOME/CBLBIN_INS1, $PS_HOME/CBLBIN_INS2, $PS_HOME/CBLBIN_INS3 etc.

2) ## Copy the compiled COBOLs into new CBLBIN directory i.e., to $PS_HOME/CBLBIN_INS1, $PS_HOME/CBLBIN_INS2, $PS_HOME/CBLBIN_INS3 etc

3) Process Scheduler Settings for instance INS1:
Modify psprcsrv.ubx - COBPATH={$PS_HOME}/CBLBIN_INS1
Modify psprcsrv.env - COBPATH={$PS_HOME}/CBLBIN_INS1
Modify psprcsrv.cfg - in RemoteCall Section RCCBL PRDBIN=%PS_HOME%/CBLBIN_INS1


4) Application Server Settings for instance INS1:
Modify psappsrv.ubx - COBPATH={$PS_HOME}/CBLBIN_INS1
Modify psappsrv.env - COBPATH={$PS_HOME}/CBLBIN_INS1
Modify psappsrv.cfg - in RemoteCall Section RCCBL PRDBIN=%PS_HOME%/CBLBIN_INS1

##Besides this, you may also want to modify psrun.mak and pscbl.mak, so that while compiling the cobols - compiled files get copied, automatically at the time of compilation itself, to the newly created CBLBIN directories. For this, here are the required modifications:

1) Create directory INS1 under $PS_HOME/src/cbl and place all COBOL programs to be compiled for instance INS1 at location $PS_HOME/src/cbl/INS1

2) modify psrun.mak:
Replace $PS_HOME/src/cbl/ by $PS_HOME/src/cbl/INS1/

3) modify pscbl.mak: Update PS_CBLBIN parameter from old or default value $PS_HOME/cblbin TO new location of CBLBIN directory for instance INS1 $PS_HOME/CBLBIN_INS1:

PS_CBLBIN=$PS_HOME/CBLBIN_INS1

4) modify pscbl.mak:
Replace $PS_HOME/src/cbl/ by $PS_HOME/src/cbl/INS1/

Then compile and link the cobols.

Tuesday, August 26, 2008

UNIX - Extracting text between any Two Lines - Updated

Laurent Schneider suggested one liner using AWK unix command - for my last script Extract_Text.sh... see here:



awk '/^CREATE UNIQUE INDEX/{print "-- Create unique index #"++x}/^CREATE TABLE/{print "-- Create table #"++y}/^CREATE (UNIQUE INDEXTABLE)/,/;/{print}' test.sql




/^CREATE (UNIQUE INDEXTABLE)/,/;/{print}: Searches for CREATE UNIQUE INDEX or CREATE TABLE and prints the lines till the first ";" encounters.



/^CREATE UNIQUE INDEX/{print "-- Create unique index #"++x}: Searches for pattern CREATE UNIQUE INDEX and prints "-- Create unique index # and the number of it's occurance".



/^CREATE TABLE/{print "-- Create table #"++y}: Searches for pattern CREATE TABLE and prints "-- Create unique index # and the number of it's occurance".




This is indeed a better and faster than the while read loop. Below is the modified script for download:




Extract_Text_Modified.sh





NOTE:
After downloading this file, please REPLACE &lt ; with < and &gt ; with >
there is no space between &lt and ; or &gt and ;



* Thanks Laurent

Monday, August 25, 2008

UNIX - Extracting text between any Two Lines

I created a script that modifies an sql script in certain logical way. It extracts texts between certain logical lines and sends the output to a new file. You can download the shell script from here and try executing it with the attached test.sql as input. I created this script to alter PeopleSoft Generated AlterByRename sqls into simple CREATE statements.

Extract_Text.sh
usage: ./Extract_text.sh
NOTE: After downloading this file, please REPLACE
&lt ; with <
&gt ; with >
There is no space between &lt and ; or &gt and ;
(I've mentained the space because of issue with blogspot)

test.sql

Tuesday, July 29, 2008

Permission Lists Associated to a User

Here is the query to find the permission lists associated to a user:

SELECT A.OPRID, D.ROLEUSER, B.ROLENAME, B.CLASSID, C.ClASSDEFNDESC
FROM PSOPRDEFN A, PSROLECLASS B, PSCLASSDEFN C, PSROLEUSER D
WHERE A.OPRID=D.ROLEUSER AND B.CLASSID=C.CLASSID AND B.ROLENAME=D.ROLENAME AND A.OPRID= 'USER_NAME'
ORDER BY
B.CLASSID



Monday, July 28, 2008

Simple Example of Unix "sed" command

Replacing all occurrences of rakesh to raka in file tst

sed s/rakesh/raka/ tst-1


Replacing all occurences of "raka" in old file tst-1 to "rakesh" in new file tst-2

sed s/raka/rakesh/ < tst-1 > tst-2


$ echo rakesh | sed s/rakesh/raka/

raka


$ echo I am rakesh | sed s/rakesh/raka/

I am raka


$ echo I am rakesh | sed 's/rakesh/raka/'

I am raka


s: Substitute Command

/../../ : Delimiter

rakesh : Regular Expression Pattern Search Pattern

raka : Replacement String


$ sed 's/\/tmp\/rk/\/tmp\/rk\/1/' tst-1

hi rakesh parwal

here is the directory /tmp/rk/1


Wednesday, July 23, 2008

PSPRCSRQST, PSPRCSQUE and PSPRCSPARMS

In order to avoid various process scheduler related issues, three Process Scheduler tables PSPRCSRQST, PSPRCSQUE and PSPRCSPARMS must be in sync.

Execute below queries:

select count(*) from PSPRCSRQST;select count(*) from PSPRCSQUE;select count(*) from PSPRCSPARMS;

If these queries give different results, you should bring them in sync by executing below statements:

DELETE FROM PSPRCSQUE QUE WHERE NOT EXISTS (SELECT 'X' FROM PSPRCSRQST RQST WHERE RQST.PRCSINSTANCE = QUE.PRCSINSTANCE);

DELETE FROM PSPRCSPARMS PARMS WHERE NOT EXISTS (SELECT 'X' FROM PSPRCSQUE QUE WHERE QUE.PRCSINSTANCE = PARMS.PRCSINSTANCE);

Also, Column RUNSTATUS of any process instance in table PSPRCSRQST must have same value in table PSPRCSQUE for that process instance... below query will show check for it.

select R.PRCSINSTANCE, R.RUNSTATUS, Q.PRCSINSTANCE, Q.RUNSTATUS from PSPRCSRQST R, PSPRCSQUE Q
where R.PRCSINSTANCE=Q.PRCSINSTANCE and R.RUNSTATUS != Q.RUNSTATUS

*** Also, it is a good practise to delete the processes with delete, error or cancelled status from the PeopleSoft tables:

DELETE FROM PSPRCSRQST where RUNSTATUS = '2' --> 2 is the run status for delelted process. DELETE FROM PSPRCSQUE where RUNSTATUS = '2'

*** Key Point: Data in PSPRCSRQST, PSPRCSQUE and PSPRCSPARMS tables must be in sync.

Thursday, July 10, 2008

Process Run Status - PSXLATITEM

You can query PSXLATITEM table to know the value corresponding to a process run status.




SELECT XLATLONGNAME, FIELDVALUE FROM PSXLATITEM WHERE FIELDNAME = 'RUNSTATUS';




XLATLONGNAME ------------ FIELDVALUE

------------------------- ----------

Cancel ------------------------ 1

Not Successful --------------- 10

Posted ------------------------ 11

Unable to post --------------- 12

Resend ----------------------- 13

Posting ----------------------- 14

Content Generated --------- 15

Pending ----------------------- 16

Success With Warning ------ 17

Blocked ----------------------- 18

Restart ----------------------- 19

Delete ------------------------- 2

Error -------------------------- 3

Hold -------------------------- 4

Queued ----------------------- 5

Initiated ---------------------- 6

Processing -------------------- 7

Cancelled --------------------- 8

Success ----------------------- 9



19 record(s) selected.

OCI - Attach Block Volume to Windows VM

Tip: Although creating and attaching Block Storage to a Windows VM is pretty straightforward (OCI documentation is pretty good for that), th...