Pages

Thursday, December 16, 2010

Change Yahoo Mail links

Recently Yahoo Mail replaced the My Yahoo link with Games on its home screen:



This is a headache because I dont play any web Games & had a lot of links under My Yahoo. Using Greasemonkey on my Firefox to tweak it back and put up a host of the most oft-used links there. Thanks YM for the idea - now the Mail screen is my time-saving launch pad:



Code:
// ********************************** 12/16/10 - changed Games link back to My Yahoo
var xx=document.getElementById("_test_my_yahoo");
if (xx != null)
{
xx.setAttribute("href","http://my.yahoo.com/");
xx.innerHTML="My Yahoo!";
}

// ********************************** 12/16/10 - added extra links
var xx=document.getElementById("networklinkscx");
if (xx != null)
{
xx.innerHTML=xx.innerHTML +
' | Gmail' +
' | News' +
' | STAT' +
' | Fidelity' +
' | Spurs' +
' | A101' +
' | CR' +
' | LogMeIn ' +
' | Blog ' ;

}

Thursday, October 28, 2010

Update Object Property

The General tab of object property can be used to store description, change documentations, etc. Often times I find myself not doing this until the end... It can take a while to go back and open each object to add the description. The following script automates the process by using the Project info for all objects in the project.

Tools v8.49.12.
--Update DESCR and DESCRLONG of Project Objects.
-- 1. set LASTUPDDTTM, LASTUPDOPRID To The same As Project
-- 2. append DESCRLONG
-- 3. set DESCR To Project If blank
---------------------------------------------------------------------------------
PS has 80+ object types, not all of them are listed here. Look for 'Unknown Object Type: ' and add a section for the object. Trace to see what objects PSIDE is accessing.
A nice & quick tracer app: Statement Tracer for Oracle

Wednesday, June 30, 2010

Peoplesoft Project XML Parser

Parse Peoplesoft Project XML file.

http://www.go-faster.co.uk/peopletools/psrecdefn.htm


AUXFLAGMASK Values

Bit Number Bit Value Comment
16 65536 Tools Table
17 131072 Managed Tools Table
18 262144 In use, but not yet sure what it does!
19 524288 Server -> User (Down Sync)
20 1048576 User -> Server (Up Sync)

Thursday, May 27, 2010

Find Portal Menu Navigation Path

PORTAL_OBJNAME is the key -

1. If a few page heading text are known, whether at Folder or Content level, use this sql to get PORTAL_OBJNAME:

Select *  From psprsmdefn Where portal_name ='XXXXX' And upper(DESCR254) Like upper('%fuzzy header%')
or

Select * From psprsmdefn Where portal_name ='XXXXX'   And upper(PORTAL_LABEL) Like upper('%fuzzy header%')

Use this sql with the PORTAL_OBJNAME:
With psnav As(Select RTRIM(Reverse(sys_connect_by_path(Reverse(portal_label), ' >----- ')), ' >----- ') navpath, Level lvl From psprsmdefn A Where portal_name = 'XXXXX' START With PORTAL_OBJNAME = 'YYYYY' CONNECT By PORTAL_OBJNAME = Prior PORTAL_PRNTOBJNAME)Select navpath From psnav Where lvl=(Select max(lvl) From psnav)
This traverses from the Portal root down to the queried object. To go from queried object down:

Select LTRIM((sys_connect_by_path(portal_label, ' =====> ')),'=====> ' ) path, Level lvl
From psprsmdefn A
Where portal_name = 'XXXXX'
START With PORTAL_OBJNAME = 'EPGL_IMPORT_JOURNALS'
CONNECT By PORTAL_PRNTOBJNAME = Prior PORTAL_OBJNAME

2. If RECNAME/PANEL/PANELGROUP is known:
Select * From ps_XREF_PANEL_VW Where recname=upper('MY_RECNAME') and fieldname = upper('_____' )-- get PNLNAME
Select * From ps_PNLGROUP_VW Where PNLNAME=upper('MY_PNLNAME')     -- get PNLGRPNAME
Select * From psprsmdefn Where PORTAL_NAME = upper( 'XXXXX' )And PORTAL_URI_SEG2 = 'MY_PNLGRPNAME' -- find PORTAL_OBJNAME

Use above sqls to find navigation up and down from the PORTAL_OBJNAME.

3. If a few field label texts on the page are known:
Select * From pspnlfield Where upper(lbltext) Like upper('%XXXXX%') --- find page name

if label is in Message Cat:

Select * From pspnlfield where (GRDLBLMSGSET, GRDLBLMSGNUM) in (
select MESSAGE_SET_NBR, MESSAGE_NBR from PSMSGCATDEFN
where upper(MESSAGE_TEXT) like upper ('%XXXXX%'))

put together:
Select * From pspnlfield Where upper(lbltext) Like upper('%XXXXX%')union Select * From pspnlfield where (GRDLBLMSGSET, GRDLBLMSGNUM) in (select MESSAGE_SET_NBR, MESSAGE_NBR from PSMSGCATDEFN where upper(MESSAGE_TEXT) like upper ('%XXXXX%'))
use above sqls to find navigation up and down from the PORTAL_OBJNAME.

(LABEL_ID - select * from PSDBFLDLABL where fieldname ='DESCR254'  )

4. If Process Name is known:
select * from ps_PRCSDEFNPNL where prcsname='VCHR_APRV_AF'

apply PNLGRPNAME in the query above.

Friday, May 21, 2010

My Quick PL/SQL

Read a File:

Create Directory TMP_DIR As 'xxxxxxxx';

Declare
input_file utl_file.file_type;
input_buffer varchar2(98);
pos NUMBER := 0;

Begin
input_file := utl_file.fopen ('TMP_DIR','aaaa.bbb', 'R');

If utl_file.is_open(input_file) Then
Loop
Begin
utl_file.get_line(input_file, input_buffer);

If input_buffer Is Null Then
EXIT;
End If;

Select instr(input_buffer, 'NUMBER OF ROWS FETCHED') Into pos From dual;

If pos > 0
Then
Select to_number(substr(input_buffer, 92,7)) Into inrcgl_cnt From dual;
dbms_output.put_line('INRCGL:'|| inrcgl_cnt);
End If;

Exception
When NO_DATA_FOUND Then
EXIT;
End;
End Loop;

End If;

utl_file.fclose(input_file);*/

Thursday, January 21, 2010

Display external jobs in PS Process Monitor

Many task schedulers exist to provide complex and powerful features that PS' own Process Scheduler cannot match. For example, IBM's Tivoli Workload Scheduler allows complex definition of jobs (=PS' Process) and Job Streams (= PS' Job), server and workstation setup, sophisticated dependency structure, cross platform support, scheduling calendar and beyond, in a GUI environment. You can define complex dependency in its graphical to drag and link jobs with ease. A drawback of this is these jobs are not displayed in Process Monitor. The following are the steps I took to display them in PS:

Friday, January 15, 2010

Quick PS Util - Get Record Description

This function displays Record Definition under Property for a PS record, the function can be expanded to display LONG field values for any PS record.

Create Or replace Function  gl( rec In varchar2, long_fld In varchar2, key_fld In varchar2 )
Return varchar2
As
l_cursor integer Default dbms_sql.open_cursor;
l_n number;
l_long_val varchar2(4000);
l_long_len number;
l_buflen number := 4000;
l_curpos number := 0;
Begin

dbms_sql.parse( l_cursor, 'select ' || long_fld || ' from ' || rec ||' where recname=upper(:x)', dbms_sql.native );
dbms_sql.bind_variable( l_cursor, ':x', key_fld );

dbms_sql.define_column_long(l_cursor, 1);
l_n := dbms_sql.execute(l_cursor);

If (dbms_sql.fetch_rows(l_cursor)>0)
Then
dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,l_long_val, l_long_len );
End If;

dbms_sql.close_cursor(l_cursor);

Return l_long_val;

End gl;
/



EX:
Select gl('psrecdefn','descrlong','vendor') From dual


**** Nice utility to parse PS SQL Trace files : http://devwfb.blogspot.com/2009/11/script-analyzing-tracesql-file-and.html


Get View Definition Text: -----------------------------------------------------------------------
select * from user_views where view_name=upper('')

select DBMS_METADATA.GET_DDL('VIEW',upper('___')) from dual

select * from PSSQLTEXTDEFN where sqlid=upper('___')

Thursday, January 7, 2010

Korn Shell Snippets

Numeric Test --

1.
if [[ -z $(echo $2 | sed 's/[0-9]//g') ]]
then
echo "integer only"
fi

if [[ -z $(echo $2 | awk '/^[0-9]+$/') ]]
then
echo "integer only"
fi

if [[ ! -z $(awk -v x=$a 'END{if(x==x+0) print "integer"}' /dev/null) ]]
then
echo "integer only"
fi

Select * From table_name Where Regexp_Like(column_name, '^[0-9]+
Display Shell line number --

typeset -x PS4='[$LINENO] '
ksh -x script)

Alias to display File access/mod/create time --
alias ft='_(){ echo "modify time: \c";ls -l $1; echo "create time: \c"; ls -lc $1; echo "access time: \c";ls -lu $1; }; _'

Display Date Time at prompt:
export SECONDS="$(date '+3600*%H+60*%M+%S')";typeset -Z2 _h; typeset -Z2 _m ; typeset -Z2 _s;_hh="(SECONDS/3600)%24";_mm="(SECONDS/60)%60";_ss="(SECONDS)%60";_time='${_x[(_m=_mm)==(_h=_hh)==(_s=_ss)]}$_h:$_m:$_s';
export PS1=$(echo "${_time}")':$PWD>';

Date math & TZ (AIX): /etc/environment (https://www-304.ibm.com/support/docview.wss?uid=isg3T1000252)

TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00 (DST enabled)
  • CST6CDT is the time zone you are in;
  • M3 is the third month;
  • .2 is the second occurrence of the day in the month;
  • .0 is Sunday;
  • /2:00:00 is the time.
# get current TZ value
tz=`echo $TZ | tr -s '[:upper:]' '[\0*]' | cut -d, -f"1"`

# 2 hrs back
((tz_2hr_back=$tz+2))

# date string format = MMDDHHMIYY
TZ=GMT+$tz_2hr_back date +%m%d%H%M%y;


ksh93 Associative Array:
unsert color
set -A color
color=([Application Engine]=1 \
[COBOL SQL]=2 \
[Crystal]=3 \
[SQR Process]=4 \
[SQR Report]=5)


${color[@]} = all elements of the array
${!color[@]} = subscripts of an array
${#color[@]} = # of elements within the array.
${color[@]:offset:length} = Elements within a numeric subscript range


echo ${color[@]}
echo ${!color[@]}
echo ${#color[@]}
echo ${color[@]:1:length}

idx=0
while [ $idx -lt ${#color[@]} ]
do
echo ${color[@]:$idx:1}
((idx=idx+1))
done