FANG — A File Utility

User Guide
by John Walker

Programming without FANG is like
watchmaking without a sledgehammer.

© Copyright 1972–1978 John Walker
This software is in the public domain


Introduction

FANG is a general purpose file utility program. FANG functions as an interpreter of commands which specify operations to be performed upon files named in the source language. Various commands allow files to be dumped, positioned, written, compared, and edited. Other commands permit manipulation of classes of elements in program files, and data files in SDF format.

FANG operates upon all types of files provided by the EXEC-8 system. Tapes are handled at the block level, while Fastrand and word addressable files may be accessed in terms of simulated tape blocks or random accessed by specifying a sector or word address.

FANG utilises overlapped input/output operations and concurrency of command execution to most efficiently use the facilities of the system. This mode of operation is transparent to the user, to whom it appears that commands are executed sequentially as entered.

Command Format

The Processor Call Statement

The interpretation of FANG commands is initiated with the control statement:

                  @FANG,<options>

where <options> are a string of letters that select modes for the operation of the FANG processor as a whole. These options may be changed within the source language itself (see the OPTION command, below). Valid options on the FANG control statement are:

Processor Call Options

        A        Don't error if bad command encountered
                 (batch only)
        B        List initiation of commands
        C        Print all requests via CSF$
        E        List command completions
        N        Suppress input listing (batch only)
        X        Simulate batch mode from demand

Command Format

The FANG control statement is followed by a series of commands which instruct FANG which operations are to be performed. Any input statement which begins with a period (.) will be treated as a comment and will have no effect other than being listed on batch output. Commands have the general format:

FANG Command Format

                  COMMAND,<options>   <parameters>
                       <data>
                       <patches>
                       <mask>

The command statement and all items that follow it are free format. First on the command statement is the name of the command to be executed. The command name need not be spelled out completely: only enough to uniquely identify the command must be supplied. If the command name given is ambiguous, and FANG is being used from demand in the interactive mode (that is, the input is from the terminal and not from an add file), FANG will ask the user to supply the command name he really had in mind. The user need only enter the command: the parameters from the original ambiguous statement will be used. If the user prefers to forget the command entirely, the word 'NONE' may be entered to the request for command clarification. Following the command name are the options for this command. These options are independent of the FANG options mentioned above, and serve to specify alternate processing modes for the specific command being executed. Following the command are a list of parameters. Different commands require different numbers of various parameter types, consequently the description for a specific command must be consulted for the parameters for a given command. If the parameter is a file name, then the full EXEC-8 file designation may be given, that is:

QUALIFIER*FILENAME(FCYCLE)/RKEY/WKEY.

or any abbreviation thereof. If the file is not assigned to the run, it will be assigned with the 'A' and 'X' options by FANG when it is first used. Files will be returned to their initial assignment state upon exit from FANG.

If a number is required as a parameter, any signed number may be supplied. A leading zero denotes an octal number. The end of the parameter list is denoted by a space immediately following a parameter. Spaces between a comma and the next parameter are ignored.

Many commands consist of simply the command and parameters. Others require data to be specified, and if options are specified that enable patching of blocks or masked comparisons, then data must be supplied. The order of the data, patches, and mask is given above. These parameter elements will always appear in that order, with any inapplicable parameters being omitted. In demand mode, FANG will prompt the user with the data type required.

Element Class Definition

The element-oriented commands in FANG function upon a class of elements defined by an 'element class' parameter. The structure of this parameter allows the full set of FANG element commands to function upon single elements, entire files of elements, or groups of elements selected on the basis of name, version, or type.

The class description first names the file in which the elements reside, then provides the criteria for choosing elements from the file. Drop-out rules allow commonly used cases to be easily specified. The general form of the element class parameter is:

QUAL*FILE(F-CYC).TYPE:TYPE:...NAME/VER

The first part of the parameter is a standard file specification which names the file from which elements are to be selected. The same drop-out rules apply to the file part of an element parameter as apply to a file parameter, with the addition that if the file name is entirely omitted, the run temporary file, TPF$, will be assumed. Therefore, if the entire specification is omitted, it is equivalent to a specification of TPF$.

Following the period after the file name are any number of type designations. These select element types to be chosen. EXEC-8 recognises four major element types, Symbolic, Relocatable, Absolute, and Omnibus, as well as numerous subtypes of Symbolic and Omnibus elements. FANG allows the user to select from either the major or the minor (symbolic) subtypes, or any combination thereof. This allows, for example, the selection of all FORTRAN and COBOL elements from a file containing a mix of element types. Any number of type specifications may follow the file part of the parameter, and each type mentioned causes elements of the named type to be included. Each type mnemonic is followed by a colon. The meanings of the various type mnemonics are given in the following paragraph.

The next part of the parameter specifies the name and version of elements to be processed. Name and version must match for an element to be selected, but if any character of either the supplied name or version is an asterisk (*), that character will match any character in an element in the file being examined. Thus, a name of twelve asterisks will match any name in the file. (Note that a name of six asterisks will match only elements with names of six characters or less, since the six trailing blanks of the supplied name must be matched by elements to be selected). If no version is specified, only elements with no version will be selected. If a trailing slash with no characters following it is supplied on the parameter, elements will be matched regardless of version. If no name is specified, elements will be matched regardless of name (equivalent to a name of twelve asterisks).

The drop-out rules for element class specifications are as follows: if the file is omitted, TPF$ is assumed. If no types are supplied, ALL types will be matched. If no name is given, ALL names will be matched. If no version is supplied, only elements with no version will be matched, unless the parameter has a trailing slash, in which case, elements will be matched regardless of version. If the parameter consists of only a file name, then all elements in the file will be processed; if the parameter specifies only a file and a list of types, elements will be chosen regardless of name. To select elements by type regardless of both name and version, the type list must be followed by a slash. Note that due to these rules, if only a file name is to be specified, it must be followed by a period (.), since otherwise it could be mistaken for an element name.

Type Mnemonics

The following is a list of the type mnemonics used to specify which element types are to be selected by an element class specification. The element types must be entered as specified below; no abbreviations are permitted.

Element Type Mnemonics

        SYM         Symbolics (including PROCS)
        PROC        All procs (ASM, COB, and FOR procs)
        ASMP        ASM procs
        COBP        COBOL procs
        FORP        FORTRAN procs
        REL         Relocatable
        ABS         Absolute
        OMN         Omnibus

        UNT         Untyped symbolics only
        ELT         Elt symbolics
        ASM         Assembler symbolics
        COB         COBOL symbolics
        FOR         FORTRAN symbolics
        ALG         Algol symbolics
        MAP         MAP symbolics
        DOC         Document processor symbolics
        SEC         SECURE symbolics
        SSG         SSG symbolics
        APL         APL symbolics
        BAS         BASIC symbolics
        LSP         LISP symbolics
        PLS         PLUS symbolics
        PL1         PL/1 symbolics
        CTS         Conversational timesharing symbolics
        FLT         FLIT symbolics
        PNC         PANIC symbolics
        TCL         Traffic control language symbolics
        MSM         MASM symbolics
        MSMD        MASM definition symbolics
        MACRO       MACRO symbolics

Element Class Examples

FILEX.
All elements in file FILEX.
ELTX
All elements named ELTX in file TPF$.
FILEX.SYM:ABS:/
All absolute and symbolic elements in file FILEX.
FILEX.SYM:ELTB/V1
The symbolic element ELTB/V1 in FILEX.
REL:/
All relocatable elements in TPF$.
PROG.FOR:UPD*L/NEW
All FORTRAN programs with names consisting of UPD<any character>L and versions of NEW in file PROG.
RLIB./COB***
All elements with versions of six characters or less starting with COB in file RLIB.
RLIB.REL:NO$BUF/
All relocatable elements with names of NO$BUF and any version in file RLIB.
RLIB.N*****/***65
All elements in file RLIB with names six characters or less starting with N and versions of five characters or less with '65' as the fourth and fifth characters.

Command Options

While command options often have meanings peculiar to a specific command, the following options have the same meaning on those commands that copy, dump, compare, and search files. Other command options are described in the command descriptions themselves.

FANG Command Options

        A        Print dumps in ASCII characters
        B        Print dumps in EBCDIC characters
        C        Don't disable files if operation errors
        E        Continue regardless of read errors
        I        Print dumps as decimal integers
        K        Print dumps side-by-side octal, Fieldata, ASCII
        M        Interpret count as tape files, not blocks
        N        Print dump header only, don't dump data
        O        Print dumps in octal
        Q        Write at next sequential file address (tape mode)
        R        Don't update file address pointer
        S        Treat count as address, use assumed count
        T        No space between words on dumped items
        U        Patch blocks read
        V        Mask compare operations
        X        Omit block header and word number on dumps

Options that select modes desired for all commands, such as octal dumping, may be implied on all commands by the OPTION IMPLY statement. See the OPTION command for details.

Data Format

FANG accepts a data syntax that allows a simple representation of long and repeated block formats. Data accepted by FANG consist of two basic types: integers and strings. Integers are simple signed numbers, with a leading zero denoting octal. Integers are stored in one computer word, or two for octal numbers that do not fit in one word. Strings consist of strings of Fieldata characters enclosed in quote marks. Any number of characters may make up a string. The character '#' causes the next character to be inserted regardless of its normal interpretation and is the mechanism by which a quote may be inserted in a string. The data generated by a string will be the Fieldata representation of the characters, stored six characters per word. If the number of characters submitted is not a multiple of six, the last word will be filled with spaces (05 octal).

Examples of integers are:

0 12 −14 01000 −0 −010 −91000

Examples of strings are:

'STRING' 'AIN#'T' 'QUOTH THE RAVEN, #'NEVERMORE#''

Any data item (integer or string) may be followed by a repeat count. This count consists of a comma and an integer immediately following the data item, and will cause the word or group of words represented by the data item to be repeated the specified number of times in the buffer. Examples of repeat counts are:

0,1792 'KABONG',01000 'MANY WORDS IN FEW',8000 −23,4

Data items are assembled into blocks by appending the word groups end to end. Any data item or group of data items may be enclosed in parentheses, and a repeat count may follow the parentheses if desired. These parenthesised expressions may be nested to any depth. The following example constructs an SDF file consisting of the image:

       KABONGKABINGKAZANGKAZANGKABINGKAZANGKAZANG

repeated 100 times.

                    0500130000000 '*SDFF*'
                    (000700000000 ('KABONG' ('KABING'
                    'KAZANG',2),2)),100 0770000000000 END

The end of the data string is denoted by the occurrence of the characters 'END'. The 'END' may occur anywhere on the data input statements.

If an error is made while entering data from demand mode, type 'ABORT' to the data solicitation. The data so far scanned will be discarded and a new data sequence may be entered. Any syntactical error in the data will cause an error message to appear and data scanning to be restarted.

Corrections

Certain commands allow the 'U' option on the command, which causes corrections to be scanned and applied to all blocks read. Corrections consist of a series of correction images which begin with a minus sign in column 1, and a number of data streams as described above. The entire correction stream is ended by an 'END', which may appear at the end of the final data stream, or if no data stream is present at the end, should be on a line by itself. Correction lines specify in terms of word numbers within the block what words are to be deleted or where insertions are to be made. Word numbers on correction lines may be either decimal or octal, and word numbers must be in ascending order. Correction images occur in two forms: insertion and deletion.

Insertion Correction Image

The insertion correction has the format:

-<number>

where <number> specifies the word number in the block after which the data following the insertion correction are to be added. Words are numbered from zero. To insert before the first word of the block, the data to be inserted should be placed before the first correction image ('-' line). The following correction stream inserts the text 'ZAP!!' after word 0160 in the block:

                    -0160
                    'ZAP!!'

Deletion Corrections

The format of the deletion correction is:

-<number>,<number>

and causes the words specified from the first number through the second number, inclusive, to be deleted, and any data following the correction to be inserted in their place. To delete a single word, the word number should appear as both the first and second number. To replace word 0160 of a file with the value −14, the correction sequence would be:

                    -0160,0160
                        -14

note that the minus sign for the negative number may not appear in column one of the image.

Correction Stream Example

The following figure illustrates a typical correction stream which might be applied to a block of data being copied from one file to another:

Correction Example

                  '*SDFF*'
                  -0,0
                  'NEWTEXT',3
                  -14
                  'INSERT HERE',4 (01000 (0,5 ('A' 'B'),3),4),2
                  -0100,0123
                  -0170,0210
                  -0211
                  'APEX'
                  -0212,0241
                  'ANHYDROUS NANGLING PINS'
                  END

Masks

Commands which perform a comparison will accept a mask if the 'V' option is specified on the command. The format of the mask is identical to that of data, described above, and all considerations applicable to data apply to masks also. If a mask is shorter than the unit which it is masking (the search key for LOCATE or SEARCH, the block for COMPARE), it will be repeated sequentially enough times to equal or exceed the length of the unit of comparison. Omitting the mask is equivalent to specifying the mask:

−0 END

File Handling

FANG operates on the various types of EXEC-8 files in a unified manner without sacrificing the advantages peculiar to each file type. It is, for example, possible to treat a Fastrand format file as a simulated tape or as a random access file.

Tape Files

Tape files are handled on a block-by-block basis and sequentially by FANG. Any command that reads or writes a tape starts wherever the tape is currently positioned and leaves the tape positioned wherever the operation stops. Data blocks read from the tape have whatever length the tape block had. When writing, a block is written with the length of the supplied data. The block length, set by the LENGTH command, is the largest block which may be read without truncation. If a block is truncated, a warning message will be given. The initial maximum block length is 2000 words.

Mass Storage Files

Each mass storage file has an address pointer associated with it, referred to as the 'current address'. This address is analogous to the position of a tape file. Any operation that would move a tape will increment or decrement the current file address by the appropriate number of simulated blocks. When a file is used in tape simulation mode, the length of blocks read from the file, and the length used for positioning, is the block length defined by the LENGTH command. This is initially 28 words for a Fastrand format file and 32 words for a word addressable file. For a Fastrand format file the block length must be a multiple of von Fastrand's constant, 28.

Thus, reading from a Fastrand format file whose block length has been set to 252 (9×28) words is equivalent to reading a tape composed of 252 word blocks. Note that the 'Q' option must be specified on the COPY command to use the file in tape simulation mode.

Random Accessing

A number of commands allow the user to specify a mass storage address to be used in lieu of the current address used for tape simulation. These 'S' option commands permit the data in the file to be accessed in any order, that is, randomly accessed. No 'S' option command will affect the current address of a file.

Word Addressability

Word addressable files may be used in all FANG commands, except those pertaining to program files. Whenever an address is specified by the user, it should be in words rather than sectors. When an address is supplied from another file, as in a file to file copy, the address will be converted from sectors to words or vice versa to insure that the data stored in the file is identical regardless of the addressing mode of the file.

Program And Element Files

FANG operates on both Fastrand format program files and tape element files through a set of commands that allow elements in those files to be copied, listed, deleted, or modified. The element class specification allows the user to describe which element or group of elements within a file is to be processed by a given FANG command.

Command Descriptions

ASK

                  ASK,<options>  <text>

The ASK command allows the user of FANG to converse with the console operator without leaving FANG. The <options> are the same as for the @msg control statement that select console types. The 'C' option directs the message to the communications console, the 'H' option directs the message to the hardware confidence console, the 'I' option selects the I/O console, and the 'S' option, or no options causes the message to be printed on the normal system console. After submitting an ASK command, the user may continue to use FANG normally. When the operator answers the message, the operator's reply will be typed. The user may have multiple ASK statements pending at one time. While an outstanding ASK does not affect the operation of FANG in any way, the user may not leave the FANG processor until all outstanding ASK statements have been answered by the operator.

CLEAR

                  CLEAR  <file1>,<file2>,...

CLEAR removes the disable status from the specified files. The disable status is set when a command aborts due to an error. All files referenced by that command will be disabled. Any subsequent command referencing a disabled file will be skipped, and all files referenced by that command will be disabled. This mechanism insures that when operations are queued for execution, the failure of an operation upstream will not cause erroneous results in later commands. Operations unaffected by the error will be allowed to proceed. A CLEAR statement removes the disable and permits statements using the previously disabled file to be executed. Note that this disable is a logical status internal to FANG and has nothing to do with the file disable status set by the system as a result of a file backup or system failure. Do not confuse the CLEAR command, which only affects the status of a file within an execution of FANG with the @ENABLE command which clears the system disable bit.

CLOSE

                  CLOSE,<options>  <file1>,<file2>,...

CLOSE writes two end of file marks and rewinds each of the magnetic tape files specified on the command. If the 'I' option is specified on the command, the files will be rewound with interlock. The action of the CLOSE command is identical to two MARK commands followed by a REWIND or REWIND,I. Like the MARK command, an error message will be issued if a CLOSE operation is attempted on a mass storage file.

COMMANDS

                  COMMANDS

The COMMANDS command causes the current command execution status of FANG to be displayed. The statement numbers of all in progress commands will be typed, followed by the statement numbers of all commands that are waiting for the completion of earlier commands. This command may be entered at any time to find out what's going on.

COMPARE

                  COMPARE,<options>  <file1>,<file2>,<number>
                       <patches>  (if 'U' option is on)
                       <mask>  (if 'V' option is on)

Blocks are read from <file1> and <file2> and compared. If the 'U' option is specified, the patches supplied will be applied to blocks read from both files. If the 'V' option is supplied, the mask specified will be AND'ed with the contents of both blocks before the comparison is made. If the mask is shorter than the blocks being compared, it will be repeated sufficient times to equal the block length. If the blocks differ in length or content both blocks will be dumped in the format specified by <options>.

<number> blocks will normally be compared. Infinity is assumed if <number> is omitted. COMPARE stops when either the count specified by <number> is satisfied or both files have reached an end of file or end of information. If one file ends before the other, the balance of the blocks in the longer file will be dumped. The 'M' option causes <number> files to be compared on tape.

If both <file1> and <file2> are mass storage and the block lengths differ, FANG will choose the larger block size and use that for both files, unless one file is word addressable and the other is Fastrand format. In that case the block length of the Fastrand format file will be used for both <file1> and <file2>.

COPY

                  COPY,<options>  <file1>,<file2>,<number>
                       <patches>  (if 'U' option is on)

COPY moves data from <file1> to <file2>. The action of the COPY command depends upon the options specified and the equipment types of the files involved. If the 'U' option is specified, all blocks read from <file1> will be patched according to the patches that follow the command.

No options:
Action depends on equipment type. Infinity is assumed if <number> is omitted. In no case will the current address of a mass storage file be changed.
Tape => tape
<number> blocks will be copied from <file1> to <file2>. Copying will stop if an end-of-file is read from <file1>, but no end-of-file will be written to <file2>.
Tape => file
File => tape
The equivalent of a FURPUR @COPY,GM will be performed with the extension that word addressable files may also be copied in this manner. <number> is ignored. The output tape of a Fastrand format file to tape copy is compatible with FURPUR COPY,G format.
File => file
The entire contents of <file1> will be copied to <file2> in track-size blocks. If <file1> and <file2> differ in word addressability appropriate address conversion will be performed. <number> is ignored.
'M' option
(tape => tape only) Blocks will be copied from <file1> to <file2> until <number> end of file marks are encountered. End of file marks read from <file1> will be duplicated on <file2>. One is assumed if <number> is omitted.
'Q' option
On a file => file, tape => file, or file => tape copy causes the file(s) to be used in tape simulation mode. That is, blocks will be read or written at the current address in the file with the length associated with the file (initially 28 for Fastrand format or 32 for word addressable, see the LENGTH command). The address will be appropriately incremented to simulate tape movement.

CYCLE

                  CYCLE  <elt>,<number>

The CYCLE command will set the cycle retention for the specified element class to the number specified. Setting the number lower than the number actually present will not remove the unwanted cycles, but will cause the source input routine to remove the cycles the next time the element is updated.

DELETE

                  DELETE,<options>  <elt class>,<elt class>,...

Deletes the specified element class. If only a file name is specified for the element class, the entire file will be deleted (decatalogued). If the 'T' option is specified, table of contents entries will be printed logging the elements deleted. Note that in deleting elements the DELETE command does not return their space to the available space pool; that is accomplished by the PACK command, documented below.

DUMP

                  DUMP,<options>  <file>,<number>
                       <patches>  (if 'U' option is on)

Dumps blocks of <file> in the format specified by <options>. The assumed format is Fieldata alphanumeric. The 'A' option selects quarter-word ASCII character format, and the 'O' option specifies octal; the 'I' option selects decimal (integer) format. The 'K' option selects a dump format which displays the same data side-by-side in octal, Fieldata, and ASCII. In batch mode, the 'K' option format will dump four words per line. The 'T' option causes the spaces that normally separate words to be deleted, improving readability of textual material. In a Fieldata alphanumeric dump, the 077 code (not equal sign) is printed as a question mark (?). The 'N' option causes no data to be dumped, but a dump header identifying the block will be printed. The 'X' option will suppress the dump header and the numbering of words within the data dumped, but will print the data in the format specified by the other options.

<number> normally specifies the number of blocks to dump; infinity is assumed if <number> is omitted. If an end of file is encountered before <number> blocks have been read, dumping will cease. The 'M' option (valid only on tape files) redefines <number> as a file count. Dumping will proceed until <number> end of file marks are encountered. The 'S' option (applicable only to mass storage files) causes the dump to start at the mass storage address specified by <number>. The rest of the file will be dumped, as the implied block count of infinity will be used. If <number> is omitted and the 'S' option is on, zero is assumed for the address.

Editing Commands

The editing commands are intended primarily for the demand user of FANG, and allow files to be edited and updated in a convenient interactive manner. The editing commands operate at the block level, where a block is either a tape block or a simulated block read from mass storage. The block length may be set with the LENGTH command. FANG can store any number of blocks internally. one block is designated the internal block, and has no name. This block is used for all input and output. The internal block may be saved in a named block with the STORE and LOAD commands. The user may create any number of named blocks simply by using them. the editing and listing commands function on named blocks as well as the internal block.

GET

                  GET  <file>,<number>
                       <patches>  (if 'U' option is on)

If <file> is tape or <number> is omitted, the next block is read from <file> and stored in the internal block. A tape is left positioned after the block read, and the current address for a mass storage file will be updated. If <number> is supplied and the file is mass storage, a block will be read starting at the address specified by <number>. If <number> is specified, the current address of a mass storage file will not be changed.

PUT

                  PUT,<options>  <file>,<number>

PUT writes the internal block into <file>. If <file> is tape, the block is written as the next sequential block. If <file> is mass storage and no options are specified, then if <number> is supplied, the block is written starting at the address specified by <number>. If <number> is omitted, the block is written back at the address it was read from. This makes changing information within a file or moving information from one file to another very easy. The current address of <file> will not be changed.

If the 'Q' option is specified and <file> is mass storage, the block is written starting at the current address of <file>, and the current address is incremented by the length written.

STORE

                  STORE  <block>

The contents of the internal block are copied into the named block <block>, destroying any current information stored in <block>. The block name may be any name of up to 12 alphanumeric characters. The contents of the internal block remain unchanged.

LOAD

                  LOAD  <block>

The block stored in the named block buffer <block> is copied to the internal block, destroying the contents of the internal block. The data in <block> are unaffected by the LOAD command.

LST


                  LST,<options>  <number1>,<number2>,<block>

<number2> words, starting at word <number1> of <block> will be dumped in the format specified by <options> (see the DUMP command). If <block> is omitted, the internal block will be dumped. If <number2> is omitted, the single word <number1> will be dumped. If all parameters are omitted, the entire internal block will be dumped.

COR

                  COR  <block>
                       <patches>

The specified <patches> will be applied to <block> as if it were a block being read. If <block> is omitted, the corrections will be applied to the internal block.

REP

                  REP  <number>,<block>
                       <data>

The specified <data> will overlay words of <block> starting at word <number>. If <block> is omitted, the internal block will be used. The block will be expanded if the sum of the starting word and the length of the data supplied exceeds the length of the block.

BLK

                  BLK  <block>

The contents of the designated <block> will be identified as to length and source. If <block> is omitted, the information will be listed for all blocks currently defined. This is a convenient means to find out the status of blocks when frequent LOADs and STOREs confuse the user as to what contains what. One line is printed for each block listed.

EMBED

                  EMBED,<options>  <elt1>,<elt2>

The EMBED command places a compressed copy of an entire file in a Omnibus element of a program file, or restores a file from an Omnibus element previously created by EMBED. If the first specification is a file name with no element selection, the text of that file will be EMBEDed as an Omnibus element in the file specified by <elt2>. The name given to the Omnibus will be the file name from <elt1> taken as a name with a blank version, renamed by the element class specified in <elt2>. (See the RENAME and TRANSFER commands below for an explanation of renaming).

If <elt1> specifies element selection, the first EMBED-created Omnibus selected from the file specified by <elt1> will be expanded and written into the second file specified. No element may be specified on the second specification in this case. If the 'T' option is specified on the command, a message identifying the original source of the file being restored will be printed.

At present, only mass storage files may be EMBEDed.

ERASE

                  ERASE,<options>  <file1>,<file2>,...

Erases the designated files. If the file named is a mass storage file, all granules of the file will be released to the pool of available space. If the 'W' option is specified, the granules will be overwritten before being released to protect any classified data in the file from falling into the hands of an unauthorised user when the space is reassigned. If the file named is a tape, the tape will be overwritten from its current position to the end of the current reel. The tape will then be rewound (with interlock if the 'I' option is specified).

FAC

                  FAC  <number>

The FAC command enables the demand user to determine the reason for the rejection of a facility request. If a facility request performed by FANG to dynamically assign or release a file is rejected, a diagnostic message will be printed giving the system's numeric rejection status, and the command which precipitated the rejection. If the user types FAC with no parameters, the meaning of the last error status displayed will be typed. Thus, if a command is rejected, the user needs only to type FAC to find out why. If a parameter is supplied, then the meaning of the status represented by that command will be typed. Since the status is an octal number, it must always be entered with a leading zero, even if one was not printed when the status was originally displayed. In batch mode, the message for a status is always printed.

FIND

                  FIND,<options>  <elt1>,<elt2>,...

Finds the designated elements in their respective files. If the file is Fastrand, the element table is searched for the first element selected by the element class specification given. The current address pointer for the file is then set to the starting address of the element text. If the file is tape, it is searched until an element is found that is selected by the element class specification supplied on the command. The tape will be left positioned before the label block of the found element, so that it may be read in with a subsequent TRANSFER command. If in the process of searching the tape file, an end of file mark is encountered, the file will be moved backward to the start of the file, and the search will continue, unless the 'E' option is on, in which case the search will stop at the end of the file, and the tape will be left positioned at the start of the next file. If the element is not found in the file, an error message will be given and the file will be disabled. The tape position or current address pointer will be unchanged by the command if no element is found.

LENGTH

                  LENGTH  <file>,<number>

LENGTH sets the logical block length for the specified file to <number> words. For a mass storage file, this means that all blocks read from the file will have the specified length and the address will be incremented in units of that length (in sectors if appropriate). For a tape file, the block length defines the maximum block length which may be read without truncation. Restricting the block length saves memory. Assumed block lengths are: for tape, 2000 words; for Fastrand format mass storage, 28 words; and for word addressable storage, 32 words.

LIST

                  LIST,<options>  <file>,<number>
                       <patches>  (if 'U' option is on)

LIST is identical to DUMP except that the assumed block count is one rather than infinity. Note that this means that one block will be dumped by a LIST,S command for a mass storage file, rather than the rest of the file, as would be assumed by DUMP,S.

LOCATE

                  LOCATE,<options>  <file>,<number>
                       <data>  (search key)
                       <patches>  (if 'U' option is on)
                       <mask>  (if 'V' option is on)

Reads blocks from <file>, patching if directed to do so by the 'U' option. Each block is searched for a pattern identical to the search key supplied. The search key must exactly match on a word-by-word basis a sequence in the block with the same length as the search key. If the 'V' option is on, a mask is accepted which is bit-by-bit AND'ed with both the data and the key before the comparison is done. The mask is used word by word with the key. If the mask is shorter than the key, it will be restarted from the first word when it is exhausted.

If no find is made before <number> blocks are read, a message will be printed and the file will be disabled. A tape end of file or the end of information in a mass storage file will have a similar effect. The 'M' option redefines <number> to be a number of tape files, and causes end of file marks to be ignored in the searching process. The 'C' option will inhibit file disabling for the no find case.

When a find is made, the block will be dumped in the format specified by <options> (see the DUMP command). The tape or file will then be repositioned so that the next read command will read the block in which the find was made. This means for a tape that the tape is positioned backwards to before the block in which the data was found. To locate all occurrences of a pattern in a file, use the SEARCH command described below.

MARK

                  MARK  <file1>,<file2>,...

MARK writes an end-of-file mark on each tape file named on the MARK command image. If attempted on a mass storage file, an error message will be given.

OPTION

                  OPTION,<options>  <string>

The function of the OPTION command depends upon the command specified by <string>. Available functions are as follows:

ON
Adds <options> to the list of options specified on the @FANG control statement.
OFF
Removes <options> from the list of options on the @FANG control statement.
IMPLY
Adds <options> to the list of options that are implied on each command entered. This is a convenient method to select modes of processing.
REMOVE
Deletes <options> from the list of options implied on every command.
LIST
Lists the current options, both on the control statement and implied on commands entered.

PACK

                  PACK  <elt1>,<elt2>,...

Condenses the files named by the element class specifications given so that only nondeleted elements selected by the named element class specifications will remain. Excess space will be released to the system. Note that if simply a file name is specified, the effect of PACK will be to remove all the deleted elements from a file. If the 'W' option is specified on the pack command, all space released to the system will be overwritten before release to insure security of data in the file being PACKed. The PACK command is implemented in such a way that a system failure or other abnormal termination during a PACK will destroy at most one element, and will require re-PDPing all PROCS in the file.

POSITION

                  POSITION,<options>  <file>,<number>

POSITION moves a tape to a specified block or sets the address pointer of a mass storage file. The action of POSITION depends upon the options specified.

No options:
A tape will be moved <number> blocks forward (backward if the 'B' option is on). If an end-of-file mark is encountered a message will be printed and the positioning will stop. A mass storage file will be moved the specified number of logical blocks forward or backward depending on the 'B' option. One is assumed if <number> is omitted.
'E'
(Tape only). Same action as no options, except that an end-of-file mark is treated like any other block; it does not stop the POSITION command.
'L'
(Tape only). The tape will be moved forward until two consecutive end-of-file marks are encountered. The tape will be left positioned between the end-of-files. <number> is ignored if the 'L' option is on.
'M'
(Tape only). The tape will be moved <number> files forward or backward depending on the 'B' option. If moving backward by files, the specified number of end-of-file marks will be counted, then the tape will be positioned forward over the final mark, leaving the tape at the start of that file. One is assumed if <number> is omitted.
'S'
(Mass storage only). The address pointer is set to the address specified by <number>. <number> should be in sectors for a Fastrand formatted file or in words for a word addressable file.

PREPARE

                  PREPARE  <elt1>,<elt2>,...

Constructs an entry point table for the relocatable elements selected by the element class specifications <elt1>, <elt2>, etc. If a specification consists of simply a file name, all the entry points of all relocatable elements in the file will be included in the entry point table. An entry point table is necessary if the file is to be used as a library file in a collection, or if the collection technique of entry point search is to be used.

PRINT

                  PRINT,<options>  <elt1>,<elt2>,...

The PRINT command produces listings of elements or SDF format data files. If the files named are program files, then the symbolic elements selected by the designated element class specifications will be printed. Normal output is an @ELT type listing, in long format if for batch or a breakpointed file, or in short format if for a demand terminal. The 'L' option forces the batch format listing to be generated, while the 'S' option always causes the shorter demand format listing to be produced. In either case, if the element being listed was generated by CTS, the CTS line numbers will be listed instead of the normal sequential line numbers. CTS line numbers will be identified in the batch format listing by being followed by a colon (:) instead of the normal period. In batch mode, a heading is normally produced for each element; this may be suppressed by the 'H' option. Deleted images (back cycles) will be printed if the 'B' option is on, and SDF control images will be printed by the 'P' option. The elements selected will be printed in alphabetical order if the 'A' option is present on the command. The 'I' option controls printing of cycle information, suppressing it in batch mode, enabling it in demand mode. If enabled, a flag will be added to each line indicating the cycle status of the line. this cycle information will be: blank if a line belongs to the oldest cycle present, the cycle added if the line was added after the oldest cycle present, '*NEW' if the line belongs to the newest cycle present, and '*-NN' if 'NN' images have been deleted before the line.

PROTECT

                  PROTECT  <file>,<string>

The PROTECT command defines <string> as a key to be used in cryptographically enciphering data read from and written to the named file. Only the first twelve characters of <string> will be examined, and blanks are permitted in the string. If the string (and the comma preceding it) are omitted, protection will be turned off for the file and data will not be enciphered or deciphered. Protection will affect all file mode commands (COPY, DUMP, SEARCH, the editing commands, etc.), but will lead to predictable but undesirable results if the file is manipulated with the element commands (PRINT, TOC, TRANSFER, etc.). To protect data in a file or on a tape, keep it encoded using FANG. To update it, copy to a temporary file using the PROTECT command to decipher the data. The data in the temporary file may be manipulated normally by other processors. At the end of the run, call FANG again to copy the data back to the file or tape under protection. The temporary file space should be released using the ERASE,W command, to prevent the granules of the file being accessed by another run. All file mode operations may be used on a file in protect mode, but all operations must use the same block length, as encoding is data dependent, and rewriting part of a block would render the rest of that block undecipherable.

RENAME

                  RENAME  <elt1>,<elt2>

<elt1> is an element class specification, and <elt2> is the element portion of an element class specification (no file name). The elements selected by <elt1> will be renamed by <elt2> under the following rule: characters of <elt2> will replace characters in the corresponding positions of the names of the elements selected by <elt1>. If a character in <elt2> is an asterisk (*), the character in that position of the input name will remain unchanged. In no case may this process create an element name containing a space.

REWIND

                  REWIND,<options>  <file1>,<file2>,...

The REWIND command resets a file to its logical start. If the file is a single reel tape, it is rewound to load point. If the file is a multi-reel tape, the first reel of the file will be positioned at load point, unless the 'R' option is present, in which case only the current reel will be rewound. If the file is mass storage, the address pointer will be set to zero (the start of the file). The 'I' option will cause a tape file to be rewound to interlock, and a mass storage file to be @FREE'd.

SEARCH

                  SEARCH,<options>  <file>,<number>
                       <data>  (search key)
                       <patches>  (if 'U' option is on)
                       <mask>  (if 'V' option is on)

SEARCH searches blocks in the same manner as the LOCATE command. Upon finding a block it is dumped, but unlike LOCATE, the search goes on, dumping matching blocks whenever they are found. The search continues until <number> blocks have been read, or an end of file or end of information is encountered. A no find condition will not cause the file to be disabled. Infinity is assumed if <number> is omitted. The 'M' option redefines <number> as a count of tape files to search. If the 'M' option is on, end of file marks are ignored in the comparison process.

STATUS

                  STATUS,<options>  <file1>,<file2>,...

The STATUS command lists the status of the files named on the command. If no file names are specified the status of all files so far used by FANG will be listed. The 'D' option will list only files that have been disabled by an error (see the CLEAR command). Information listed includes filename, equipment type, block length, disable status, and current file position.

SWAP

                  SWAP  <file1>,<file2>,...

The SWAP command swaps to the next reel of the tape files named on the command. If attempted on a mass storage file an error message will result.

TELL

                  TELL,<options> <text>

Types <text> on the console selected by <options> (see the ASK command), but does not solicit a response from the operator.

TIME

                  TIME

The TIME command types out the current date and time, just in case you want to know.

TOC

                  TOC,<options>  <elt class>,<elt class>,...

Prints the table of contents entries for the designated element classes. Deleted elements will not be listed unless the 'D' option is specified on the command. A full listing will be generated for batch runs, and an abbreviated listing will be produced for demand. The full listing will always be printed if the 'L' option is on the command, and the short listing will be unconditionally generated for the 'S' option. If the 'A' option is on, the table of contents will be printed in alphabetical order, rather than in order of sequence number in the file. The 'B' option will cause elements to be listed in the reverse of the order normally used by TOC. Thus, if used by itself, elements will be listed from most recent to oldest, and if used with the 'A' option, elements will be listed in reverse alphabetical order. The 'N' option will limit output to a one line summary listing the number of non-deleted symbolic, relocatable, and absolute elements.

TRANSFER

                  TRANSFER,<options>  <elt1>,<elt2>,<number>

TRANSFER is the basic operation which allows moving classes of elements, program file tapes, and SDF files from file to file, performing format conversion in the process. The function of the transfer command depends upon the equipment type of the files involved and the options present on the command. Consequently, the command is best explained as a series of cases:

No options
The transfer command without any control options moves elements from one file to another. If the 'T' option is specified, the elements copied will be listed in table of contents format. If a name is supplied on the output file specification, it will be used to rename the elements transferred. Characters of the output name will replace the corresponding characters of the input name. Characters of the input name will be copied if the corresponding character of the output name is an asterisk (*). This rule applies for blanks also, so the output name specification must be filled with stars unless truncation of input names is desired. If versions are to be preserved, a version of all stars (which may be abbreviated as simply a trailing slash) must be supplied. A space character will not be inserted in the output name.
Tape => file
If the first parameter is simply a file name, then <number> elements will be copied from the first file to the second. The copying process stops when an end-of-file mark is encountered or <number> elements have been transferred. If the 'M' option is specified on the command, <count> tape files will be copied into the program file. If <count> is omitted, infinity is assumed. If the first parameter specifies an element class, then that element class will be copied into the program file. <count> elements or files will be examined in order to satisfy the request. The tape will be left positioned after the last element examined.
File => tape
The element class designated for the first parameter will be copied onto the tape. The 'A' option will cause the elements to be written out in alphabetical order. If the first specification is simply a file name, the entire contents of the file will be written to the tape, and an end of file mark will be written at the end of the file. If the first specification includes an element class designation, the specified elements will be written onto the tape, followed by an end of file mark, but FANG will back up over the mark to allow the user to concatenate files on the tape. The 'M' option on the command will leave the end of file after the elements written, even if an element class is being written out. <number> is omitted for this form of TRANSFER.
File => file
Copies the designated element class from the first file to the second file. If the 'A' option is specified on the command, elements will be moved in alphabetical order.
Tape => tape
<number> elements (or files if the 'M' option is on) from the first file will be examined. Those selected by the element class designated for the first file will be written in element file format to the second file. At the end of the operation, an end of file will be written on the second file, and backspaced over to allow file concatenation. The 'M' option on the command will inhibit the backspacing.
'F' Option - Copy SDF
If both specifications are simple file names, then SDF images will be copied from the first file to the second until an SDF end of file is encountered. If the input names an element class, all symbolic elements selected by that class will be written as an SDF file on the output file. If more than one element is selected, the elements will be concatenated into one SDF file, in alphabetical order by element name and version if the 'A' option is specified on the command. If the output file designation specifies an element, the input SDF file will be used to create an element in the output file. The element name in the output file will be the input file name as name and a blank version, renamed by the element class specification given for the output file. Any symbolic type may be specified for the output element by placing a type name in the output specification. If the output file is tape and the 'M' option is specified, an end of file mark will be written after the output to the tape. SDF files may be read from and written to tape, but element files on tape may not be used in an 'F' option TRANSFER command.

TYPE

                  TYPE  <elt>,<type>

The TYPE command changes the type of a Symbolic or PROC element to another Symbolic or PROC type or changes the subtype of an Omnibus element. The elements selected by the element class <elt> will be changed to the type designated by <type>. The specification <type> is one of the element type mnemonics used in element class specifications and need not be followed by a colon. The TYPE command may not be used to change an element type to or from Relocatable or Absolute, nor may it change an element from Symbolic to Omnibus or vice versa.

UNDELETE

                  UNDELETE,<options>  <elt>,<number>

The UNDELETE command allows the user to resurrect elements that have been deleted but not yet packed out of a program file. In this manner grievous errors wrought by the user or the system may be undone. If <number> is omitted, the last deleted element in the file selected by the element class specification <elt> will be undeleted. If <number> is specified, the element with that sequence number in the file specified by <elt> will be undeleted. If no such element exists, or it is not deleted, an error message will be given. Any existing nondeleted element with the same name and type as the element being undeleted will be deleted. If the 'T' option is specified on the UNDELETE command, a message will appear giving the name and sequence number of the element being undeleted. Note that two identical UNDELETE commands will always leave a file back in its original state.

WRITE

                  WRITE,<options>  <file>,<number>
                       <data>

Writes <data> to the file. If no options are specified, <number> blocks are written, starting at the current address if the file is mass storage. The 'M' option causes an end of file mark to be written after the data blocks if the file is tape. The 'S' option, meaningful only if <file> is mass storage, writes one block containing <data> starting at the sector or word specified by <number>. One is assumed if <number> is omitted, except that zero is assumed for the 'S' option.

Processor Operation

FANG performs operations in the order in which they can be completed most rapidly, not necessarily in the order they are submitted. A scheduling algorithm insures that the result of this process will never differ from the outcome of purely serial execution of the commands as entered. One unavoidable consequence of this mode of operation is that output is not necessarily listed with the listing of the statement which generated the output. FANG deals with this problem by including the statement number in every message whose source might otherwise be ambiguous. Statements are numbered sequentially by line number. Statements which accept several files are logically multiple statements and are resolved into a statement number and a substatement number which indicates which file within the statement is meant. Hence on the command:

        4.        REWIND  A,B,C

statement 4.2 refers to the operation REWIND B.

The 'B' option causes FANG to print statements as they are executed, rather than as they are read. The 'E' option causes statement completions to be logged. Calling FANG with the 'N' and 'B' options will cause a listing in the order of command execution rather than command initiation.

Demand Processing Considerations

FANG detects that it is being called by a demand user and abbreviates the output format to a format more suitable to a slow, character-oriented interactive terminal. When accepting commands, FANG prompts the demand user with a statement number if a new statement is desired, or with the expected data type if a parameter is being scanned. Often an input solicitation will be preempted to type some output from another operation. This is of no consequence: the user may simply type in the next input without a solicitation when the terminal is idle. If the user forgets where he is or prefers to be prompted, the solicitation may be retyped at any time by simply typing carriage return.

The '@@X CO' command will throw away all output until the next command completes or another input line (which may be blank) is entered. This is particularly useful when FANG is dumping a great deal of information in which the user has no interest.

Should the user become confused about which operations are in progress and which operations are waiting for others to complete, the confusion may be dissipated by typing COMMANDS. Likewise, the state of files may be divined by typing STATUS. Refer to the description of these commands for more information.

Batch Mode

When operating in batch mode, FANG will produce listings and dumps suited to a 132 column line printer. Since intervention is not possible, error handling is designed to automatically minimise the impact of an error on other operations. If a source language syntax error is encountered, the interpretation of source language is terminated, and any in progress operations are allowed to complete. If an operation errors, the files it affects will be marked disabled, and FANG will skip any operation using those files, marking all files used by the operations skipped as disabled in turn. Thus, if separate operations are being done on two or more sets of files, an error in one set will not affect the successful completion of the other set. The CLEAR command allows the disable status to be removed. The file disabling mechanism is also in effect for demand, but is mainly intended for the batch case where intervention is not possible.

If invoked by a demand run whose output file is breakpointed away from the interactive terminal, FANG will automatically assume the batch mode, since the user is incapable of supervising the execution of the commands he submits. This will also result in listings better formatted for subsequent printing on a high-speed device. Batch mode may be entered directly from a demand run by specifying the 'X' option on the control statement invoking FANG.