ICL 1900 Series George 3 Operating System Commands
IF (IF)
Function
Causes a command to be obeyed if and only if a specified condition is
satisified.
Format
IF condition,command
IF condition,(command)ELSE(command)
The command parameter may be any appropriate command (including
another IF command), but it must not be labelled.
The condition may consist of any of the simple conditions listed
below, possibly preceeded by NOT, or it may be a combination of simple
conditions, seperated by AND, OR, AND NOT or OR NOT. Parantheses may be
used to group sub-expressions in the usual way, but otherwise the normal
rules for grouping logical expressions apply (NOT stronger than AND
stronger than OR). Note that these seperators must be preceeded and
followed by at least one space.
Simple Conditions
For the purpose of this command only, an enclosed string may be enclosed
by apostrophes, parentheses, quotes, question marks or solidi (/). Spaces
in a string are only significant if the string is enclosed in quotes or
apostrophes. Where a comparison is made between two character strings, the
condition '=' is satisfied if the strings are identical. The condition '<'
is satisfied if the strings match up to the end of the left-hand string and
the condition '>' is satisfied if the strings match up to the end of the
right-hand string.
Only the first three characters of the word or words introducing a simple
condition are significant and abbreviations may be made accordingly.
Conditions 1 to 9 refer to events in a program (Program Events) which
cause the job to return to command level, after which event the program
can be continued by the use of a RESUME or ENTER command; the remaining conditions are
miscellaneous and do not correspond to program events.
- DELETED
The condition is satisfied if the program has been deleted by a DEL or
DELTY instruction or by a DELETE command.
- DELETED enclosed string
As many characters as are given in the character string are compared
with the message with which the program was deleted. The condition is
satisfied if they match.
- HALTED
The condition is satisfied if the program has been deleted by a SUSWT
or SUSTY instruction or by a HALT command.
- HALTED enclosed string
As many characters as are given in the character string are compared
with the message with which the program was halted. The condition is
satisfied if they match.
s
- MONITOR
The condition is satisfied if a MONITORed event has occurred in the
program.
- MONITOR enclosed string
This condition covers events which are not normally program events,
but which can be made so by use of the MONITOR command. Note however that the DEL and
DELTY extracodes never generate an event covered by these conditions
and that if monitoring is set on DELETE, they generate events of the
HALTED category (covered by conditions 3 and 4 above). If an enclosed
string is specified, the string is compared with the message associated
with the particular event; this will be one of the following:
- DISPLAY
The program has issued a DISP or DISTY extracode when monitoring
was turned on for displays. To test the display message,
condition 11 below must also be given.
- DISENGAGED,peripheral name
The program issued a PERI for the specified on-line peripheral
when it was disengaged.
- monitoring expression,peripheral qualifiers
If the appropriate monitoring has been set (see
MONITOR) a message
of this type may be generated by CONT, DIS, REL, RENAME, some
ALLOT, and unanticipated OPEN mode and CLOSE mode PERI
extracodes.
- MONRESUME COMPLETED
The object program has been re-entered by the
MONRESUME
command following a monitor event of type 6.3 above. The
parameter STOP has instructed a return to command level after
the monitored extracode has been re-obeyed.
- FAILED
The condition is satisfied if the program has failed or put into a
failed state by a FAIL
command.
- FAILED enclosed string
This condition covers program events due to a failure in the program.
If an enclosed string is specified, the string is compared with the
message associated with the particular event; this will be one of the
following:
- ILLEGAL INSTRUCTION
This covers any program failure that does not fall into any
of the other categories.
- FILE peripheral name EXHAUSTED
The input file connected to the specifies peripheral is
exhausted.
- OUTPUT peripheral name FILE FULL
The output file connected to the specifies peripheral is
full, that is, the absolute limit on the size of a filestore
file has been reached.
- OUTPUT peripheral name LIMIT
The program has exceeded the LIMIT (set in the
ASSIGN command or
taken from the value of the VOLUME installation parameter) on
the number of PERIs to the file allowed on this run.
- ONLINE peripheral name FAIL
The specified on-line peripheral has failed.
- TIME UP
The program timer has run out.
- UNALLOCATED peripheral name
The specified peripheral does not belong to the program, and
the program has attempted to use it.
- ILLEGAL: text
Where the instruction is illegal GEORGE will, if possible,
provide a more usefule message than 8.1 above. The purpose
of this message is to help the user discover what has gone
wrong, but it is unwise for him to rely on obtaining an
appropriate message. The text of the message will be one of
the following:
- BUFFER OUT OF RESERVATIONS
- CHARACTER ADDRESS NOT VALID
- CONT FAILURE
- CONTROL AREA OUT OF RESERVATIONS
- COUNT OUT OF RANGE
- MODE IN ERROR
- RESERVATION VIOLATION
- MODES INCOMPATIBLE
- NO CSN IN WORD n
- INVALID CONTROL AREA WORD n
- BEGINNING OF FILE VIOLATION
- END OF FILE VIOLATION
- MODE NOT RECOGNISED
- MODE NOT AVAILABLE ON THIS UNIT
- MT HAS NO WPR
- WRITING NOT PERMITTED
- MODE SEQUENCE ERROR
- PERIPHERAL ALREADY OPENED
- MEMBER number
This condition is satisfied if the most recent program event occurred
in the program member with the specified member number.
- DISPLAY
This condition is satisfied if there is a display message set as the
current display of the job.
- DISPLAY enclosed string
As many characters as are given are compared with the current display
of the job.
- REPLY
This condition is satisfied if there is a reply set as the current
reply of the job.
- REPLY enclosed string
As many characters as are given in the string are compared with the
current reply of the job. The current reply is the last message output
to the monitoring file system, excluding messages in COMMANDS and
ONLINE categories; however, the exact wording cannot be guaranteed, a
consideration which should be borne in mind when using the command.
The delimiters of the 'enclosed string' determine whether spaces are
to be significant in the comparison in the same way as for other IF
conditions. The number of possible replies is very large and reference
should be made to the commands responsible for their issue for an
appropriate list.
- ON number list
This condition is satisfied if the on/off bits specified in the number
list are on. It is not satsified if there is no core image or if a bit
other than 0 to 23 is specified.
- OFF number list
This condition is satisfied if the on/off bits specified in the number
list are off. It is not satsified if there is no core image or if a bit
other than 0 to 23 is specified.
- ABSENT enclosed string
This condition is satisfied if there is no parameter beginning with
the specified character string at the current level.
- PRESENT enclosed string
This condition is the opposite of ABSENT. It is satisfied only if
there is a parameter beginning with the specified character
string.
- STRING enclosed string=enclosed string
This condition is satisfied if the two character strings are identical.
'=' may be replaced by '<' or '>', in which case the condition is
satisfied if the strings match up to the end of the first (<) or
second (>) string.
Note: The delimiters of the character strings must be consistent.
Either they must imply that spaces are to be significant in the
comparison or they must both inmply the opposite.
- ZERO number list
This condition is satisfied if each of the numbers in the list is
zero.
- POSITIVE number list
This condition is satisfied if each of the numbers in the list is
greater than zero.
- NEGATIVE number list
This condition is satisfied if each of the numbers in the list is
less than zero.
- TRUE
This condition is always satisfied.
- FALSE
This condition is never satisfied.
- CORE
This condition is satisfied if one of the current contexts of the job
is CORE IMAGE.
- MOP
This condition is satisfied if one of the current contexts of the job
is MOP.
- USER
This condition is satisfied if one of the current contexts of the job
is USER.
- FINISH
This condition is satisfied if a FINISH command has been issued previously and has
not been cancelled.
- EXISTS(file description)
This condition is satisfied if a file can be found which corresponds
to the file description given.
Additional conditions are available via Mend Exchange Scheme options:
- SYS - (M275)
This condition is satisfied if the job is system-issued.
- FST - (M275)
This condition is satisfied if the job is fully started.
- TST - (M275)
This condition is satisfied if the job is tentatively started.
- ONL(file description) - (M275)
This condition is satisfied if a file is online, a command error is
given if the file description is invalid or non-existant.
- OFL(file description) - (M275)
This condition is satisfied if a file is offline, a command error is
given if the file description is invalid or non-existant.
- PRI(privilege-name) - (M275)
This condition is satisfied if the privilege is held, a command error is
given if the privilege-name is invalid.
Forbidden contexts
None
Execution
The effect of the IF command is to evaluate the condition and then, only
if it is satified, to obey the command following the comma. Thus any error
in the command parameter of IF will fail to be detected unless the
condition is satisfied.
Examples
IF HALTED(ERROR),GO TO 7
IF DISPLAY'DI' AND OFF(3,7,19),GO TO 12
IF STRING(ABC)<(%A),IF NOT MEM2,GO TO 21
IF CORE,(RESUME)ELSE(GO TO 9FAIL)
Error Messages
ILLFORMED CONDITION
This message is given if there is a syntax error in the condition of the
IF command. In cases where it might be thought that an error message should
be given for some other reason, the condition will be found not satisfied.
For example, the ON and OFF conditions may be used when no core image
exists. This means that the following command will test whether a core
image exists:
IF NOT ON 1 AND NOT OFF 1,....