@V7 54 2 -5
@L5 HIUK1047
0
85  85  85  85  85  85  85  85
85  85  85  85  85  85  85  85
85  85  85  85  85  85  85  85
85  85  85  85  85  85  85  85
85  58  78  85  85  127 90  60
85  85  90  85  85  85  85  85
85  85  85  85  85  85  85  85
85  85  85  85  85  85  85  85
100 91  99  107 109 93  90  109
111 50  82  93  78  127 112 109
90  109 100 89  90  115 95  127
86  83  87  55  72  55  80  91
60  84  87  82  87  84  50  87
83  46  46  74  46  125 83  85
87  87  61  76  45  83  65  100
63  65  65  55  50  55  85  127
@L3 COUK1247
80
@V9 0
@YCHAPTER 2 - MUSS USER MANUAL
@G@RCHAPTER 2 - USING THE SYSTEM@G
@V10 1 9 6
@T% 10
@BThis chapter gives an introduction to the simple use of the MUSS
operating system.  More detailed descriptions of particular areas are
given in later chapters.  Because MUSS is primarily an interactive
system, the emphasis in this chapter is on interactive operation,
but all of the commands described can be used equally well in both
batch and interactive contexts.
@S22.1  INTERACTIVE OPERATION
@S32.1.1 General
@BThe MUSS Basic System is designed primarily for interactive use via
serial teletype-like devices, and the system normally responds to
input only after a complete line has been entered.  Except when a
screen editor is being used a line of input
is terminated by typing either a carriage return (CR) or a newline
(NL) character; in the former case the machine will precede the
next output by a newline. Screen editors will reconfigure the terminal lines so
that each character is made available as it is read.  After processing a line of
 input, the
system usually responds with a prompt requesting further input.  In
general this prompt may be any sequence of characters, but
a number of standard prompts are defined for certain common
situations.  These are:@
@T% 30
@
Identification@IThis takes the form of a two line message
identifying the operating system version, the machine and the
terminal identification.  It indicates that
the terminal is currently idle, and a valid logging in
command (see 2.1.2 below) must be given before it can
be used.@
@
**@IThe terminal is logged in, and the system expects
the next line to be a job control command (see 2.3 below).@
@
->@IThis prompt is used quite commonly in cases other
than the above, for example by an editor.
@BA further common convention is that when text is being input, during
editing or in the NEW command, the system prompts with the
character which will terminate the text input.
@BAt any time while a line is being input, the last character
typed may be deleted by typing the backspace character (CONTROL H).
This may
be repeated as often as necessary to delete further characters, as
far as the start of the line.
@BA user's job may be interrupted at any time by pressing
the BREAK key on the terminal (or control C).  The effect of doing this depends
upon what the job is doing at the time, because the break-in interrupt may be tr
apped at user level.  In many cases the
current activity will be abandoned, and the system will prompt
for a new job control command. Another form of interruption can
be caused by typing the XOFF character (CONTROL S) while the job is outputting
on the terminal.  The effect of this is to halt the output until
an XON character (CONTROL Q) is input.
When a terminal does not respond as expected for a user wishing
to log in, the reason may be due to the state it has been left in by a
previous user.  Usually one of XON, break or ***Z (see below) will
recover normal operation.
@S32.1.2 Logging in
@BBefore using the system, a user must identify himself by
logging in.  The normal logging in command is@
@
@
@M***M JOB username password jobname options.
@BWhere 'JOB' identifies the supervisor to be used, 'username' and
'password' identify the user who is logging in, 'jobname' is the
name the user wishes to call his job.  All of this information must
be supplied, but the user may also optionally supply a
time limit in seconds and a priority for his job.  For an interactive job,
priorities in the range 8-11 should be specified, where 8 is
the highest priority; if no priority is given, priority 10 will be
used.  High priority should result in a faster response relative
to other jobs, but high priority jobs are charged for their
processing time at a higher rate than low priority ones.
@BProvided that the logging in command was satisfactory, the
system will respond by printing the jobname, time and date, and a
prompt for a job control command (**).@
@Q 7
@T% 10
@
examples:@
%***M JOB X03 XPMGRZS X03ED@
%***M JOB X03 XPMGRZS X03COMP C1000@
%***M JOB X03 XPMGRZS X03FAST P8@
%***M JOB X03 XPMGRZS X03SHORT P8 C10@
%***M JOB X03 XPMGRZS X03LONG C10000 P10@
@S32.1.3 Logging out
@BTo log out from the system, the STOP command is
used.  This prints the time and date, and the amount of
processing time used, and sets the terminal into an idle state
so that a subsequent line of input will result in the
'LOGIN:' prompt.
@S22.2  BATCH OPERATION
@BAll of the basic system commands of MUSS can be used
in batch mode as well as interactively.  The output from a
batch job is normally sent to a lineprinter close to the point
where the job was submitted.  The only changes required to run
a job in batch mode are@
@
@
i)@IThe first line should be identical to the logging-in command
described above, except that it begins with ***A
instead of ***M.@
ii)@IPriorities 12-15 should be used for batch jobs, with 15 meaning
lowest priority.  If no priority is specified, 14 will be used.@
@IThe STOP command should be followed by '***Z' on a
line by itself.@
@U 8
@
Example of a complete (but useless) batch job:
@
***A JOB X03 XPMGRZS X03COMP2
@
STOP
@
***Z
@S22.3  JOB CONTROL COMMANDS
@BAfter successfully logging in (or after the '***A' line of a
batch job), the user types commands which direct the execution
of the job.  The interactive system prompts with '**' whenever it
is expecting such a command.
@BAll of the commands which may be used are
procedures in the system library (or in some private user
library, see Chapter 21).  In fact, any procedure in the
system library can be used as a job control command.
Conversely anything which can be used as a command can also
be called as a procedure, by programs in any of the
programming languages supported by the system.  For more details,
refer to the specific language chapters in this manual.
@S32.3.1 Command Format
@BA command is input as the name of the command to be
called, followed by its parameters if any.@
@
@
@MCOMMAND PARAM1 PARAM2 ... PARAMn
@BThe command name and its parameters are separated
by spaces and the entire command is terminated by a newline.
Rightmost parameters may be omitted, in which case zero will be substituted;
most of the commonly-used commands will assume a suitable default
value in this case.@
@
@
Command Examples (the parameter forms are explained below).
@Q 6
@T% 20
@
@
LIST.FILE PROG LPT*%lists the file PROG on the lineprinter@
LIST.FILE PROG%lists the file PROG on the terminal@
LIST.FILE 0 LPT*%lists the "current file" on the lineprinter@
LIST.FILE%lists the "current file" on the terminal.@
@BIn the command descriptions in this Manual, many of the command
names contain the character '.', for example LIST.FILE.  This is for
readability only, and is not actually required, and '.' typed
anywhere in a command name will be ignored.
@BOptionally, the command name may be preceded by two asterisks@
@
@
@M**LISTFILE PROG.
@BThis form is normally only used if commands are to be executed
during compilation of a program; all of the system compilers
recognise lines beginning with '**' and interpret such lines
immediately as job control commands.
@S32.3.2 Command Abbreviations
@BAll of the commands are in fact procedures in the system
library.  Some of these procedures have a unique two or
three letter abbreviation which may be used instead of the
full procedure name.  For example, LISTFILE may be abbreviated to LF.
The abbreviations are shown in the headings of the command descriptions given in
 this Manual, as underlined characters, and also in
the summary of commands in the INDEX where the letters of the abbreviation are u
nderlined.
@S32.3.3 Parameters
@BMany of the procedures in the system library require parameters
and return results.  These may be of five different types, denoted
in this manual as I, II, R, A and C.  I represents a single
length integer value equivalent to the type
INTEGER in MUSL;
II represents a 64-bit item
(LOGICAL64 in MUSL) which
in most cases is used to pass an 8-byte packed character
string; R represents a real (floating point) item; A represents
an integer of the basic address length of the computer (ADDR);
C represents a single character (LOGICAL8).
In addition to these three basic types, vectors may be
specified (denoted [I], [II] and [C]), and also pointers
or ADDR type variables
(denoted ^I, ^II and ^C).  The distinction between [I] and
^I is that [I] represents a specific number of integer elements,
whereas ^I merely points at one such object and can be used to
access any number of integers starting at that point.
A sixth type of parameter, a pointer to a
procedure, is also occasionally used.  This is denoted
by the letter P.
Also user defined libraries, and indeed some of the
utilities programmed in the normal user languages (e.g.
PASCAL) may have parameters of user defined type.
@BWithin the command descriptions, the
types of the parameters are indicated by the command
heading, e.g.@
@
@
@MLIST.FILE([C],[C],I,I).
@BThis means that LIST.FILE has four parameters, of which the first
two are vectors of characters and the last
two are integers.  The parameters are referred to individually
as P1, P2, etc.  Some command descriptions may also refer
to a set of global variables PW0, PW1, etc (of size ADDR) and PWW0,
PWW1, etc. (of size II).  These are sometimes used for passing
results back from library procedures and are not usually
of importance in job control contexts, with the exception of PW0
which returns status information on completion of a
command.  If PW0 = 0, the command completed successfully;
otherwise PW0 contains a fault number.  The fault numbers are
listed in Appendix 2, but the command interpreter will
normally output a suitable error message if such a fault
is detected.
@BJob control parameters may be written in three different ways:
as a decimal integer, a hexadecimal value, or a character string.
@BThe decimal integer form is the normal representation for
parameters of type I.  If it is used for either of the other two
parameter types, it will be interpreted as a character string of
decimal digits.  An exception is the decimal integer '0', which
is always treated as a numeric zero (this allows zero values
to be supplied for parameters of type II and ^C, to obtain
default actions).  The decimal integer may be preceded by a '+'
or '-'.
@BThe hexadecimal form may be used for any type of parameter.  The
@X%~
hexadecimal number is preceded by '%', and repetition of
@X%%
a digit may be indicated by a positive integer in brackets
@X%~
(e.g. %F0(3)F is the same as %F000F).  The number is
@X%%
evaluated as an II quantity, and converted if necessary to
the required size.
@BCharacter strings are permitted for parameters of type II
and [C].  For II parameters, the characters are packed, right
justified, and zero filled into a 64-bit word.  If too many
characters are supplied, the last eight are taken.
For a [C]-type
parameter a descriptor to the whole string is created.
@S22.4  USING FILES AND DOCUMENTS
@BA high proportion of all job control commands, and many of
their parameters, are concerned with setting up inputs and outputs.
Physical input/output exists as "documents", which may take a
variety of forms: for example, a deck of cards; a lineprinter
listing; a file, or a "conversation" at an interactive terminal.
Within a job, documents are assigned to @5streams@0 for processing,
using commands which are described in detail in Chapter 3.
However, many of the most commonly used system commands
have parameters which relate directly to input and output documents,
and assign these documents automatically to streams for the user.
This kind of parameter is referred to as a "document name".
@S32.4.1 File and Directory Names
@BEach user has his own set of files and their details
will be kept in a directory associated with the user.  The files
will have names of up to 16 alpha-numeric characters.  Subject to the
necessary permissions being set, as described in Chapter 5, a user
may access the files of another user.  The notation for this is to
precede the file name by 'USERNAME:',
where USERNAME is the name of the
root directory which the system provides for each user.
Also a user may create a
'tree' of files by introducing new subdirectories which are
named like files.  In this case a file is identified by preceding
its name by the names of all the subdirectories on the path
to the file.  Thus in general a file name has the form@
@
@MUSERNAME: DIRECTORY NAME/DIRECTORY NAME/---/FILENAME.
@
@
This will subsequently be referred to as a @5filename@0.  If the
file is in a user's own filestore the 'USERNAME:' can be omitted.
Some commands only allow the latter form and this will be denoted by the
term @5local@0 @5filename@0.
@BThere are some commands which allow directories (or subdirectories)
to be specified.  The notation for these is as for files except the
name will be truncated at the required directory.  They will be
referred to as @5directory@0 @5names@0 and @5local@0 @5directory@0 @5names@0.
@BWhen a subdirectory is selected, @5local filenames@0 and @5local
directory names@0 will normally describe the path from the subdirectory.
However, special forms of these names are allowed which start with
'/' and the path which follows this is assumed to be from the user's
root directory.
@S32.4.2 Document Names
@BGenerally there are three main "kinds" of document which may
be used, and three corresponding forms of document name.
These are:@
@
@
i)@IA file, in this or another user's filestore,
with the notation as described in Section 2.4.1.@
@
@
ii)@IAn input/output device, or process.  Output can be directed
to any process in the system, by giving the process name followed by
'*' as the document name.  This is mainly used to send output to
device controllers, such as LPT* (the lineprinter), PTP* (paper tape punch).
For example
LISTFILE FILE1 LPT*.
If output is to be discarded completely, the document name * may be used.@
@
@INormally only supervisors accept input directly from devices and
other processes.  For this, the DEFINE.INPUT command described in
Chapter 3 must be used.@
@
@
iii)@IA stream which has already been assigned a document, using the
DEFINE.INPUT or DEFINE.OUTPUT commands described in Chapter 3.  In this
case the special name STRn* (for stream n) may be used.  Example
LISTFILE FILE1 STR2*.
@S32.4.3  The Current File
@BThere is one further kind of document, called the @5current file@0.  This is
like a file, but it exists only for the duration of the job unless some explicit
action is taken to save it as a permanent file.  The corresponding document name
 is zero,
and so it can be used as a default parameter that is, if no document name is spe
cified by a command,
then the current file will normally be used instead.
@BAt the start of a job the current file is undefined.
Certain commands, described later in this chapter, allow the
user to set and alter the current file.  Once it has been defined,
omission of an input document name parameter will normally
result in the current file being used instead.  If an input document
name is omitted when no current file is defined, or when the current file has
already been assigned to another stream, the currently selected input stream
is used.
@BIn the case of output documents, omission of the parameter causes the
current file to be updated with whatever is output.  There are a few
commands which do not follow these general rules.  For example, LISTFILE
always defaults its output to the currently selected stream if the
parameter is omitted.
@S22.5  COMMONLY-USED COMMANDS
@S32.5.1  File and Current File Commands
@BThese commands allow the user to manipulate files and
set up the current file.
To access another user's files, the form "username:filename"
should be used (see Chapter 5).@
@
@
1) @JNEW([C],C)
@BThis command is normally used to input text files.  P1 is the name
of an output document to be created, and P2 is a single character
terminator.  Input is copied from the current stream to the specified
document, terminating when a line is found which starts with the
terminator.  If the terminator is omitted, '/' is used.  The system prompts
for more input using the terminator as prompt.@
@
@
2) @JOLD([C])
@BThis command designates a file, specified
by the @5filename@0 P1, as the current file.@
@
@
3) @JSAVE([C])
@BThis command preserves the current file as a permanent file.
P1 gives the @5filename@0.  If a file of this name
exists already, it will be replaced.
The file continues to be the current file.@
@
@
4) @J@ODEL@OETE([C])
@BThis command is used to erase a file whose @5filename@0 is given by P1.  If
P1 is zero, the current file is deleted.@
@
@
5) @J@OREN@OAME([C],[C])
@BThis command is used to change the name of an existing file.
P1 specifies the old @5filename@0, P2 specifies
the new name, which may not involve ':' or '/' and will be
assumed to be in the same directory as the old @5filename@0.
If the new file name already exists in the directory, an
error is signalled.@
@
@
6) @J@OL@OIST.@OD@OIR(C,[C],[C])
@BThis command lists, on the currently selected output stream, the
files in the current user's directory.
@BP1 is used to indicate the level of detail required in the directory
listing, as follows:@
@Q 5
@T% 10 20
@
%P1 =  0%File limits and list of file names.@
%P1 = "N"%File limits and list of file names.@
%P1 = "L"%File limits only@
%P1 = "A"%All information.
@BP2 may be used to select a subset of the files in the directory.
If P3 is non-zero, only files whose names contain the string P3
will be listed.
@BP3 is a @5directory name@0 which maybe omitted if the current
directory is required.@
@
@
7) @J@OL@OIST.@OF@OILE([C],[C])
@BThis command is used to list a text file.
P1 specifies the document to be listed, and P2 the destination document.  If P2
is zero, the listing is on the currently selected output stream.
@
@
@
8) @J@OC@OOPY.@OF@OILE([C],[C])
@BThis command copies the binary data from the file specified by P1
to the file given by P2.
@
@
@
9) @J@OED@OIT([C],[C],I)
@BThis command invokes a simple editor to modify a text file.  A complete
specification of this and other editors appears in Chapter 5.
@
@
10) @JLIST.PERMIT([C],[C],[C])
@BThis command lists, on the currently selected output stream,
the file permissions associated with a file directory.
@BP1 may be used to select a subset of the permissions.  If P1 is
non-zero, only files whose names include the string P1 will be listed.
Similarly, P2 may be used to select a subset of the user names
for whom permissions have been granted.
P3 specifies a @5directory@0 @5name@0.  If P3 is not given
the current directory will be assumed.
@
@
@
11) @JCOMPARE([C],[C],I)
@BThis procedure compares the documents given by P1 and P2,
monitoring the differences on the current output stream.  The
format of the output is controlled by P3.  If P3 is zero,
both versions of the lines which are different are printed.
If P3 is non-zero, the file P1 is listed with the relevent
lines marked with a ! at the start of each line that is different.
@S32.5.2 Compiling and Running Programs
@BAdditional instructions for compiling programs are given
in Chapter 9 onwards.  Here the rules for simple jobs are summarised.@
@
@
1) @JLANGUAGE([C],[C],I,I)
@BThe commands for the standard system compilers FORTRAN, COBOL,
PASCAL, MUSL, are all of this form
with the appropriate name substituted for LANGUAGE.
P1 is the document name for
the program to be compiled.
P2 is the document name for the compiler output.
The remaining parameters specify mode
and library information (see below), and may normally be omitted.
@BP3 has the bit significant encoding.@
@3
@U 15
@
                 @O|             | | | | | |   | 8 TL mode bits|@O
                                | | | | |  |
     INHIBIT LSPEC GENERATION -   | | | |  |
     RUN TIME M/C REAL SIZE       | | | |  |
     IS 64 BITS -----------------   | | |  |
     RUN TIME M/C REAL SIZE         | | |  |
     IS 32 BITS -------------------   | |  |
     SUPPRESS TL CALL ---------------   |  |
     SUPPRESS TL.END CALL --------------   |
     RUN TIME MACHINE SIZE ---------------
        00 AS COMPILE TIME MACHINE
        01 16 BIT ADDR 16 BIT INTEGER
        10 32 BIT ADDR 32 BIT INTEGER
        11 32 BIT ADDR 16 BIT INTEGER
@0
@BNormally a compiler will enclose the compiled code in the
MUTL statements@
@Q 6
@
@MTL
@NTLMODULE
@N  .
@NTLENDMODULE
@NTLEND
@BIt is only in situations where multi module programs/libraries
are to be compiled that the TL and TLEND statements need to be
suppressed.  The TL mode bits specify aspects of the compilation mode which one
set hold for the complete compilation and are described in Chapter 23,
but the main ones are@
@3
@U 6
@
@
                   @O|                 | | | |@O
                                      |   |
          COMPILE A LIBRARY ----------    |
          SUPPRESS RUNTIME DIAGNOSTICS ---
@0
@BOther aspects of mode, such as the control of optimisation and
the positioning of fields within types, are changed as required during
a compilation by TLMODE, further details are in Chapter 23.
@BWhen compiling a library P4 specifies the maximum number of
procedures permitted in the interface of the library.  If P4
is zero a suitable system default is used.
@BNote that if a library is to be used from the command
level it may only contain procedures whose parameters are
of the types described in 2.3.3.  If it is to be used by
programs, its procedure parameters may be any basic type or
pointer but not a user defined type.@
@
@
2) @JRUN([C])
@BThis command enters a program compiled by an earlier compilation
command, provided that the compilation was error free.
P1 is the @5filename@0 to which compiler output
has previously been sent.@
@
@
3) @J@OLIB@ORARY ([C],I)
@BThis command loads a precompiled library P1 and links it
in to the library directory structure so that its procedures
become available as are the system library procedures.
P1 is the file name of a compiled library.
P2 is the mode in which the library is to be opened.
When a library procedure name is given, the most recently loaded library directo
ry is
inspected first, therefore any
user library procedures with the same names as system
library procedures will take precedence over the corresponding
system procedures.
The facilities provided for creating library files
are described in Chapter 21.
@BP2 has a bit significant encoding and is interpreted as follows:@
@3
@U 8
@
@
                                   |@O               |c|b|a|@O
                                                   | | |
                                                   | | |
     (c) Load Directory Only ---------------------   | |
     (b) Inhibit Inialisation Code Execution -------   |
     (a) Permanently Map -----------------------------
@0
@S@ONotes@O
@T% 10
@
@
(a)@IA zero value indicates that the library is to be
used in the 'normal' mode for the machine in question.
Normal mode on machines with large virtual memories
means that the library document is opened into the
virtual memory.  For machines with small virtual
memories the norm is to overlay (MAP) the library document
into virtual memory on each call,
a value of one indicates that the library is to be permanently mapped.@
@
(b)@IWhen set it indicates that the initialisation code of the
library is not to be executed.@
@
(c)@IWhen set it indicates that only the directory of the
library is to be loaded.@
@
@
4) @J@OR@OELEASE.@OL@OIB ([C])
@BThis command unloads a user library (P1) and unlinks it from
the library directory structure.
P1 should be the final actual filename rather than a
full @5filename@0.
@BIf P1 = 0 all libraries except the basic system library
are unloaded.
@S32.5.3 Commands for job sequencing etc
@
@
1) @J@OST@OO@OP@O (I)
@BThis command terminates the job, after disposing of its
output streams.  The current file is discarded.  P1 is a
"reason code" for the termination.  Zero indicates normal
termination.  A negative value indicates an abnormal (error)
termination, in which case any remaining file outputs are not updated
(see Chapter 3.  DEFINE.OUTPUT).@
@
2) @JIN ([C])
@BThis command causes job control commands to be read
from the specified input document (P1).  If P1 contains the
string "-1" the previously selected input document is
restored.@
@
3) @J@OR@OUN.@OJ@OOB ([C],[C],[C])
@BThis command is used within one job to initiate
execution of another as a separate (background) job.
P1 is the name of an input document on which job
control commands for the new job may be found.  If it
is left unspecified and no current file is defined, the
commands for the new job are input from the current
stream terminated by '/' at the start of a line.  P2 is
the name of the supervisor to which the job is to
be submitted, in the form "process name*" or "process name*/machine
name".  If P2 is left unspecified, JOB is assumed.  P3 is the "header"
(i.e. ***A line) for
the new job, with the "***A supervisor name" omitted.
If P3 is left unspecified, a header line of the form
"username password title" will be generated, where username
and password specify the current user and title is a unique
jobname.@
@
4) @JKILL (II)
@BThis command may be used by any user to kill
one of his own jobs, or by the operator to kill
any job.  P1 gives the name of the job to be terminated.@
@
5) @JPPC.SEQ (I)
@BThis procedure processes one or more job control commands
from the current input stream.  If P1=0, commands are processed
as for a batch job; with P1 nonzero, commands are processed
as for an interactive job.@
@
6) @JPPC.CMD
@BThis procedure reads and processes a single job control
command from the current input stream.
@S22.6 JOB CONTROL EXAMPLES
@
@
(1) A 'Null' Job
@BThis is an example of a background job which does nothing useful, but
it illustrates the small amount of red tape required by all jobs.  The
meaningful commands would be placed before the STOP command.@
@Q 6
@T% 10
@
%***A JOB USER PASS NULLJOB@
%STOP@
%***Z@
@
@
(2) A 'Null' Fortran Job
@BThis job illustrates the structure required
to compile and run an Fortran program.  The actual program
would be placed after the FORTRAN command and before the END statements.  The *E
ND statement
is needed at the end of all programs submitted to the MUSS compilers
in order to end the compilation and switch back to command mode.
A temporary return to command mode, for example to select
a new input stream, can be made by embedding commands preceded
by '**' in the program text.  If a program requires
input data it should be placed between the RUN and STOP
commands.  A user program may return to command level
by executing the final end.@
@Q 12
@T% 10
@
@
%***A JOB USER PASS NFTN@
%FORTRAN@
%.@
%.@
%.@
%      END@
%      *END@
%RUN@
%STOP@
%***Z@
@
@
(3) A Fortran Job Using a File
@BThis job illustrates two actions which would
normally be used only by on-line users.  The first is the creation of
a file (FILEX) which is followed by
a call on the Fortran compiler to compile the file,
after which is a RUN command to run the program.@
@Q 13
@T% 10
@
%***A JOB USER PASS FJOB@
%NEW FILEX@
%.@
%.@
%.@
%      END@
%      *END@
%/@
%FORTRAN FILEX@
%RUN@
%STOP@
%***Z@
@
@
(4) A Fortran Job Using the Current File
@BThe facility illustrated here would again be used by
on-line rather than background jobs, but it
suffices to illustrate the mechanism.  It is similar to the
previous example, except that the file name has been omitted
in the case of both the NEW and FORTRAN commands, hence
the current file is used.  This ceases to exist when a job
ends, unless it is saved as a permanent file by the SAVE
command also illustrated here.  It should be noted that if
any command fails, those following will not be executed.
Thus if the program is faulty the file will not be saved.@
@Q 14
@T% 10
@
%***A JOB USER PASS CFJOB@
%NEW@
%.@
%.@
%.@
%      END@
%      *END@
%/@
%FORTRAN@
%RUN@
%SAVE FILEX@
%STOP@
%***Z@
@
@
(5) Saving a Compiled Fortran Program as a File
@BA compiled program can be saved, for subsequent running in a
file specified as the second compiler parameter.@
@Q 5
@T% 10
@
%***A JOB USER PASS COMP@
%FORTRAN CJT: FORTRANPROGS/P1 FILEY@
%STOP@
%***Z@
@BIn this example a program in a file P1 from the subdirectory FORTRANPROGS of t
he user CJT is compiled and the
binary code is saved in a file FILEY of the current directory.  The program can
subsequently be run by
giving FILEY as the parameter of the RUN command.  For example@
@Q 5
@T% 10
@
%***A JOB USER PASS RUN1@
%RUN FILEY@
%STOP@
%***Z@
@BIf the program needs data it could appear after the RUN command.
If it needs input/output streams other than the default (zero) they would be def
ined before
the RUN command.
A similar mechanism allows a private library of procedures to be
compiled and filed.  They can subsequently be used as commands or by
programs and in effect are an extension of the system library.
@
@
(6) An Example Interactive Session
@BIn the example given below the computer output is
distinguished from the user's input, by the former being bold and the latter bei
ng in italics.
On the actual system the fonts will normally be the same.
@BThe first command used after the log-in line is NEW, which is
used to input to the current file a Fortran program, for computing prime numbers
.
This is followed by the FORTRAN command which compiles
the program but finds one error.  These are corrected by editing
the current file.  The first edit statement copies to line 16 and
'windows' the line.  The second means@
@Q 4
@
@Mdelete IR
@Ninsert 'RI'
@Nand window.
@BPositions may also be selected by context but it is more convenient
to use line numbers when a compiler gives them with the error reports.
At the second attempt the program compiles correctly and it is entered
by the RUN command.  Since the program contains a call for the READ
procedure which reads an integer, it prompts for data.  When it is
given the integer 20 it computes all prime numbers less than 20, and
returns to command mode as a result of executing the
STOP.  However, a mistake in the program causes all ones to be
printed.  On examining the program it is clear that PRIMES(P)
should have been set to I not 1 so this is corrected by editing.
The program is recompiled and then runs correctly.
At this point the current file
is saved and listed, and the user logs out.
@
@
@GMUSS ISSUE 11 VERSION 2 ON@G@
@GVAX02 DEVICE 28 CHANNEL 14@G@
@5***M JOB D4 XXX DEMON@0@
   @GDEMON             10:20:49 09-SEP-83@G@
@G**@G@5NEW@0@
@G/@G      @5INTEGER SIEVE(1000),PRIMES(200),LIM,P,J@0@
@G/@G      @5WRITE(*,200)@0@
@G/@G  @5200 FORMAT(1X,'TYPE PRIMES LIMIT,I3 FORMAT PLEASE')@0@
@G/@G      @5READ(*,100)LIM@0@
@G/@G  @5100 FORMAT (I3)@0@
@G/@G      @5DO 1 I =1,LIM@0@
@G/@G    @51 SIEVE(I) = 0@0@
@G/@G      @5P = 0@0@
@G/@G      @5DO 2 I = 2,LIM@0@
@G/@G        @5IF (SIEVE(I) .NE. 0) GO TO 2@0@
@G/@G        @5P = P + 1@0@
@G/@G        @5PRIMES(P) = 1@0@
@G/@G        @5DO 3 J = I,LIM ,I@0@
@G/@G    @53   SIEVE(J) = 1@0@
@G/@G    @52 CONTINUE@0@
@G/@G      @5WIRTE(*,201)LIM@0@
@G/@G  @5201 FORMAT(1X,'PRIMES UP TO ',I3)@0@
@G/@G      @5WRITE(*,202) (PRIMES(I), I = 1,P)@0@
@G/@G  @5202 FORMAT(@G/@G(1X,8(I3,4X)))@0@
@G/@G      @5STOP@0@
@G/@G      @5END@0@
@G/@G      @5*END@0@
@G/@G@5/@0@
@G**@G@5FORTRAN@0@
@GSEGMENT    3 CREATED@G@
@GSEGMENT    4 CREATED@G@
@
@GMUSS.11 FORTRAN AUG.83 AT 10:27:47 ON 09-SEP-83@G@
@
@G1.16      WIRTE(*,201)LIM@G@
                    @G^@G@
 @G**ERROR** invalid syntax@G@
    @G1 **ERROR** MESSAGE(S) ISSUED DURING COMPILATION@G@
@GFINISHED AT 10:27:57 ON 09-SEP-83@G@
@G**@G@5EDIT@0@
@G->@G@5C+15W@0@
@G1.16@G@
~^~      @GWIRTE(*,201)LIM@G@
@G->@GD@5/IR/I/RI/@0@
@G->@G@5W@0@
@G1.16@G@
                 @GWRI~^~TE(*,201)LIM@G@
@G->@G@5E@0@
@G<CFILE>  AT 10:32:57 ON 09-SEP-83 OK@G@
@G**@G@5FORTRAN@0@
@GSEGMENT    5 CREATED@G@
@GSEGMENT    6 CREATED@G@
@
@GMUSS.11 FORTRAN AUG.83 AT 10:33:30 ON 09-SEP-83@G@
@GFINISHED AT 10:33:31 ON 09-SEP-83@G@
@G**@G@5RUN@0@
@GTYPE PRIMES LIMIT,I3 FORMAT PLEASE@G@
@G->@G@5020@0@
@
@GPRIMES UP TO 20@G@
@
  @G1    1    1    1    1    1    1    1@G@
@
@
@
@GSTOPPED AT 10:34:48 ON 09-SEP-83 LINE   1.20@G@
@G**@G@5EDIT@0@
@G->@G@5C/PRIMES(P)/W@0@
@G1.12@G@
~^~       @GPRIMES(P) = 1@G@
@G->@G@5D/1/I/I/W@0@
@G1.12@G@
        @GPRIMES(P) = I~^~@G@
@G->@G@5E@0@
@G<CFILE>  AT 10:36:26 ON 09-SEP-83 OK@G@
@G**@G@5FORTRAN@0@
@GSEGMENT    7 CREATED@G@
@GSEGMENT    8 CREATED@G@
@
@GMUSS.11 FORTRAN AUG.83 AT 10:36:53 ON 09-SEP-83@G@
@GFINISHED AT 10.37.52 ON 09-SEP-83@G@
@G**@G@5RUN@0@
@GTYPE PRIMES LIMIT,I3 FORMAT PLEASE@G@
@G->@G@5020@0@
@GPRIMES UP TO 20@G@
@
  @G2    3    5    7    11    13    17    19@G@
@
@GSTOPPED AT 10:37:20 ON 09-SEP-83 LINE   1.20@G@
@G**@G@5SAVE DEMO@0@
@G**@G@5DELETE@0@
@G**@G@5LISTFILE DEMO@0@
                 @GINTEGER SIEVE(1000),PRIMES(200),LIM,P,J@G@
                 @GWRITE(*,200)@G@
             @G200 FORMAT(1X,'TYPE PRIMES LIMIT,I3 FORMAT PLEASE')@G@
                 @GREAD(*,100)LIM@G@
             @G100 FORMAT (I3)@G@
                 @GDO 1 I =1,LIM@G@
               @G1 SIEVE(I) = 0@G@
                 @GP = 0@G@
                 @GDO 2 I = 2,LIM@G@
                   @GIF (SIEVE(I) .NE. 0) GO TO 2@G@
                   @GP = P + 1@G@
                   @GPRIMES(P) = I@G@
                   @GDO 3 J = I,LIM ,I@G@
               @G3   SIEVE(J) = 1@G@
               @G2 CONTINUE@G@
                 @GWRITE(*,201)LIM@G@
             @G201 FORMAT(1X,'PRIMES UP TO ',I3)@G@
                 @GWRITE(*,202) (PRIMES(I), I = 1,P)@G@
             @G202 FORMAT(/(1X,8(I3,4X)))@G@
                 @GSTOP@G@
                 @GEND@G@
                 @G*END@G@
@G**@G@5STOP@0@
@G10:38:25 09-SEP-83 CPU USED 14 STOP REASON 0@G@
@F
