[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: PSRECFIELD.USEEDIT



I have been wondering about this very thing, but never got around to doing
anything like this. Thank you very much for sharing this with us.

Greg Hesla
ghesla@cimaconsulting.com
Cima Consulting. Group
www.cimaconsulting.com


----- Original Message -----
From: Krisjanis Gale <Krisjanis.Gale@NY.FRB.ORG>
To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
Sent: Thursday, August 05, 1999 2:35 PM
Subject: PSRECFIELD.USEEDIT


for those of you working on the highly technical end of PeopleSoft
(namely, the back-end), you should find the following quite useful.

having no way of determining (easily) which bit i needed to mask
in the USEEDIT field in PSRECFIELD to determine whether or
not the "Required" bit had been set, i sat down and coded up
an SQR that searched our PS-delivered databases (which has
quite a few Record definitions for Time & Labor, Payroll, etc.)
to see if specific bits had been set on/off...

and after much trial and error, i have unearthed this information:

PSRECFIELD.USEEDIT
bit    value  flag
  0        1  Key
  1        2  Duplicate Order Key
  2        4  System Maintained
  3        8  Audit Field Add
  4       16  Alternate Search Key
  5       32  List Box Item
  6       64  Descending Key
  7      128  Audit Field Change
  8      256  Required
  9      512  Translate Table Edit
 10     1024  Audit Field Delete
 11     2048  Search Key
 12     4096  Reasonable Date
 13     8192  Yes/No Table Edit
 14    16384  Prompt Table Edit
 15    32768  Auto-Update
 16    65536  Identifies field as Field in SubRecord
 17   131072  (Reserved / Not Used)
 18   262144  From Search Field
 19   524288  Through Search Field


if you want to try do some bitmasking yourself, here's how i did it...

begin-setup
create-array name=bit size=20
  field=n:number
end-setup

begin-program
begin-select
rf.recname   &rec
rf.fieldname &fld
rf.useedit   &use
  let $RECNAME = &rec
  let $FIELDNAME = &fld
  let #USEEDIT = &use
  if #USEEDIT <> 0
    do getUSEEDIT
    do printUSEEDIT
  end-if
from psrecfield rf
order by recname,fieldname
end-select
end-program

begin-procedure getUSEEDIT
let #n = #USEEDIT
let #i = 19
let #b = 0
while #i >= 0
  let #p = power(2,#i)
  if #p > #n
    let #b = 0
  else
    let #b = 1
    subtract #p from #n
  end-if
  put #b into bit(#i) n
  subtract 1 from #i
end-while
end-procedure getUSEEDIT

begin-procedure printUSEEDIT
let $d = lpad($RECNAME,20,'  ') || ' '
let $c = lpad(to_char(#USEEDIT),5,' ')
let $d = $d || rpad($FIELDNAME,20,' ') || '  ' || $c || ' : '
let #i = 19
while #i >= 0
  get #b from bit(#i) n
  let $c = to_char(#b)
  let $d = $d || $c
  subtract 1 from #i
end-while
display $d
end-procedure printUSEEDIT


this is easy enough to hack up in order to determine if a particular bit has
been set.
bon appetit!



(kris)janis p. gale
hrsd - federal reserve bank of new york
x8163