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.

  1. DELETED
    The condition is satisfied if the program has been deleted by a DEL or DELTY instruction or by a DELETE command.

  2. 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.

  3. HALTED
    The condition is satisfied if the program has been deleted by a SUSWT or SUSTY instruction or by a HALT command.

  4. 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
  5. MONITOR
    The condition is satisfied if a MONITORed event has occurred in the program.

  6. 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:

    1. 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.

    2. DISENGAGED,peripheral name
      The program issued a PERI for the specified on-line peripheral when it was disengaged.

    3. 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.

    4. 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.

  7. FAILED
    The condition is satisfied if the program has failed or put into a failed state by a FAIL command.

  8. 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:

    1. ILLEGAL INSTRUCTION
      This covers any program failure that does not fall into any of the other categories.

    2. FILE peripheral name EXHAUSTED
      The input file connected to the specifies peripheral is exhausted.

    3. 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.

    4. 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.

    5. ONLINE peripheral name FAIL
      The specified on-line peripheral has failed.

    6. TIME UP
      The program timer has run out.

    7. UNALLOCATED peripheral name
      The specified peripheral does not belong to the program, and the program has attempted to use it.

    8. 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

  9. MEMBER number
    This condition is satisfied if the most recent program event occurred in the program member with the specified member number.

  10. DISPLAY
    This condition is satisfied if there is a display message set as the current display of the job.

  11. DISPLAY enclosed string
    As many characters as are given are compared with the current display of the job.

  12. REPLY
    This condition is satisfied if there is a reply set as the current reply of the job.

  13. 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.

  14. 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.

  15. 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.

  16. ABSENT enclosed string
    This condition is satisfied if there is no parameter beginning with the specified character string at the current level.

  17. 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.

  18. 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.

  19. ZERO number list
    This condition is satisfied if each of the numbers in the list is zero.

  20. POSITIVE number list
    This condition is satisfied if each of the numbers in the list is greater than zero.

  21. NEGATIVE number list
    This condition is satisfied if each of the numbers in the list is less than zero.

  22. TRUE
    This condition is always satisfied.

  23. FALSE
    This condition is never satisfied.

  24. CORE
    This condition is satisfied if one of the current contexts of the job is CORE IMAGE.

  25. MOP
    This condition is satisfied if one of the current contexts of the job is MOP.

  26. USER
    This condition is satisfied if one of the current contexts of the job is USER.

  27. FINISH
    This condition is satisfied if a FINISH command has been issued previously and has not been cancelled.

  28. 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:

  1. SYS - (M275)
    This condition is satisfied if the job is system-issued.

  2. FST - (M275)
    This condition is satisfied if the job is fully started.

  3. TST - (M275)
    This condition is satisfied if the job is tentatively started.

  4. 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.

  5. 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.

  6. 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,....