[Info-vax] turning verify on and off

Phillip Helbig---undress to reply helbig at astro.multiCLOTHESvax.de
Sun Feb 3 06:42:05 EST 2013


I have some batch jobs which constantly execute in a loop.  
Occasionally, I want to turn verify on for a while then turn it off 
without resubmitting the job, in order to test things.  What about 
procedures which call other procedures etc?  Obviously one needs 
something more refined than turning verify on or off in all the 
procedures at once.  I've thus come up with the following scheme.  I've 
stolen bits of it from other folks, but haven't seen one quite so 
complex as this.  The functionality should be obvious to DCL 
programmers.  I welcome comments for improving it.

$  SAVE_VERIFY    = 'F$VERIFY(0)'
$  PROC_NAME      = F$PARSE(F$ENVIRONMENT("PROCEDURE"),,,"NAME")
$  PROC_VERIFY    = "''PROC_NAME'_VERIFY"
$  PROC_NOVERIFY  = "''PROC_NAME'_NOVERIFY"
$  PROCEDURE      = "EXIT STATUS .OR. %X10000000 + 0*F$VERIFY(SAVE_VERIFY) !"
$CHECK_VERIFY:
$  PROC_VERIFY2   = "''&PROC_VERIFY'" .OR. F$TRNLNM(PROC_VERIFY)
$  PROC_NOVERIFY2 = "''&PROC_NOVERIFY'" .OR. F$TRNLNM(PROC_NOVERIFY)
$  ALL_VERIFY     = "''ALL_VERIFY'" .OR. F$TRNLNM("ALL_VERIFY")
$  VERIFY         = SAVE_VERIFY .OR. PROC_VERIFY2 .OR. ALL_VERIFY
$RETURN
$  IF (VERIFY) THEN -
    WRITE SYS$OUTPUT "$  PROCEDURE START ''F$ENVIRONMENT("PROCEDURE")'"
$SET_VERIFY:
$  DUMMY = 0*'F$VERIFY((PROC_VERIFY2 .OR. ALL_VERIFY) .AND. .NOT. PROC_NOVERIFY)'
$RETURN
$! this is the start of the actual procedure; stuff above is common to all
$! put initialization stuff here
:
:
:
$LOOP:
$  GOSUB CHECK_VERIFY
$  GOSUB SET_VERIFY
!put the meat of the procedure here
:
:
:
$FINISHED: !all paths ultimately exit through this label
$  IF VERIFY THEN SET VERIFY
$  PROCEDURE END   'F$ENVIRONMENT("PROCEDURE")'

The basic idea is that by defining a symbol (for interactive testing
mainly) or a logical name (in any table F$TRNLNM sees) one can turn the
verification for a procedure on and off.  If verify is turned on when
entering the procedure, the procedure turns it off but writes a message
when it starts and finishes (add a timestamp to suit).  Defining
ALL_VERIFY turns it on in all procedures, though this can be overridden 
for a given procedure by defining *_NOVERIFY.  Of course, all features 
of logical names can be used, such as defining the verify logical with 
one value in one table and another value in another table for different 
results depending on the node, the group etc.

Does anyone have anything functionally equivalent in some unix shell?  
Keep in mind that the logical names can be defined in LNM$SYSCLUSTER or 
a table which has LNM$SYSCLUSTER as the parent (such as one owned by a 
group, which thus provides a cluster-wide logical-name table visible 
only to members of the corresponding group).




More information about the Info-vax mailing list