@@
F. Standard Verbs


     There are some standard verbs which are useful to know.  Among
these are the standard functions:

              SIN  ( x )
              COS  ( x )
              TAN  ( x )
              ATAN ( y )
              ATAN2 ( y , z )
              SQRT ( z )
              LOG  ( z )
              LN   ( z )
              EXP  ( z )
              MOD  ( y , z )
              MODULUS  ( y , z )

where x and the answer from ATAN and ATAN2 are in degrees and where x,
y, and z may be POPS expressions, but may not be strings or whole
arrays.

     The verb EXIT causes the POPS-based program to terminate normally
and to return control of the terminal and other devices to the operating
system.  The verb RESTART causes the POPS-based program to restart at
the beginning without exiting.  Basically, RESTART is equivalent to a
RESTORE 0 with a new user identification number.

     TYPE and PRINT are used to write (on the terminal) the results of
computations and the current values of adverbs.  The format is

             TYPE    < n1 > , < n2 > , < n3 > ......
             PRINT   < n1 > , < n2 > , < n3 > ......

where the < ni > may be constants, scalar adverbs, subscripted array
adverbs, whole array adverbs, and/or expressions.  The < ni > should
be separated by commas.  Examples:

         TYPE   'X=' , X , 'ARRAY=' , ARRAY
         PRINT  X+SIN(Y)/Z , ARRAY(I)                              .

     READ is a similar, but less commonly used, verb.  Its format is

         READ   < n1 > , < n2 > , < n3 > ........

where the < ni > are numerical or character string adverbs including
whole arrays and subscripted arrays.  READ will read as many lines of
input as required to obtain the requested data.  When the READ command
is encountered in normal mode, POPS will prompt the user for input
using the prompt symbol '#' .  Input data must be in the form of valid
constants of the correct type.  (Note that this means that character
strings are enclosed in single quotes.)  The data must be in the
requested order, but one may enter as many or as few data items per line
as desired.  Example: assume


             ARRAY  AR(4)
             STRING*8  CA(2)
then
            > READ CA(1), AR, CA(2)
            #   'START'    4
            #   3.789E+04
            #   -19.2     23      'ENDITALL'
            >

Warning: when a READ command is encountered while handling a RUN file
or during execution in batch mode, input for the READ is taken from the
same disk file as the commands.

     All input to, and non-HELP-like messages produced by, a POPS-based
program are recorded in a special log file.  Tasks "spawned" by the
POPS-based program also record their messages in the same log file.
The verb PRTMSG may be used to print (on the line printer) and/or
delete messages from this file.  Batch jobs automatically execute
PRTMSG when they finish, but if a job might produce more than 5000
lines of messages then PRTMSG should be used at appropriate spots
through the job.  The interactive log file is automatically printed
or cleared on EXIT and RESTART.
@@
G. Batch


     POPS is designed primarily as a language for interactive data
processing.  However, as computers have become more powerful and as the
quantity of data to be processed has grown, the ability to run simul-
taneously more than one version of the POPS-based program has become
very attractive.  Since interactive devices, particularly TV-display
devices, are very expensive, there is usually only one interactive
version of the POPS-based program.  However, there can be one or more
batch versions which do not use the interactive devices.  (For AIPS,
these devices are the TV-display device (IIS), the graphics display
device (TEK4012), and, since there are no computer operators, the tape
drive(s).)  The batch versions take their input lines from files on
disk and process them in exactly the same way as the interactive
version.  The only real difference is that batch versions have a
somewhat smaller list of available verbs and tasks.  The selection of
which disk files are executed in what order is controlled by a simple
queuing algorithm and a "batch queue" file.  Thus, a number of jobs
may be submitted to a single batch POPS-based program.  The jobs will
be executed one at a time in a suitable order (basically first-in-
first-out, but with a preference for users who have not run a job
recently).

     AIPS provides the means to prepare, submit, and monitor batch
jobs.  There are four batch-related adverbs:

      BATQUE      specifies which batch processor is used
      JOBNUM      specifies a job identification number
      BATFLINE    specifies an initial line number in a batch work
                  or input file
      BATNLINE    specifies the number of lines listed

The lines of POPS statements to be executed by the batch POPS program
are prepared in the "batch work" file appropriate to the desired
queue.  The work file may be initialized with BATCLEAR, added to with
BATCH, edited with BATEDIT, and listed with BATLIST.  When the text
for the job is complete, it may be sent with SUBMIT to a special
"Checker" version of the batch POPS-based program (AIPS's checker
is called AIPSC).  Checker examines the code in a rather complete
way to test for errors.  It actually executes all of the POPS
language code and a portion of the task activation code, without
actually executing the slower applications verbs and tasks.  During
this process all RUN files are expanded into the input stream and
tested.  If no errors are found, then the full input including
expanded RUN files is copied to a "batch file" and the job is assigned
a job number and queued in the appropriate batch processor queue.
Thus, after successful submission, the user may modify his batch work
file and RUN files without affecting the execution of the submitted
job.  The current queues may be displayed using QUEUES.  For jobs
which are not yet in execution, the user may list the submitted
job with JOBLIST and may remove it from the queue with UNQUE.  The
latter verb causes the batch file to be copied back to a batch work
file for correction and resubmission.


     These verbs and adverbs are described in some detail in Chapter
IV.  However, a few more remarks are appropriate here.  The verbs
BATCH and BATEDIT are somewhat like pseudoverbs in that they must
be the last POPS statement on a line.  They cause POPS to switch to
the prompt symbol '<' and to copy all input lines to the appropriate
place in the specified batch work file.  POPS returns to normal mode
when ENDBATCH appears on an input line.  Note that ENDBATCH does not
appear in the symbol table and must be the only POPS statement on
the line.  BATCH causes the lines to be placed at the end of the
work file, while BATEDIT deletes and/or inserts the lines in the
work file following an algorithm similar to EDIT.  A work file is
regarded as empty if the current log-on user number does not match
that recorded in the work file.  The first use of BATCH will alter
the recorded user number.  A user may only perform JOBLIST and
UNQUE on those jobs which he has submitted.

     Since there is only one interactive POPS-based program, there
is a need to have an alternative means by which batch jobs may be
prepared, submitted, and monitored.  In the AIPS system, the
program BATTER provides these means.  It is a very simplified POPS-
like processor whose symbol table consists only of the scalar adverbs

        BATQUE                  BATFLINE
        JOBNUM                  BATNLINE

and the verbs

        BATCH                   SUBMIT
        BATEDIT                 QUEUES
        BATLIST                 HELP
        BATCLEAR                PRTMSG
        JOBLIST                 EXIT
        UNQUE                   =

These verbs function in essentially the same manner as in AIPS,
except that HELP is simplified and has no argument and PRTMSG has
no controlling adverbs.
