Monitor2.txt

Monitoring AP/PRO - part 2

Monitoring the TXLOG and debug statements

By Nathan Rector

Natec Systems

 

Advanced Pick has a lot of nice functions that the old R83 didn't have. Many of this functions allow you to do things that you'd never have been able to do in R83. For example, the transaction logger, phantom processor and a more comprehensive WHERE statement.

The transaction logger is a great feature for those people who are concerned about losing updates to critical files if the system crashes or the power goes out. This works great for retail stores that have their registers running from pick, or the accounts pay and receivables files that are updated everyday for the 10,000 customers a company deals with. The only problem with the transaction logger is that that it requires some basic human monitoring to really make it functional.

Most people will use a disk or a small tape device to link to the transaction logger. If you aren't doing a lot of updates, then usual this isn't a problem, but a lot of the time these devices will fill up and Advanced Pick will ask for fresh disk or tape to be input.

This is great, the system knows and will ask for another disk, but the problem lays in that the Transaction Logger only send the message to port 0, and only then when its logged on. This work great as long as someone is there to see the message, but what if port 0 is never used except for the end of day save or other critical function. What then?

Since Pick is so good at not needing a full time management team, many companies keep port 0 in the computer room locked up safe. This keeps it out of the hands of employee's or just gives a part time MIS manager a place to work when they need it.

This type of mentality usual leads to someone in the DP department in charge of monitoring the transaction logger, but it also puts this person someplace other than port 0. That means the person either has to check it constantly, which is a big hassle and time consuming, or check it every few hours. Both of these 2 things lead to gaps in the transaction logging. Not good if your system goes down, and you loose an hours with of critical transactions because the transaction logger has been waiting for the next disk or tape.

The answer to this is actually rather simple. Pick supplies a TCL verb called TXLOG-STATUS. This will give the status of the transaction logger at any one point. By placing this verb into a phantom program and setting up the program to check the status of the Transaction Logger. When the Transaction Logger is waiting for a new disk or tape, then have it send a message to a specific user logged on. This way it doesn't matter where the person in charge of the transaction logger is logged on at, they get notified when a new disk or tape is needed. (see figure #1)

 

When Pick system wrote Advanced Pick, they decided to change the way the ABS frame were labeled from the cryptic frame number found on the R83 platforms to a verbal description of the Frame's process:

:where

Ln PCB PIB ABS Stat R1 & Return stack contents 11:00:53 20 Mar

FID Stat Base

*000 00278A FF10 0033B1 1 ws.where1:01E ws.whatwhere:236

003 000803 BF10 000018 P sp.sleep:027 sp.spoolout:07A

005 002894 BF10 000018 P pp.sched:02A

As you can see, there are 2 parts to each ABS definition. The first part is the class of function being done, and the second part is the actual function. By looking at the class you can tell what each port is doing. For example, with the ABS processes 'ws.where1', the class is 'ws', or work space, and the function 'where1' is, or part of the WHERE statement. (See figure 2 for class definitions)

Since it is a lot easier to see the basic ABS functions each port is running, you can setup a program to watch for another common problems you may have on a large system; programs dropping to the basic debugger. If you are working with well written software that has years of use under it's belt, more than likely you don't have to watch for this. But, if you are working on an ever changing system, this is something that you should be watching for.

The basic debugger gives users access to areas of the system you may not want them. For example, TCL or the System debugger.

Another thing the WHERE statement will allows you to check for is who is at TCL. Many MIS managers and programmers try to keep the users from TCL for security and data integrity reasons. The problem has always been how do you tell when someone is at TCL who shouldn't be? By watching for the ABS function AU.TCL in the WHERE list, you are able to keep track of the time, how long, and who was at TCL.

Many of these function you would not be able to do, or do easily with the older R83 systems. It takes Pick one step farther into a system that need no system management.

<bio>

Nathan Rector is the Owner of Natec Systems, where he provides consulting and software solutions for R83, AP/Pro, System Builder, and PicLAN. He can be contacted at 71702.3456@compuserve.com. Please send any Techincal Article requests to the same email address.

<figure 1>

001 * MONITOR2

002 EQUATE AM TO CHAR(254), VM TO CHAR(253), SVM TO CHAR(252)

003 *CREATED BY Nathan Rector, Natec Systems

004 *

005 * This program is used to monitor verious process on the system

006 * If something is wrong, then it will send messages to the person

007 * the system needs to notify.

008 *

009 * See program for docs on specific functions

010 *

011 *********************************************************************

012 *PROGRAMMING LOGIC

013 *********************************************************************

014 OPEN "MD" TO MD.FILE ELSE STOP 201, "MD"

015 STOP.LOOP = 0 ; PRE.DEBUG.ERROR = ""

016 LOOP

017 *******************************************************************

018 *** Checks to see if the transaction logger needs another tape.

019 *******************************************************************

020 EXECUTE \TXLOG-STATUS\ CAPTURING OUTPUT RETURNING ERR

021 BEGIN CASE

022 CASE INDEX(ERR,"618",1)

023 MSG = "Transaction Logger: Disk Error"

024 CASE INDEX(ERR,"615",1)

025 MSG = "Transaction Logger is waiting for NEXT disk."

026 CASE 1

027 MSG = ""

028 END CASE

029 *

030 IF NOT(MSG = "") THEN GOSUB 4000 ;* send msg

031 *******************************************************************

032 *** notifies the System admin that there is a port sitting at the

033 *** debugger.

034 *******************************************************************

035 DEBUGGER = 0 ; RAW.STRING = "" ; TCL = 0

036 EXECUTE \WHERE\ CAPTURING OUTPUT

037 OUTPUT = DELETE(OUTPUT,4) ;* ignore line

038 OUTPUT = DELETE(OUTPUT,3) ;* ignore line

039 OUTPUT = DELETE(OUTPUT,2) ;* ignore line

040 OUTPUT = DELETE(OUTPUT,1) ;* ignore line

041 NUM = DCOUNT(OUTPUT,AM) ; PORT.LIST = "" ; SEND.MSG = 0

042 *

043 FOR I = 1 TO NUM

044 LINE.DEBUG = 0 ; LINE.TCL = 0

045 PORT.NO = TRIM(OUTPUT<I>[2,3])

046 LOC = OCONV(PORT.NO,"TPIBS;X;;1")

047 *

048 BEGIN CASE

049 CASE PORT.NO = ""

050 CASE INDEX(OUTPUT<I> 'CU'," BD.",1) ;* basic Debugger

051 DEBUGGER = 1

052 PORT.LIST = PORT.LIST :" ": PORT.NO :" - ": LOC :" (basic)"

053 RAW.STRING<-1> = OUTPUT<I>

054 CASE INDEX(OUTPUT<I> 'CU',"AU.TCL",1) ;* TCL

055 TCL = 1

056 PORT.LIST = PORT.LIST :" ": PORT.NO :" - ": LOC :" (TCL)"

057 RAW.STRING<-1> = OUTPUT<I>

058 END CASE

059 NEXT I

060 *

061 IF DEBUGGER OR TCL THEN

062 MSG = "(DM WHERE.LOG) The following ports are currently at a debugger/TCL: ":PORT.LIST

063 GOSUB 4000 ;* send msg

064 *

065 READ ITEM FROM MD.FILE, "WHERE.LOG" ELSE ITEM = ""

066 *

067 *** finds the starting line of last error

068 *

069 ST.LINE = "" ; ITEM.NUM = DCOUNT(ITEM,AM)

070 FOR L = 1 TO ITEM.NUM UNTIL NOT(ST.LINE = "")

071 IF ITEM<L>[1,2] = "==" THEN ST.LINE = L

072 NEXT I

073 *

074 BEGIN CASE

075 CASE RAW.STRING = PER.DEBUG.ERROR

076 *

077 *** if the message is the same as a few mins ago, then

078 *** make the date, time a range.

079 *** The program will take out the old ending date time by

080 *** doing a mask, and then add on the new ending date/time

081 *

082 ITEM<1> = ITEM<1> 'L#20' :" - ": OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH")

083 CASE ITEM<ST.LINE + 1> = RAW.STRING<1> AND ITEM<ST.LINE - 1> = MSG

084 *

085 *** same person, same port, same error has occured. log

086 *** it with prev error information.

087 *

088 ITEM = OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH") :AM: ITEM

089 CASE 1

090 ITEM = OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH") :AM: MSG :AM: STR("=",70) :AM: RAW.STRING :AM: STR("=",70) :AM: ITEM

091 END CASE

092 WRITE ITEM ON DM.FILE, "WHERE.LOG"

093 PER.DEBUG.ERROR = RAW.STRING

094 END ELSE

095 PER.DEBUG.ERROR = ""

096 END

097 UNTIL STOP.LOOP DO

098 SLEEP 60 ;* sleeps one minute

099 REPEAT

100 900*

101 STOP

102 *********************************************************************

103 *SUBROUTINES

104 *********************************************************************

105 4000*

106 TCL \MSG !DM \: MSG ;* send a massage to the DM user

107 RETURN

108 END

 

<figure 2>

PP - Phantom

WS - Workspace

BR - BASIC runtime

SP - Spooler

RDL - Generalized Input

BC - BASIC Compile

OVF - Overflow

RET - Item Retrieval

UPD - Item Update

PL - PicLan

EC - ACCESS (parser)

EL - ACCESS (display)

ES - ACCESS (Selection)

JET - Jet

AU - Update Processor or TCL

TP - Tape I/O

CTS - SCSI Tape

TL - Transaction logger

BD - BASIC debugger

PQ - PROC

ED - Editor

PX - FlashBASIC Runtime

LK - Link

RS - Restore

SV - Save

CS - Compusheet+

OP - Output Processor

GFE - GFE Handler

COM - Comm

FM - File Manager

BT - Btree

TV - Tape verify

Monitor2

Monitor2.txt

Monitoring AP/PRO - part 2

Monitoring the TXLOG and debug statements

By Nathan Rector

Natec Systems

 

Advanced Pick has a lot of nice functions that the old R83 didn't have. Many of this functions allow you to do things that you'd never have been able to do in R83. For example, the transaction logger, phantom processor and a more comprehensive WHERE statement.

The transaction logger is a great feature for those people who are concerned about losing updates to critical files if the system crashes or the power goes out. This works great for retail stores that have their registers running from pick, or the accounts pay and receivables files that are updated everyday for the 10,000 customers a company deals with. The only problem with the transaction logger is that that it requires some basic human monitoring to really make it functional.

Most people will use a disk or a small tape device to link to the transaction logger. If you aren't doing a lot of updates, then usual this isn't a problem, but a lot of the time these devices will fill up and Advanced Pick will ask for fresh disk or tape to be input.

This is great, the system knows and will ask for another disk, but the problem lays in that the Transaction Logger only send the message to port 0, and only then when its logged on. This work great as long as someone is there to see the message, but what if port 0 is never used except for the end of day save or other critical function. What then?

Since Pick is so good at not needing a full time management team, many companies keep port 0 in the computer room locked up safe. This keeps it out of the hands of employee's or just gives a part time MIS manager a place to work when they need it.

This type of mentality usual leads to someone in the DP department in charge of monitoring the transaction logger, but it also puts this person someplace other than port 0. That means the person either has to check it constantly, which is a big hassle and time consuming, or check it every few hours. Both of these 2 things lead to gaps in the transaction logging. Not good if your system goes down, and you loose an hours with of critical transactions because the transaction logger has been waiting for the next disk or tape.

The answer to this is actually rather simple. Pick supplies a TCL verb called TXLOG-STATUS. This will give the status of the transaction logger at any one point. By placing this verb into a phantom program and setting up the program to check the status of the Transaction Logger. When the Transaction Logger is waiting for a new disk or tape, then have it send a message to a specific user logged on. This way it doesn't matter where the person in charge of the transaction logger is logged on at, they get notified when a new disk or tape is needed. (see figure #1)

 

When Pick system wrote Advanced Pick, they decided to change the way the ABS frame were labeled from the cryptic frame number found on the R83 platforms to a verbal description of the Frame's process:

:where

Ln PCB PIB ABS Stat R1 & Return stack contents 11:00:53 20 Mar

FID Stat Base

*000 00278A FF10 0033B1 1 ws.where1:01E ws.whatwhere:236

003 000803 BF10 000018 P sp.sleep:027 sp.spoolout:07A

005 002894 BF10 000018 P pp.sched:02A

As you can see, there are 2 parts to each ABS definition. The first part is the class of function being done, and the second part is the actual function. By looking at the class you can tell what each port is doing. For example, with the ABS processes 'ws.where1', the class is 'ws', or work space, and the function 'where1' is, or part of the WHERE statement. (See figure 2 for class definitions)

Since it is a lot easier to see the basic ABS functions each port is running, you can setup a program to watch for another common problems you may have on a large system; programs dropping to the basic debugger. If you are working with well written software that has years of use under it's belt, more than likely you don't have to watch for this. But, if you are working on an ever changing system, this is something that you should be watching for.

The basic debugger gives users access to areas of the system you may not want them. For example, TCL or the System debugger.

Another thing the WHERE statement will allows you to check for is who is at TCL. Many MIS managers and programmers try to keep the users from TCL for security and data integrity reasons. The problem has always been how do you tell when someone is at TCL who shouldn't be? By watching for the ABS function AU.TCL in the WHERE list, you are able to keep track of the time, how long, and who was at TCL.

Many of these function you would not be able to do, or do easily with the older R83 systems. It takes Pick one step farther into a system that need no system management.

<bio>

Nathan Rector is the Owner of Natec Systems, where he provides consulting and software solutions for R83, AP/Pro, System Builder, and PicLAN. He can be contacted at 71702.3456@compuserve.com. Please send any Techincal Article requests to the same email address.

<figure 1>

001 * MONITOR2

002 EQUATE AM TO CHAR(254), VM TO CHAR(253), SVM TO CHAR(252)

003 *CREATED BY Nathan Rector, Natec Systems

004 *

005 * This program is used to monitor verious process on the system

006 * If something is wrong, then it will send messages to the person

007 * the system needs to notify.

008 *

009 * See program for docs on specific functions

010 *

011 *********************************************************************

012 *PROGRAMMING LOGIC

013 *********************************************************************

014 OPEN "MD" TO MD.FILE ELSE STOP 201, "MD"

015 STOP.LOOP = 0 ; PRE.DEBUG.ERROR = ""

016 LOOP

017 *******************************************************************

018 *** Checks to see if the transaction logger needs another tape.

019 *******************************************************************

020 EXECUTE \TXLOG-STATUS\ CAPTURING OUTPUT RETURNING ERR

021 BEGIN CASE

022 CASE INDEX(ERR,"618",1)

023 MSG = "Transaction Logger: Disk Error"

024 CASE INDEX(ERR,"615",1)

025 MSG = "Transaction Logger is waiting for NEXT disk."

026 CASE 1

027 MSG = ""

028 END CASE

029 *

030 IF NOT(MSG = "") THEN GOSUB 4000 ;* send msg

031 *******************************************************************

032 *** notifies the System admin that there is a port sitting at the

033 *** debugger.

034 *******************************************************************

035 DEBUGGER = 0 ; RAW.STRING = "" ; TCL = 0

036 EXECUTE \WHERE\ CAPTURING OUTPUT

037 OUTPUT = DELETE(OUTPUT,4) ;* ignore line

038 OUTPUT = DELETE(OUTPUT,3) ;* ignore line

039 OUTPUT = DELETE(OUTPUT,2) ;* ignore line

040 OUTPUT = DELETE(OUTPUT,1) ;* ignore line

041 NUM = DCOUNT(OUTPUT,AM) ; PORT.LIST = "" ; SEND.MSG = 0

042 *

043 FOR I = 1 TO NUM

044 LINE.DEBUG = 0 ; LINE.TCL = 0

045 PORT.NO = TRIM(OUTPUT<I>[2,3])

046 LOC = OCONV(PORT.NO,"TPIBS;X;;1")

047 *

048 BEGIN CASE

049 CASE PORT.NO = ""

050 CASE INDEX(OUTPUT<I> 'CU'," BD.",1) ;* basic Debugger

051 DEBUGGER = 1

052 PORT.LIST = PORT.LIST :" ": PORT.NO :" - ": LOC :" (basic)"

053 RAW.STRING<-1> = OUTPUT<I>

054 CASE INDEX(OUTPUT<I> 'CU',"AU.TCL",1) ;* TCL

055 TCL = 1

056 PORT.LIST = PORT.LIST :" ": PORT.NO :" - ": LOC :" (TCL)"

057 RAW.STRING<-1> = OUTPUT<I>

058 END CASE

059 NEXT I

060 *

061 IF DEBUGGER OR TCL THEN

062 MSG = "(DM WHERE.LOG) The following ports are currently at a debugger/TCL: ":PORT.LIST

063 GOSUB 4000 ;* send msg

064 *

065 READ ITEM FROM MD.FILE, "WHERE.LOG" ELSE ITEM = ""

066 *

067 *** finds the starting line of last error

068 *

069 ST.LINE = "" ; ITEM.NUM = DCOUNT(ITEM,AM)

070 FOR L = 1 TO ITEM.NUM UNTIL NOT(ST.LINE = "")

071 IF ITEM<L>[1,2] = "==" THEN ST.LINE = L

072 NEXT I

073 *

074 BEGIN CASE

075 CASE RAW.STRING = PER.DEBUG.ERROR

076 *

077 *** if the message is the same as a few mins ago, then

078 *** make the date, time a range.

079 *** The program will take out the old ending date time by

080 *** doing a mask, and then add on the new ending date/time

081 *

082 ITEM<1> = ITEM<1> 'L#20' :" - ": OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH")

083 CASE ITEM<ST.LINE + 1> = RAW.STRING<1> AND ITEM<ST.LINE - 1> = MSG

084 *

085 *** same person, same port, same error has occured. log

086 *** it with prev error information.

087 *

088 ITEM = OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH") :AM: ITEM

089 CASE 1

090 ITEM = OCONV(DATE(),"D2/") :" ": OCONV(TIME(),"MTH") :AM: MSG :AM: STR("=",70) :AM: RAW.STRING :AM: STR("=",70) :AM: ITEM

091 END CASE

092 WRITE ITEM ON DM.FILE, "WHERE.LOG"

093 PER.DEBUG.ERROR = RAW.STRING

094 END ELSE

095 PER.DEBUG.ERROR = ""

096 END

097 UNTIL STOP.LOOP DO

098 SLEEP 60 ;* sleeps one minute

099 REPEAT

100 900*

101 STOP

102 *********************************************************************

103 *SUBROUTINES

104 *********************************************************************

105 4000*

106 TCL \MSG !DM \: MSG ;* send a massage to the DM user

107 RETURN

108 END

 

<figure 2>

PP - Phantom

WS - Workspace

BR - BASIC runtime

SP - Spooler

RDL - Generalized Input

BC - BASIC Compile

OVF - Overflow

RET - Item Retrieval

UPD - Item Update

PL - PicLan

EC - ACCESS (parser)

EL - ACCESS (display)

ES - ACCESS (Selection)

JET - Jet

AU - Update Processor or TCL

TP - Tape I/O

CTS - SCSI Tape

TL - Transaction logger

BD - BASIC debugger

PQ - PROC

ED - Editor

PX - FlashBASIC Runtime

LK - Link

RS - Restore

SV - Save

CS - Compusheet+

OP - Output Processor

GFE - GFE Handler

COM - Comm

FM - File Manager

BT - Btree

TV - Tape verify