<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.mystyle {
width: 100%;
padding: 25px;
background-color: coral;
color: white;
font-size: 25px;
box-sizing: border-box;
}
.mystyle2 {
width: 100%;
padding: 25px;
background-color: green;
color: yellow;
font-size: 25px;
box-sizing: border-box;
}
.mystyle3 {
width: 100%;
padding: 25px;
background-color: blue;
color: yellow;
font-size: 25px;
box-sizing: border-box;
}
.mystyle4 {
width: 100%;
padding: 25px;
background-color: yellow;
color: black;
font-size: 25px;
box-sizing: border-box;
}
.mystyle5 {
width: 100%;
padding: 25px;
background-color: gold;
color: black;
font-size: 25px;
box-sizing: border-box;
}
</style>
</head>
<body>
<p>Click the "Try it" button to toggle between adding and removing the "mystyle" class name of the DIV element:</p>
<Button Onclick="Myfunction()">Try It</Button>
<button id="xxx" onclick="myFunction2()">Blue</button>
<button id="yyy" onclick="myFunction3()">Yellow</button>
<button id="aaa" onclick="myFunction5()">Gold</button>
<div id="myDIV" class="mystyle">
This is a DIV element.
</div>
<div id="myDIV2" class="mystyle2">
This is a DIV2 element.
</div>
<div id="myDIV3" class="mystyle3">
This is a DIV3 element.
</div>
<div id="myDIV4" class="mystyle3">
This is a DIV4 element.
</div>
<script>
function myFunction() {
var element = document.getElementById("myDIV");
alert(element.className);
if (element.className=="mystyle2"){
alert(1);
element.classList.toggle("mystyle");
}
else
element.classList.toggle("mystyle2");
}
function myFunction2() {
if (document.getElementById("xxx").innerHTML=="Blue")
{ document.getElementById("xxx").innerHTML="Green"
document.getElementById("myDIV2").className="mystyle3"
}
else
{ document.getElementById("xxx").innerHTML="Blue"
document.getElementById("myDIV2").className="mystyle2"
}
}
function myFunction3() {
if (document.getElementById("yyy").innerHTML=="Yellow")
{ document.getElementById("yyy").innerHTML="Blue"
}
else
{ document.getElementById("yyy").innerHTML="Yellow"
}
var element = document.getElementsByClassName("mystyle3");
for(var i = 0; i < element.length; i++){
element[i].classList.toggle("mystyle4")
}
}
function myFunction5() {
txt=document.getElementById("aaa").innerHTML
switch(txt) {
case 'Gold': txt="Yellow"
break;
case 'Yellow': txt="Blue" ; break;
case 'Blue': txt="Gold" ; break;
default: beark; }
document.getElementById("aaa").innerHTML=txt;
var element = document.getElementsByClassName("mystyle3");
for(var i = 0; i < element.length; i++){
if (txt=="Yellow"){
element[i].classList.remove("mystyle4")
element[i].classList.toggle("mystyle5")
}
else
if (txt=="Blue") {
element[i].classList.remove("mystyle5")
element[i].classList.toggle("mystyle4")
}
else
if (txt=="Gold"){
element[i].classList.remove("mystyle4")
element[i].classList.toggle("mystyle2");
}
}
}
</script>
</body>
</html>
All unicode symbols
Unicode Symbols 2
Unicode symbols 3
Wednesday, December 19, 2018
Monday, December 10, 2018
Restore purged PS Reports
PRCSYSPURGE deletes reports per the retention value:
SELECT PT_RETENTIONDAYS FROM PS_PRCSSYSTEM
Tables impacted:
- PSPRCSRQST
- PSPRCSQUE
- PSPRCSPARMS
- PS_MESSAGE_LOG
- PS_MESSAGE_LOGPARM
- PS_PRCSRQSTDIST
- PS_CDM_LIST
- PS_CDM_AUTH
- PS_CDM_FILE_LIST
Plug a file into PS's report depository - store a file into an existing folder and point url to it to access the file:
1. Choose an existing folder on web server, say /w/psft/psreports/AAA/20180119/928013 - there are some files in the folder, say AP_MATCH_111111. so Process Instance = 111111, CONTENT_ID=928013
2. Insert into 4 tables:
1. Choose an existing folder on web server, say /w/psft/psreports/AAA/20180119/928013 - there are some files in the folder, say AP_MATCH_111111. so Process Instance = 111111, CONTENT_ID=928013
2. Insert into 4 tables:
- insert into PS_PRCSRQSTDIST values (111111,'MY_OPRID',2)
- insert into PS_CDM_LIST values (111111, 928013,'AP_MATCH','Application Engine','$PS_CFG_HOME/appserv/prcs/$DB_NAME/log_output/AE_AP_MATCH_1889633','AP Matching',14,sysdate, sysdate, sysdate+7,5, '$REPORT_NODE', '$DB_NAME/20180119/928013', 9999999, 'Index.html',5,0,' ','GENERAL',0,' ',' ',' ')
- insert into PS_CDM_AUTH values (928013,111111,'MY_OPRID',2)
- insert into PS_CDM_FILE_LIST values (111111, 928013, 'AP_MATCH_1889633.log', 'LOG',2490,sysdate)
Monday, November 26, 2018
Send HTML email in Llnux
A lot of Q&A out on the web, the best one I can find.
On my system , 2 successful implementations:
1. sendmail
(echo "From: sender@aaa.com}";
echo "To: receiver@bbb.com";
echo "Reply-To: all@ccc.com";
echo "Subject: HTML test";
echo "Content-Type: text/html";
echo "MIME-Version: 1.0";
echo "";
echo "<b>line1</b>";
echo "line2";
echo "<b>line3</b>";
) | sendmail -t
2. mutt man
export REPLYTO="replyTo"
mutt -e 'set content_type="text/html"' -s "test" xxx@yyy.com <$FILE
* cannot get mailx to include mail header info
* REPLYTO can store very long text, but mutt only takes around 225 chars, so if the reply list long switch to sendmail.
Tuesday, November 20, 2018
PS Rec Field Defn
Quick Access w/o App Designer:
SELECT VERSION, A.FIELDNAME, FIELDTYPE, LENGTH, DECIMALPOS, FORMAT, FORMATLENGTH, IMAGE_FMT, FORMATFAMILY, DISPFMTNAME, DEFCNTRYYR,IMEMODE,KBLAYOUT,OBJECTOWNERID, DEFRECNAME, DEFFIELDNAME, CURCTLFIELDNAME, USEEDIT, USEEDIT2, EDITTABLE, DEFGUICONTROL, SETCNTRLFLD, LABEL_ID, TIMEZONEUSE, TIMEZONEFIELDNAME, CURRCTLUSE, RELTMDTFIELDNAME, TO_CHAR(CAST((B.LASTUPDDTTM) AS TIMESTAMP),'YYYY-MM-DD-HH24.MI.SS.FF'), B.LASTUPDOPRID, B.FIELDNUM, A.FLDNOTUSED, A.AUXFLAGMASK, B.RECNAME
FROM PSDBFIELD A, PSRECFIELD B
WHERE B.RECNAME = 'OPR_DEF_TBL_GL' AND A.FIELDNAME = B.FIELDNAME AND B.SUBRECORD = 'N'
ORDER BY B.RECNAME, B.FIELDNUM
Wednesday, October 24, 2018
Find table/view name & ddl from sql copybook
This works for PS cobol copybooks, assuming its formatting style, text sacn/grab change needed if not the same format.
1. get rec name:
cut -c7- xxx.sql| grep -v ^\* | sed 's/\-\-.*$//' | sed -n '/FROM/I,/WHERE/Ip' | grep -iv WHERE | awk -F"[(), ]" 'BEGIN{IGNORECASE=1} {for(i = 1; i <= NF; i++) if (match ($i,"^PS")) print $i}'|sort|uniq
2. get ddl:
define obj=&1
declare
buf clob;
typ varchar2(30);
begin
dbms_output.ENABLE(200000);
select OBJECT_TYPE into typ from user_objects where object_name = upper('&obj') and OBJECT_TYPE in ('TABLE','VIEW');
select DBMS_METADATA.GET_DDL(typ,upper('&obj')) into buf from dual;
DBMS_OUTPUT.PUT_LINE(buf);
exception
WHEN OTHERS then
declare
errcd NUMBER := SQLCODE;
errmsg VARCHAR2(300) := SQLERRM;
begin
DBMS_OUTPUT.PUT_LINE(errcd ||','||errmsg);
end;
end;
/
declare
buf clob;
typ varchar2(30);
begin
dbms_output.ENABLE(200000);
select OBJECT_TYPE into typ from user_objects where object_name = upper('&obj') and OBJECT_TYPE in ('TABLE','VIEW');
select DBMS_METADATA.GET_DDL(typ,upper('&obj')) into buf from dual;
DBMS_OUTPUT.PUT_LINE(buf);
exception
WHEN OTHERS then
declare
errcd NUMBER := SQLCODE;
errmsg VARCHAR2(300) := SQLERRM;
begin
DBMS_OUTPUT.PUT_LINE(errcd ||','||errmsg);
end;
end;
/
Tuesday, October 23, 2018
Tivoli conman commands
. conman (command console)
· rr
WKST#JOB_STREAM.JOB (run a job)
· sj (look at all job streams & jobs status)
sj JOBSTREAM (look at a job stream)
· sj
@#@.@+state=EXEC (look at all
running jobs)
sj @#@.JOB (look at job, scheduled/run/complete)
f WKST; 50 (change job fence on WKST to 50)
f WKST; go (prevent all jobs on WKST from running)
f WKST; go (prevent all jobs on WKST from running)
more:
https://www.ibm.com/support/knowledgecenter/SSRULV_9.2.0/com.ibm.tivoli.itws.doc_9.2/distr/src_ref/awsrgconmancmds.htm
Monday, October 22, 2018
AE Analyzer - trace file parser
Peoplesoft AE is the worst application platform I have ever encountered in 30 years of programming, with last 20 as a PS technical consultant. It's purely made for revenue purpose (training/certification/consulting) at the expense of coding efficiency and performance. It's a hell when it comes to debugging and analyzing AE "applications".
You can do every single advertised "strength" of AE in a ton of other languages, except for those "benefits" that are PS proprietary so they can not easily be achieved otherwise, such as "auto" objects update or calling peoplecode snippets.
The result is a bloated, inefficient, debugging & performance nightmare, ugly-ware.
That said as a consultant I do have to work AE "applications", and it's an academic exercise trying to sort through the trace files.
Generally there are 2 options to deal with AE:
- entire app analysis - nightmarish task; code is broken into pieces and flow is controlled by a dropdown list of actions; no simple, easy to understand if-then-else conditional logic, replaced with awkward 'and EXISTS (...)'.
- runtime abend debugging - is error on a sql or peoplecode?
1. peoplecode -
- do not clear AE, rerun to create AET & trc
- grep '^\-\- .* \.*(' XXX.AET, this creates indented outline of steps up to abend
- check "Iteration n of ..." for cursor
- cross ref (using DTTM value) back to trc to see the variables and logic of abend
Here are some steps that make the job easier.
AE Trace:
Flag: -TRACE 7 -TOOLSTRACEPC 3596 -TOOLSTRACESQL 121
2. sed -e 's/\.(PO_POCALC\.\(.*\)) \(.*\)$/\1 \2/' xxx>yyy
2a. sed -e 's/.(\([A-Z].*\)) /\1 /' xxx | sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/' | m (no hiding AE prog name)
3. sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1; s/^MAIN\.//;s/^_/|_/' yyy | m
Count # of sqls in AET:
find . -name *AET -exec echo {} \; -exec ksh -c "grep \(SQL\) {} |wc -l" \; -exec ksh -c "grep \(SQL\) {} | cut -d' ' -f2 | wc -l" \;
-----------------------------------------------------------------------------------
# include "Iteration of"
sed -n 's/\(^\-\- [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.[0-9]\{3\}\) \([\.I].*\)/\2/p' XXX.AET| grep -v ^Instance > aaa
# switch 1st 2 items so "Iteration ..of" is lined up with section name
sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2\1\3/'
# remove 1st set of ()
sed 's/\(^\.\+\)(\(.*\)) \(.*\)/\1\2 \3/' aaa
# putting all together
sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2\1\3/' aaa| sed 's/\(^\.\+\)(\(.*\)) \(.*\)/\1\2 \3/'|sed 's/^\.\(.*\) /\1 /'| sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/' | m
# new
sed -n 's/^\-\- \([0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.[0-9]\{3\}\) \([\.I].*\)/\2 \1/p' AE_FS_BP_2740810_1121153646.AET | grep -Ev "(^Instance|Tracing)" | sed 's/\(^Iteration.*of \)\(\.\.*\)\((.*\)/\2 \1\3/' | sed 's/\(^\.\+\)(\(.*\)) \((.*)\) /\1 \2 \3 /' | sed 's/^\.\(.*\) /\1 /' | sed ':1; s/^\([^[a-zA-Z(]*\)\./\1_/;t1;s/^_/|_/'| m
------------------------------------------------------------------------------------
This is the result, cross reference between 3 frames: AET source, AET flow, Peoplecode:
-----
Living up to its inferior product status even PS' own AET Analyzer does not work on "large" (140MB) trc file:
find folder older than n days and remove
- find folder older than 30 days and remove
## display foldersfind . -type d -ctime +30 -exec echo -ne "folder:" {} "\t " \; -exec stat --format=%y {} \; | sort -k 3,3
## remove folders
find . -type d -ctime +30 -exec rm -r {} \;
Monday, June 25, 2018
check for non-ascii
- pcregrep --color='auto' -n "[\x80-\xFF]" <file>
- LANG=C/LC_ALL=C grep -P '[\x80-\xFF]' <file>
- LANG=C/LC_ALL=C sed -n '/[\x80-\xFF]/p' <file>
- LANG=C/LC_ALL=C sed 's/[\x80-\xFF]//g' <file>
Source: LC_ALL
Subscribe to:
Posts (Atom)