Capturing NEWSTAR program runs for repeated execution

Contributed by Johan Hamaker, November 1995

Contents

Introduction

The NEWSTAR mechanism for repetitive execution programs with a minimum of user interaction is through the definition of default parameter values in a process symbol table.

While attractive in concept, this approach is rather difficult to handle in practice for several reasons:

These two effects combined make it difficult to keep track of the parameter set for a program run, in particular when a saved parameter set must be modified in detail to cover a slightly different situation. In practice, batch scripting has so far remained something of a black art mastered only by a few specialists.

The batch recording method

The idea of the batch recording method is very simple: The parameter values from a manually executed program run are saved an ASCII file rather than the symbol table. They are recorded precisely in the order in which they are actually obtained and with the literal values as typed in by the user, as in the following simple example for NSCAN:

        OPTION = sh 
          INPUT_SCN_NODE = ** 
          INPUT_SCN_NODE = f 
            FILE_ACTION = #  
          INPUT_SCN_NODE = t 
            FILE_ACTION = layout 
            FILE_ACTION = ov 
              OVERVIEW = obs 
            FILE_ACTION = q 
          INPUT_SCN_NODE =  
        OPTION =  

For an identical re-execution of the program run, one may use this file as input. One may also edit it, however, to correct errors or instruct the program to prompt for those parameters that the user wants to control. For example, the above file could be edited to become:

        OPTION = SHOW  !    1  
          INPUT_SCN_NODE = **  !    2 
          INPUT_SCN_NODE = /ASK  !    3 
            FILE_ACTION = LAYOUT  !    4 
            FILE_ACTION = OVERVIEW  !    5 
              OVERVIEW = OBS  !    6
            FILE_ACTION = QUIT  !    7 
          INPUT_SCN_NODE = ""  !    8 
        OPTION = QUIT  !    9

There are several important advantages over the use of the symbol table:

The method is implemented in three new commands:

Creating a batch file

To create a batch file, use the command

dwrec <program>.<extension>

The program will be excuted in the normal way, the only difference being that a batch file is created containing lines of the form

<paremeter> = <value> ! <line number>

The user's replies are stored litterally; this is unlike in the NEWSTAR log files, where the value shown is the one actually used after interpretation of the user's reply by the parameter system.

Parameters to be prompted for in later replays of the batch file must be given the value /ASK. This may be done by editing the file, but it is also possible to instruct the system to set thids special value at recording time, by appending the string !? to the reply. As an example, we show the complete run that would create the second example of the preceding section.

put script here

Replaying a batch file

The command to replay a batch file is

dwrep <program>.<extension>

The program will run in nthe normal way, taking inputs from the batch file and prompting the user only where the value /ASK is specified.

Renumbering a batch file

To renumber the lines, e.g. after manual addition of lines, use the command

dwren <program>.<extension>

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.


newstar@nfra.nl