readmin advance usage.

-c : display changed byte

Display altered bytes at the end of any ALT line , after the Tag, "ChgBytes:"

Example:

readmin -c

Output line:

160222 09:17:00  cc       10   stpost    Alt  STOCK_LOG  1  1002595         ECLIPSE CHAIR YELLOW CODE FABRIC              2609 ChgBytes: 124-125,3076-3077,3172,3333-3334,3336

-f <filename> : specify input log file

Example:

readmin -f log.22feb17-0

-m <logid:offset:typechar>

Search the log file for Alter logs, that changed a paticular field on one type of record.

logid

logid is the control logid which you can easily find out using fdbstat.

following example show logid for STOCK is 9

fdbstat -v /u/cc/comp/stock.dat
Filename      flags  ssize/ vsize/ bucsiz/ 1stbuc/ # bucs/ lastbuc nulls log     release
                     prelen suflen keysize elsize  maxnkey lastnod ok ?  id      alphalen

stock.dat     MASTER 3072   1024   4096    2       0       1147          9       64

offset

offset is the starting byte of the field in the record. which can be found by running align on any dec files in /u/ccr.xx/std/hdrs/

use stock.dec as an example

align /u/ccr.16/std/hdrs/stock.dec

following is a cut down version of the out.

start   end    no.of   decimal datatype field_name
byte    byte   byte
/* struct s_sstock */
0       3       4       0       RECPTR  recno
4       5       2       0       BRANCHSIZE      active
6       21      16      0       TEXT    code
22      87      66      0       FILL    old_desc
88      88      1       0       TEXT    replen_period
89      89      1       0       TEXT    status
90      90      1       0       SHTINT  staxcode
91      91      1       0       SHTINT  n_dim
92      95      4       0       RECPTR  stk_par
96      98      3       0       TEXT    st_type
99      104     6       0       TEXT    b_unit
105     110     6       0       TEXT    s_unit
111     111     1       0       TEXT    use_curr_cost
112     115     4       0       RECPTR  catptr
116     117     2       0       TYPDATE lastdblogedd
118     119     2       0       TYPTIME lastdblogedt
120     123     4       2       SHTDEC  markup
124     127     4       2       SHTDEC  supp_cost
etc....
/* total size of s_sstock = 3072 */
/* struct s_vstock */
0       3       4       2       SHTDEC  incost
4       7       4       2       SHTDEC  l_cost
8       9       2       0       TYPDATE lpdate
10      11      2       0       TYPDATE lastmov
12      35      24      0       FILL    vsupp_fill
36      39      4       2       SHTDEC  obqty
40      43      4       2       SHTDEC  qty_on_ebay
44      47      4       2       SHTDEC  qohand
etc...
/* total size of s_vstock = 1024 */

if the field is in the sstock , or static part of the record the

offset is simply the start byte use supp_cost as as example is 124.

if the field is in the vstock, or the variable part of the record the

offset is the start byte plus the size of the static part

use l_cost as example its 4+3072 = 3076.

typechar

typechar is a charicher that tell the program how to read the field. it can be one of the following

t -- align datatype = TEXT and no.of byte is bigger than 1(for string, e.g. descriptions. address)
b -- align datatype = TEXT and no.of byte is 1 (for options)
s -- align datatype is one of the following BRANCHSIZE, SHTINT, SMLPTR, SMLDEC, UCOUNT, TYPDATE, TYPTIME or COUNT
n -- align datatype is one of the following SHTDEC, RECPTR, EXTDEC THREDEC
d -- align datatype = LNGDEC

so again use supp_cost as example the datatype uesd for the command is 'n' because the datatype from align is SHTDEC

To put it together lets see some example.

Examples: find all the STOCK logs that changed the supp_cost from the file log.22feb17-0

readmin -m 9:124:n -f log.22feb17-0

and the result file should contain some lines like the following

Date   Time      EmpCode  Term Program  Logty RecordType Br RecCode        Description
160222 09:18:50  emp1     174  staadore NAlt  STOCK_LOGO 1  1002595         some item name                                2609 Bef: 139900 Aft: 149900
160222 09:19:00  emp2     17   staad     Alt  STOCK_LOG  1  1002990         some other item name                          2978 Bef: 189900 Aft: 199900

used the above output as an example

item 1002595's supp_cost was 1399.00 and the program staadore change it to 1499.00

there are a few more example where you can see by running

readmin --help

readmin (last edited 2022-02-21 03:02:38 by 58)