1
0.
 .
0
0
0
0
                                  Text Exchange System
0                              A Transportable System for
                               Management and Exchange of
                                Programs and Other Text
0
                                      Section 366
                                        1846-108
0
0
0                                    June 22, 1983
0
0
0
                                     W. V. Snyder *
                               Jet Propulsion Laboratory
                                   Pasadena, CA 91109
0
                                    R. J. Hanson **
                              Sandia National Laboratories
                                 Albuquerque, NM 87185
0
0
0
0
                           California Institute of Technology
                               Jet Propulsion Laboratory
                                  4800 Oak Grove Drive
                                   Pasadena, CA 91109
0.
 .
1
0.
 .
0
0
0
0
0
0
                *  This  work represents the results of one phase of research
                   carried out at the Jet Propulsion  Laboratory,  California
                   Institute  of  Technology,  under  Contract No. NAS 7-100,
                   sponsored  by   the   National   Aeronautics   and   Space
                   Administration.
0
0               ** Work  performed  under  the  auspices  of  Sandia National
                   Laboratories, Albuquerque, New Mexico 87185 for the United
                   States Department of Energy under Contract AT(29-1)-789.
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
1
                                  Text Exchange System
 .
 .
                                   System Description
0          1.  Abstract
0
                The Text Exchange System (TES) provides a method to  exchange
           and  maintain  organized  information.  The system consists of the
           definition of a format for information storage  and  two  computer
           programs.   A  comprehensive  program is used to create, read, and
           maintain TES files.  To allow the TES to be distributed on a  tape
           in  the TES format, a much smaller program capable only of reading
           magnetic tape is also available.   The  programs  are  written  in
           Fortran   and   designed   for   portability,   but  a  few  small
           machine-dependent modules, available  for  several  machines,  are
           required.    Although  the  comprehensive  program  recognizes  35
           commands, information may be read from a TES format file by  using
           as  few as three commands.  In addition to its use for information
           exhange on magnetic tape, we expect the system to be  helpful  for
           maintaining libraries of text.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          1-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0          2.  Introduction
0
                 Computer  Software  is  usually  exchanged between different
           computer facilities using punched cards or magnetic tape.  For  up
           to  about  1000  images,  cards are cheaper and probably easier to
           deal with.  A frequent problem with cards is the variety of  punch
           codes.   One  also has the occasional minor nuisance of repunching
           cards damaged  in  transit,  or  reordering  cards  disordered  in
           transit.   When  the  amount  of  information  to  be  transmitted
           requires more  than  about  1000  card  images,  tape  is  usually
           cheaper.
                One  who  has  received  information  on   tape   from   many
           correspondents  has  probably  experienced  the  nuisance of tapes
           written in various densities, both parity modes, several character
           codes,  and  having  a variety of block and record lengths.  There
           are three  obvious  solutions  to  this  problem.   Most  computer
           centers  have  access  to  a  program that can handle fixed length
           records, written in fixed length blocks, using a popular character
           code  such as EBCDIC (used on IBM 360 and 370 machines).  When the
           characteristics of the medium are  correctly  specified,  one  may
           expect some success with such a program.
               Unfortunately, the recording format or medium  characteristics
           are   not  always  provided  by  the  sender,  and  are  sometimes
           incorrect.  Another solution is for a  standards  organization  to
           promulgate   a   standard   for   recording   format   and  medium
           characteristics.  Then if such information is  not  provided,  the
           standard would be a reasonable guess.
                A better solution is a transportable  program  to  enforce  a
           standard  recording  format.   This  relieves  the  sender  of the
           responsibility  for  sending  detailed   information   about   the
           recording  format  with  the  tape.   (He  must,  of course, still
           describe the medium by telling the receiver the recording  density
           and  whether the tape is a seven- or nine-track tape).  Since some
           binary numeric information is recorded, only odd parity tapes  may
           be used with the TES programs.
                Simple  programs  such  as  described  above  usually  cannot
           continue  processing  after  discovering a parity error on a tape.
           This renders a tape file containing  a  parity  error  essentially
           worthless, even though only a small fraction of the information is
           corrupted.  Methods for error recovery  are  available  [1].   The
           extra  information  required for error recovery may be stored in a
           form compatible with the other goals of the TES, but the efficient
           processing  of  this information is usually machine dependent.  In
           addition,  some  operating  systems   prohibit   user   controlled
           operations after detecting an error on a tape.  Therefore, the TES
           allows error recovery information to be included, but the programs
           do not process it.
 .
 .
                                          2-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0               Although the problem of dealing with variable and  frequently
           uncertain  physical  characteristics  of  the  recording medium is
           irritating, the problem that can consume the most time is the lack
           of  organization  of  information  on the tapes received.  One may
           receive programs in several languages,  subprograms  with  several
           test  drivers, multiple versions of a program, test data, computer
           output, and documentation, with no indication  of  the  boundaries
           between  the  units of information, or of the type of the units of
           information.  In  such  situations,  much  effort  must  be  spent
           organizing  the  information  before it can be used.  The goals of
           the  TES  are  therefore  to  enforce  a  recording   format   for
           information   storage   on   magnetic   tape,  and  to  provide  a
           transportable management system for textual information.
               To organize the information, each program, subprogram, listing
           or  data  group  is  recorded  as  a  separate  module  of   text.
           Descriptive  information,  called control information, is recorded
           with each module.  The  minimum  information  required  with  each
           module  is  a  name.  For more complete description of the module,
           one may record the  data  type  (language  for  modules  that  are
           programs),   machine  type,  authors'  names  and  addresses,  and
           bibliographic references.   To  organize  programs  consisting  of
           several  modules,  one may record the names of groups of which the
           module is a member, and keywords related to the module.  To record
           information   that  does  not  fall  into  any  of  the  specified
           categories, one may include comments.  All control information  is
           recorded with the text of the module.  The control information and
           the text may be examined and updated separately, but  they  remain
           together on the tape.
               To maintain modules, a simple but flexible updating  mechanism
           is  provided,  and a brief updating history is recorded as part of
           the control information.  As an aid to maintenance and development
           of  programs consisting of several modules, constant text (such as
           global variable declarations) may be automatically inserted in the
           correct  position when the program text is copied from an exchange
           tape to a user file.
                  Operations   of   the  comprehensive  exchange  program are
           controlled by a collection of  simple  commands.   The  system  is
           designed  to  be especially easy to use by the receiver of a tape.
           For example, to copy all text from an  exchange  tape  to  a  user
           file, only three commands are required:
0            INTAPE=10    Define the exchange tape Fortran unit number.
             OUTPUT=11    Define the user file Fortran unit number.
             COPY=1-999   Copy modules 1-999 to the user file.  If there  are
                          fewer  than 999 modules present, only those present
                          are copied.
0
 .
 .
                                          2-2
1
                                  Text Exchange System
 .
 .
                                   System Description
0          3.  User's Guide for the Comprehensive Program
0
                 The  casual  or  occasional  user  of  the  program may find
           sufficient information to accomplish most simple tasks in  chapter
           4.   The  serious  user, who plans frequent use of the program and
           therefore requires  detailed  knowledge,  may  find  this  section
           easier  to  understand  if  chapter  4  is  studied  prior  to, or
           concurrent with, the study of this chapter.
0
           3.1.  Processing Sequence
0
                 The  program  operation  has  four  phases:  initialization,
           operations between  text  modules,  inserting  text  modules,  and
           updating  text modules.  The program remains in the initialization
           phase until a text module is inserted or updated.  Then the  third
           or fourth phase is entered.  The second phase then alternates with
           either the third or fourth phase.
                 Since  each module consists of separately identified control
           information and text, the insert and  update  phases  are  further
           divided  into two steps.  In the insert phase, control information
           is inserted first, then text is inserted.  In  the  update  phase,
           control  information  is  updated  first,  then  text  is updated.
           Commands are not  recognized  while  text  is  being  inserted  or
           updated,   allowing   modules   consisting   of   commands  to  be
           constructed.
                Some  commands  provide information used during processing of
           later commands, and some commands may be used only during  certain
           phases.   Restrictions  on  the  order  of commands and the phases
           during which they may be submitted are summarized below, and noted
           in the description of the individual commands.
0
           Command         Phases   Remarks
           AUTHOR            3,4
           COMMENT           3,4
           CONTROL RECORD    3,4
           COPY              1,2    Must be preceded by  an  INTAPE  command.
                                    Must   be   preceded  by  SITE  and  DATE
                                    commands if the output exchange  tape  is
                                    defined.  A TITLE command may be supplied
                                    to  replace  the  title  from  the  input
                                    exchange  tape.   The  second form of the
                                    COPY command  must  be  preceded  by  any
                                    necessary   PREDICATE,   LIMIT   or  WORK
                                    commands.
 .
 .
                                          3-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0          DATA TYPE         3,4
           DATE              Any
           GROUP             3,4
           IDENTIFY OUTPUT   Any
           INCLUDE FILE      Any
           INDEX             Any
           INPUT FILE        Any
           INTAPE            1,2
           KEYWORD           3,4
           LIMIT             Any
           MACHINE           3,4
           MARGIN            Any
           NAME              1,2    Initiates  third phase.  Must be preceded
                                    by SITE and DATE commands if  the  output
                                    exchange  tape is defined; if in addition
                                    the input exchange tape is not defined, a
                                    TITLE command must be supplied.
           OPTION            Any
           ORIGIN            3,4
           OUTAPE            1,2
           OUTPUT FILE       1,2
           PREDICATE         Any
           PRINTER           Any
           QUIT              Any
           READER            Any    May not appear in the data source defined
                                    by the INPUT FILE command.
           REFERENCE         3,4
           REMOVE            3,4
           REWIND            1,2    Must be preceded by INTAPE command.
           SIGNAL            3,4
           SITE              Any
           SKIP              1,2    Must be preceded by INTAPE command.
           TEXT              3,4
           TITLE             Any
           UPDATE            Any    When submitted during the first or second
                                    phase, the  fourth  phase  is  initiated.
                                    The UPDATE command must be preceded by an
                                    INTAPE  command,  and  may  need  to   be
                                    preceded by SITE, DATE and TITLE commands
                                    as described for the NAME command.
           WORK              Any
0
           3.2.  General Command Syntax
0
                Operation of the comprehensive exchange program  is  directed
           by  simple  commands.   All commands have the same basic syntactic
 .
 .
                                          3-2
1
                                  Text Exchange System
 .
 .
                                   System Description
0          structure, although some commands may not use all available parts:
0               Command word,Modifier=Parameter.
0          The  command  word  describes  an  action  to  be  performed,   or
           identifies  information  describing  the  operational environment.
           The program examines only the first four characters of the command
           word,  ignoring blanks, and stopping when a comma or equal sign is
           found.  The modifier is  a  single  letter  that  selects  one  of
           several   slightly   different  responses  to  the  command.   The
           parameter provides environmental or control information needed  to
           perform  the  command  or  a  later  command.   Spaces  before the
           parameter are ignored, but spaces  within  the  parameter  may  be
           significant.  The simplest form of the parameter is a text string,
           usually in commands that generate  control  images  on  the  tape.
           Some  commands  require that the parameter begin with a date.  The
           form of the date is a series of six digits: the first two are  the
           year,  the  next  two are the month, and the last two are the day.
           Most of the commands that provide a Fortran unit number to be used
           as  a  data  source  or  destination  also  allow specification of
           information that may be used by system dependent  modules  of  the
           program  to  provide  significant  operational  convenience.   The
           system dependent information  follows  the  unit  number,  and  is
           separated  from the unit number by at least one space.  The system
           dependent information may  be  required.   Consult  [2]  for  more
           information.
                When actions or variations  of  actions  are  selected  by  a
           letter, as in the modifier field described above, or the parameter
           field  of some commands, upper case letters and lower case letters
           have the same meaning.
                 Information  describing  the intended action of the commands
           may be included, to help the human reader, by  starting  an  input
           image  with an asterisk.  The second character is used for Fortran
           vertical format control, and the remainder of the image is  simply
           printed.   A  comment  indicated  by  an  image  beginning with an
           asterisk may appear during any command processing phase of program
           execution.
0
           3.3.  Control Record References
0
               Control record types may be referenced by  the  INDEX  command
           (section  3.4.4),  the  PREDICATE  command (section 3.5.2), or the
           table of contents produced by the simple program (section 4.2.1 of
           [2]).    The   reference   consists   of  a  single  letter.   The
           correspondence between letters and control record types  is  shown
           below.
 .
 .
                                          3-3
1
                                  Text Exchange System
 .
 .
                                   System Description
0             A = Author of the text module.
              B = Bibliographic reference.
              C = Comment.
              D = Data type of the  text  module,  e.g.  Assembler,  Fortran,
                  Algol, data, list, etc.
              G = Group of which the text module is a member.   This  control
                  record  facilitates  processing collections of related text
                  modules.
              J = Signal  denoting  change  control  or  end  of  text,  when
                  inserting  or  updating  text  modules.   Consult  sections
                  3.5.3.2 and 3.5.4.3.
              K = Keywords associated with the text module.
              M = Machine type.  This is usually associated with text modules
                  that are programs.
              O = Date and site where the text module originated.
              P = Name of the text module.  (The TES was originally  intended
                  for  exchange of programs only.  The use of the letter P to
                  denote  the  name  of  a  text  module  is   retained   for
                  compatibility with earlier versions of the programs.)
              R = The character removed to compress the  text.   The  default
                  value for each text module is a space.
              S = The date and site where the text module was updated.
           Control records denoted by  the  letters  E  and  I  have  special
           meaning  to  the  programs  and  may not be referenced by INDEX or
           PREDICATE commands.  Control records denoted by other letters have
           no  predefined  meaning, but may be produced by the CONTROL RECORD
           command.
0
           3.4.  Commands for Defining the Environment
0
                A complete description of the operating environment  requires
           supplying  the date the program is executed, identification of the
           site at which the program is executed, identification of any tapes
           to  be  written,  definition of data sources and destinations, and
           selection of global options that affect command action.
0
           3.4.1.  General Environment Description
0
           The two commands  described  here  may  be  submitted  during  any
           command processing phase.
0           DATE=   Provides the date the program is executed.  The parameter
             is a date consisting  of  6  digits  (YYMMDD)  as  described  in
             section 3.2.  Required only if exchange tapes are to be written.
 .
 .
                                          3-4
1
                                  Text Exchange System
 .
 .
                                   System Description
0            The date may  be  provided  automatically  by  system  dependent
             actions.  Consult [2] and site documentation.
0           SITE=  Provides the site where  the  program  is  executed.   The
             parameter  consists  of  up  to 40 characters, which are written
             into the label of  exchange  tapes.   This  is  required  if  an
             exchange  tape is to be created, or if an existing exchange tape
             is to be copied  to  a  new  exchange  tape  with  additions  or
             changes.   It  is  not  needed  if an exchange tape is not being
             written, or if an existing exchange tape is to be  copied  to  a
             new  exchange  tape  without  changing any modules, but possibly
             omitting some modules.  A default value for the  SITE  parameter
             may be provided by site dependent actions of the program.
0           MARGIN= Specifies the maximum number of columns of input examined
             during interpretation of commands.  The default value is usually
             180, but consult [2] and  site  dependent  documentation.   This
             command  may be used to prevent examination of part of the image
             containing   information   not   acceptable   to   the   command
             interpreter.   Some  text  editors,  for  example,  include line
             numbers in columns 73 to 80.  To prevent the command interpreter
             from  attempting  to  interpret these line numbers, use MARGIN =
             72.
0
           3.4.2.  Defining Data Sources
0
            READER=  Provides a  Fortran  unit  number  from  which  to  read
             subsequent  commands  and text.  The parameter is an integer.  A
             default is provided by the system dependent  environment.   This
             command  may  appear  during  any  command  processing  phase of
             program execution, but may not appear in the data source defined
             by the INPUT FILE command.
0           INPUT FILE= Provides a Fortran unit number  from  which  to  read
             subsequent commands and text.  Different from the READER command
             in that its action is temporary.  When the end of the input file
             is  sensed,  either in a system dependent way, by recognition of
             the QUIT command, or by specifying INPUT FILE  =  0,  subsequent
             commands  and text are once again obtained from the Fortran unit
             defined by the READER command.   The  parameter  is  an  integer
             followed  by  system  dependent  information.   This command may
             appear during any command processing phase of program execution.
0           INTAPE=  Provides a Fortran unit number denoting an exchange tape
             to be read.  The parameter is  an  integer  followed  by  system
             dependent  information.   This  command  may  appear only during
 .
 .
                                          3-5
1
                                  Text Exchange System
 .
 .
                                   System Description
0            initialization or between modules.
0           INCLUDE  FILE=  Provides a Fortran unit number to search for text
             to be included  when  a  native  format  output  file  is  being
             written.   The  parameter  is  an  integer  followed  by  system
             dependent information.   This  command  may  appear  during  any
             command  processing phase of program execution.  Consult section
             3.5.5.
0           TEXT=   Notifies  the  program  that input of descriptive control
             information associated with a text module is complete, and  that
             input of the text of the module or corrections is to begin.  The
             parameter  may  be  an  integer  followed  by  system  dependent
             information,  providing  the  Fortran unit number of a file from
             which to read text  or  corrections.   If  the  equal  sign  and
             parameter  are  omitted,  text  or  corrections  follow the TEXT
             command.  This command may only  appear  during  the  insert  or
             update phases of program execution.
0
           3.4.3.  Defining Data Destinations
0
            PRINTER=  Provides a Fortran unit number for all printed listings
             and  program  messages.  The parameter is an integer.  A default
             is provided by the system dependent environment.   This  command
             may  appear  during  any  command  processing  phase  of program
             execution.
0           OUTAPE=  Provides a Fortran unit number denoting an exchange tape
             to be written.  The output exchange tape is not opened  until  a
             COPY,  NAME  or  UPDATE  command  is executed.  When the tape is
             opened,  information  supplied  by  the  DATE,  SITE  and  TITLE
             commands  is also used.  The parameter is an integer followed by
             system dependent information.   This  command  may  appear  only
             during initialization or between modules.  If OUTAPE is provided
             when a unit number is known for the output  exchange  tape,  and
             information  has  been  written on the output exchange tape, the
             current tape is closed by writing an end of file mark,  and  the
             newly  specified  tape is opened, even if the new unit number is
             the same as the current unit number.
                If the 'U' modifier is selected, the date and site of program
             execution are written in the 'last update performed'  fields  of
             the  output  tape  label,  and modules may be inserted, updated,
             copied or deleted.  If the 'U' modifier  is  not  selected,  the
             date and site of program execution are not recorded in the 'last
             update performed' fields of the output tape label,  and  modules
             may  not  be inserted or updated, although they may be copied or
 .
 .
                                          3-6
1
                                  Text Exchange System
 .
 .
                                   System Description
0            deleted.
0           TITLE=   Provides  a  title  for  the  output exchange tape.  The
             parameter is a string of  up  to  40  characters.   A  title  is
             required  if  the  output  tape is defined and the input tape is
             not.  It is optional if the input tape is defined.  If provided,
             the  parameter  of  this command is always used for the title of
             the output tape.  If not provided, the title of the  input  tape
             is  used  for the output tape.  If the parameter is omitted, any
             previously stored title is discarded.  This command  may  appear
             during any command processing phase.
0           OUTPUT FILE=  Provides a Fortran unit number denoting a  file  to
             be  written  in the native format of the host.  The parameter is
             an integer followed by  system  dependent  information.   If  an
             OUTPUT FILE is defined at the time this command is provided, the
             current output file is closed by writing an end  of  file  mark,
             even  if  the unit number of the current output file is the same
             as specified on the  OUTPUT  FILE  command.   This  command  may
             appear  only during the initialization phase or between modules.
0           IDENTIFY OUTPUT=  Provides specifications for  emitting  sequence
             numbers  and  constant  text in the images written to the native
             format output file.  The parameter is four integers separated by
             commas,  followed  by a comma and up to 40 characters of text to
             be emitted, e.g.  'C1,C2,STEP,START,IDTEXT',  where  C1  is  the
             first  column  of  the output to be occupied by sequence numbers
             and emitted text;  C2 is the last  such  column;   STEP  is  the
             difference  between  successive  sequence numbers;  START is the
             first  sequence  number  to  produce;  and  IDTEXT  is   emitted
             beginning  in  column  C1  and continuing to column C2.  Leading
             spaces of IDTEXT are  significant.   If  IDTEXT  is  too  short,
             remaining  columns  between  C1  and  C2 are filled with spaces.
             Excess text is ignored.  After IDTEXT is  emitted,  the  decimal
             representation of the sequence number is produced beginning with
             the low order digit, and stored right justified in  the  defined
             columns.   Production  of  digits  ceases  after  the high-order
             significant digit is produced.  This results  in  production  of
             sequence  numbers  with  leading  zeros  suppressed.  If leading
             zeros are desired, zeros must be  supplied  in  the  appropriate
             positions  of  IDTEXT.  All parts of the parameter are optional.
             If any of the integers are omitted, they are assumed to be zero.
             If  IDTEXT is omitted, no text is emitted between columns C1 and
             C2 before sequence  numbers  are  produced.   C1  is  internally
             restricted to be between 1 and 178.  C2 is internally restricted
             to be between zero and 178.  If C1 is  greater  than  C2  (which
             will become true if both are omitted), neither text nor sequence
             numbers will be emitted.  If STEP is zero sequence  numbers  are
 .
 .
                                          3-7
1
                                  Text Exchange System
 .
 .
                                   System Description
0            not produced.
                The modifier determines whether to produce  sequence  numbers
             corresponding  to the input tape, the output tape, or the native
             format output file.   If  the  'I'  modifier  is  selected,  the
             sequence  numbers are computed by adding START to the product of
             STEP and one less than the position of the  image  in  the  text
             module  on  the input exchange tape.  If the image came from the
             input stream (because the  module  is  being  inserted,  or  the
             module  is  being  updated  and  the  image  is a new image), no
             sequence number is produced and IDTEXT is not emitted.   If  the
             image  is  produced  as  the result of a request to include text
             from the INCLUDE FILE, the  sequence  number  of  the  image  is
             derived  from the position of the request on the input tape.  As
             for normal text, no sequence number is produced  and  IDTEXT  is
             not emitted if the request came from the input stream.
                If the 'O' modifier is selected,  the  sequence  numbers  are
             computed  by  adding  START  to the product of STEP and one less
             than the position of the image in the text module on the  output
             exchange  tape  (or  if the output exchange tape is not defined,
             the position the image would have if it were  defined).   Images
             produced  as  a  result  of  a  request to include text from the
             INCLUDE FILE receive a sequence number derived from the position
             of the request on the output tape.
                If the 'F' modifier is selected,  the  sequence  numbers  are
             computed  by  adding  START  to the product of STEP and one less
             than the position of the image in the native format output file,
             relative  to  the  position  of the beginning of the text of the
             module.
                 If  the  'C'  modifier is selected, the sequence numbers are
             computed by adding START to the product of  STEP  and  one  less
             than the position of the image in the native format output file,
             relative to the position of the output  file  at  the  time  the
             IDENTIFY OUTPUT command was specified.  (When the output file is
             redefined, the reference position is changed to zero).
                If no modifiers are selected, the 'O' modifier is assumed.
                This command may appear during any command  processing  phase
             of program execution.
0
           3.4.4.  Selecting Global Options
0
            OPTION=  Selects  global  options.   The  parameter  consists  of
             letters.  Individual letters select individual options.  Some of
             the letters select options exercised by the  portable  parts  of
             the  program.   Other  letters  may  select options exercised by
             system  dependent  parts  of  the  program.   All  options   are
             initially   deselected,  unless  initially  selected  by  system
 .
 .
                                          3-8
1
                                  Text Exchange System
 .
 .
                                   System Description
0            dependent initialization of the environment.   Consult  [2]  for
             such  information.   If  no  modifiers are selected, all options
             (including options having meaning only to system dependent parts
             of the program) are cleared (deselected) before the parameter is
             examined.  If the 'C' modifier is selected, letters appearing in
             the  parameter  denote  options  to  be  cleared.   If any other
             modifier is selected, letters appearing in the parameter  denote
             options  to  be selected in addition to those already in effect.
             The modifier is processed if  the  parameter  is  omitted.   All
             options may be deselected by using no modifier and no parameter.
             This command may appear  in  any  command  processing  phase  of
             program  execution.   Options exercised by the portable parts of
             the program are described below.
              A = Used in conjunction with the 'L' or 'S' options.  If a data
                  type  control  record  having  the  first  four  characters
                  exactly equal 'LIST' is associated  with  a  module  to  be
                  listed,  and  the  'A'  option  is  selected, the module is
                  printed as though the 'V' option had also been selected.
              C = If  the  'C'  option  is selected, commands used to produce
                  control information are produced in  association  with  any
                  modules  written  on the native format output file.  If the
                  'C' option is not selected, only text  is  written  on  the
                  output  file.  Control information is always written on the
                  output exchange tape.
              E = If  the  'E' option is selected all commands submitted will
                  be printed.  If the 'E' option is not selected commands are
                  printed only when they cause an error.
              I = If the 'I' option is selected, and a module is to be listed
                  because  the  'L'  or 'S' option is also selected, then any
                  images included from the INCLUDE FILE are also listed.   If
                  the 'I' option is not selected, only the request to include
                  text is listed.
              L = If  the  'L'  option  is selected, all text modules copied,
                  inserted, or updated are listed.  If the 'L' option is  not
                  selected,  modules  copied will not be listed, but inserted
                  or updated modules may be.  Consult the description of  the
                  'S' option.
              S = If the 'S' option is selected, inserted and updated modules
                  will be listed.  If the 'S' option is not selected, listing
                  is completely controlled by the 'L' option.
              V = If  the  'V'  option  is  selected,  modules  to  be listed
                  (because the 'L' or 'S' options are selected) will use  the
                  first  character  of each image for Fortran vertical format
                  control.  If the 'V' option is not selected,  modules  will
                  be  listed  with  sequence  numbers.  The effect of the 'V'
                  option may be  obtained  automatically  by  using  the  'A'
                  option.
0.
 .
                                          3-9
1
                                  Text Exchange System
 .
 .
                                   System Description
0           INDEX=  Selects control information to be printed as text modules
             are inserted,  updated  or  copied.   If  the  'L'  modifier  is
             selected,   such   information  will  only  be  printed  if  the
             associated module is to be listed (the appropriate  option  must
             be  in effect at the time the control information is processed).
             The  parameter  is  a  sequence  of  letters  selecting  control
             information  to be printed.  The parameter may also begin with a
             dash, which means all control information except that  indicated
             by following letters is to be printed.  If the parameter is void
             no index information is  printed.   The  correspondence  between
             letters  in the parameter and control record types was explained
             in section 3.3.  This command  may  appear  during  any  command
             processing phase of program execution.
0
           3.5.  Defining the Program Action
0
                The program can perform  five  basic  actions:  position  the
           input  tape,  copy selected text modules, insert new text modules,
           update control records, and update existing text modules.
0
           3.5.1.  Positioning the Input Exchange Tape
0
            SKIP=  Positions the input tape after the specified text  module,
             if  no  modifier  is  specified,  or  forward past the specified
             number of text modules if the  F  modifier  is  specified.   The
             parameter  is  an  integer.  This command may appear only during
             the initialization phase or between modules.
0           REWIND   Rewinds the input exchange tape.  There is no parameter.
             This command may appear only during the initialization phase  or
             between modules.
0
           3.5.2.  Copying Selected Text Modules
0
            COPY=   Causes  text modules to be copied from the input exchange
             tape to the output exchange tape (if defined), the native format
             output  file (if defined), and the printer (if the 'L' option is
             selected).  This command may appear only in  the  initialization
             phase or between modules.  The parameter may have two formats.
                The first format of the  parameter  is  a  list  of  integers
             separated by commas or dashes.  The integers denote text modules
             according to their position on the  input  exchange  tape.   The
 .
 .
                                          3-10
1
                                  Text Exchange System
 .
 .
                                   System Description
0            integers must be specified in strictly increasing order.  If two
             integers  in  the  parameter  are  separated by a dash, the text
             modules denoted by  both  integers,  and  all  intervening  text
             modules, are to be copied.
                The second format of the parameter is a  logical  expression.
             The  environment  of this form of the COPY command is controlled
             by the LIMIT, PREDICATE and WORK commands described below.   The
             logical   expression  consists  of  logical  variables,  logical
             operators, and parentheses.  The logical variables  are  denoted
             by the letters A through H, and the letter N.  Before processing
             of each  text  module  is  begun,  the  values  of  the  logical
             variables  A  through  H are made FALSE.  As the control records
             associated with a text module are processed, the information  in
             the  control  records  is  examined  as  specified  by PREDICATE
             commands, and the values of the logical variables  A  through  H
             may  be changed to TRUE.  The value of the logical variable N is
             always FALSE.  When all control records associated with  a  text
             module have been examined, or when all defined logical variables
             (except N) have  the  value  TRUE,  the  logical  expression  is
             evaluated.   The  operators  that  may  appear  in  the  logical
             expression are +, -, *, and /, which denote OR, OR NOT, AND, AND
             NOT  respectively.  The * and / operators bind to their operands
             with the same strength, and the + and - operators bind to  their
             operands  with the same strength.  The * and / operators bind to
             their operands more strongly than the  +  and  -  operators.   A
             sequence  of  operators  of  equal binding strength is evaluated
             from  left  to  right.   The  normal  binding  strength  may  be
             superceded by the use of parentheses.
               Processing of text modules  by  the  second  form  of  a  COPY
             command  ceases  at the end of the input exchange tape, or after
             the text module specified by the LIMIT command.  If one  of  the
             I,  P,  S  or  X  modifiers  is  selected,  processing may cease
             earlier.  The effect of a modifier is shown below.
0            None   All  modules for which the logical expression is true are
                copied.
             I  All  modules  prior  to  and (I)ncluding the first module for
                which the logical expression is true are copied.  Exactly one
                module may be copied by COPY,I=N-N.
             P  Modules (P)rior to the first module  for  which  the  logical
                expression is true are copied.
             X  E(X)actly one module is copied, the first  module  for  which
                the logical expression is true.
             S  No modules are copied.
0            If  the  P  or  S modifiers are selected the input exchange tape
             will be positioned after the control records of the first module
             for  which  the logical expression is true.  The control records
 .
 .
                                          3-11
1
                                  Text Exchange System
 .
 .
                                   System Description
0            of this module may therefore not be changed.   If  a  module  is
             inserted  or copied at this point, the module at which the input
             exchange tape is positioned will be copied before the module  is
             inserted,  achieving  the  effect  of  the I or X modifier.  If,
             however, a SKIP, REWIND or INTAPE command intervenes the  module
             cannot  be  copied.   The  P  and  S modifiers are primarily for
             positioning the tape before update  operations.   If  any  other
             modifier  is  selected,  or  no  modifier is selected, the input
             exchange tape will be positioned before the control  records  of
             the first module after the last module copied.
                Under certain conditions a more efficient method for  copying
             the  text of a module will be used automatically, by leaving the
             information read from the input exchange tape  in  the  internal
             (machine sensitive, non portable) form.  This may not be done if
             a nearby prior module has been updated, if control  records  are
             to  be  printed because of an INDEX command, or if text is to be
             printed.
0           LIMIT=   Specifies the maximum text module number to be processed
             by a COPY command having a logical expression as the  parameter.
             The  parameter is an integer.  If the LIMIT command has not been
             specified, or the value of  the  parameter  is  zero,  the  COPY
             command continues processing until the end of the input exchange
             tape is detected.  This command may appear  during  any  command
             processing phase of program execution.
0           PREDICATE=  Specifies criteria for determining  the  value  of  a
             logical  variable  used  in the second form of the COPY command.
             The  parameter  is  a  sequence  of  characters  of   the   form
             VRPMtarget.   V is the name of a logical variable (A through H).
             R denotes a control record type (section 3.3).   P  may  be  the
             letter  A to indicate that the value of logical variable V is to
             be changed to TRUE if target appears  (A)nywhere  in  a  control
             record  of  the specified type, or the letter X to indicate that
             the value of logical variable V is to  be  changed  to  TRUE  if
             target  appears in e(X)actly the specified position in a control
             record of the specified type.  M is a mask  character  that  may
             appear  anywhere  in  target  to indicate that characters in the
             corresponding position of the  control  record  are  not  to  be
             compared  to  target.   For example, if the mask character is *,
             and target is A*B, then a sequence consisting of the  letter  A,
             followed  by  any character, followed by the letter B, appearing
             in a control record, is equal to  target.   If  target  contains
             more  than 37 characters, only the first 37 are used.  If target
             contains  fewer  than  37  characters,  omitted  characters  are
             assumed  to  be  the  mask  character.   If significant trailing
             blanks are needed in target they must  be  followed  by  a  mask
             character.   When  comparing target to the contents of a control
 .
 .
                                          3-12
1
                                  Text Exchange System
 .
 .
                                   System Description
0            record, a lower case letter is considered to  be  equal  to  the
             corresponding   upper  case  letter.   If  the  equal  sign  and
             parameter are omitted all active predicates are  printed.   This
             command  may  appear  during  any  command  processing  phase of
             program execution.
0           WORK=   Defines  a  Fortran  unit  number  for a file used during
             execution of a COPY command of the second form.   The  parameter
             is  an  integer.   A  default  value  is usually provided by the
             system dependent environment, consult  [2].   This  command  may
             appear during any phase of program execution.
0
           3.5.3.  Inserting Text Modules
0
           If the input and output exchange  tapes  are  both  defined,  text
           modules  may  only be inserted if the U modifier was selected when
           the output exchange tape was defined.  Consult the description  of
           the OUTAPE command in section 3.4.3.
0
           3.5.3.1.  Inserting Control Information
0
            NAME=   Indicates  that control information associated with a new
             text module is to be input.  The parameter is the  name  of  the
             text   module.    This   command  may  appear  only  during  the
             initialization phase  or  between  modules,  and  initiates  the
             insert phase.
0          The  following  commands  may  appear  only  during  the   control
           information  processing  part  of  the  insert or update phases of
           program execution.
0           AUTHOR=  The parameter specifies the author of the text module.
0           COMMENT=   Allows  inclusion of narrative descriptive information
             as part of  the  control  information  associated  with  a  text
             module.
0           CONTROL RECORD= Produces a control record other than those having
             a  predefined  meaning.   The modifier is a letter that provides
             the control record type, and may  not  be  any  of  the  letters
             corresponding  to predefined control records (section 3.3).  The
             parameter is the content of the control record.
0           DATA  TYPE=  The parameter specifies the type of data the text of
 .
 .
                                          3-13
1
                                  Text Exchange System
 .
 .
                                   System Description
0            the module represents.  E.g. Fortran, data, list, text.
0           GROUP=   The  parameter  specifies groups of modules of which the
             current module is a member.  This is to facilitate management of
             collections of modules.
0           KEYWORD=  The parameter specifies keywords and phrases describing
             the   text   module.    This  is  to  facilitate  management  of
             collections of modules.
0           MACHINE=  The parameter specifies machine types for which modules
             that are programs were designed, or have been tested.
0           ORIGIN=   The  parameter  should  begin with the date (YYMMDD) on
             which the module was created, and in addition provides the  site
             at  which  the module was created.  If the date is not specified
             the date provided by the DATE command is inserted and a  message
             is printed.
0           REFERENCE=   The  parameter  provides  bibliographic   references
             relevant to the text module.
0           REMOVE=  The parameter  is  a  single  character  specifying  the
             character  to  be  removed  to  compress  the  text.  Characters
             removed to compress the text are automatically re-inserted  when
             the  text  is copied to the native format output file.  If there
             is no REMOVE command associated with a text module,  blanks  are
             removed.
0           SIGNAL=  The parameter  is  a  single  character  specifying  the
             character  used  in the first column of text to identify include
             requests and corrections, and in the first two columns  of  text
             to identify the end of text or correction input.  If there is no
             SIGNAL command associated with a text module, a  dash  is  used.
             The signal character may be changed during processing of text or
             corrections, as described in sections 3.5.3.2 and 3.5.4.3.
0           UPDATE=   The  parameter  should  begin with the date (YYMMDD) on
             which the module was updated, and in addition provides the  site
             at  which  the module was updated.  If the date is not specified
             the date provided by the DATE command is inserted and a  message
             is printed.
0
0
0
 .
 .
                                          3-14
1
                                  Text Exchange System
 .
 .
                                   System Description
0          3.5.3.2.  Inserting the Text of New Modules
0
                 When  all  control information associated with a text module
           has been processed, input of the text of the module  is  initiated
           by  the  TEXT  command.   Input  of  text continues until a signal
           character is found in the first two columns of an image, or an end
           of file is sensed in a system dependent way.  The portable version
           of the program cannot sense an end of file  in  the  text  stream.
           The  signal  character is initially defined by the SIGNAL command,
           or is a dash if there is no SIGNAL  command  associated  with  the
           text   module.    The  signal  character  may  be  changed  during
           processing of the text by the appearance of  '-=*'  in  the  first
           three columns of an image, where - is the current signal, and * is
           the new signal.  Changes of the signal character  accomplished  by
           this  method  are  not recorded on the exchange tape or the native
           format output file.
0
           3.5.4.  Updating Text Modules
0
           If the input and output exchange  tapes  are  both  defined,  text
           modules  may only be updated if the U modifier was selected at the
           time  the  output  exchange  tape  was   defined.    Consult   the
           description of the OUTAPE command in section 3.4.3.
0
           3.5.4.1.  Updating Control Information
0
                 Assume  that  the  input  exchange tape is positioned at the
           beginning of  the  control  information  associated  with  a  text
           module.  The phase of program execution is thus the initialization
           phase or between modules.  To  change  the  j'th  control  record,
           provide  an  image  containing  a  dash  in column 1, the number j
           beginning in column 2, at least one blank, and the new content  of
           the  control  record.   If  the  new  content is void, the control
           record is deleted (unless it is the module name  control  record).
           Modifications  of  control records must be specified in increasing
           order.  The type of a control record  may  not  be  changed.   The
           format  of  the  new  content  of  control records is not checked;
           control records that should begin with a date may accidentally  be
           changed so that they do not begin with a date.
                The  changed  control  record,  and  prior  control   records
           associated with the current text module, are not accessible by the
           COPY command of the second form.  If a COPY command of the  second
           form  is  submitted  immediately  after control records associated
 .
 .
                                          3-15
1
                                  Text Exchange System
 .
 .
                                   System Description
0          with the current text module have been  changed  or  deleted,  the
           text module is copied without examining the logical expression.
                Changing a control record by the method described  here  does
           not  guarantee that the module will be written to the defined data
           destinations.  The module must be copied, either explicitly  using
           a  copy  command  of  the  first  form, or implicitly using a copy
           command of the second form, or the text of the module updated,  to
           insure   that   the   module   is  written  to  the  defined  data
           destinations.
0
           3.5.4.2.  Adding Control Information
0
                If the UPDATE  command,  described  in  section  3.5.3.1,  is
           provided  during  the initialization phase or between modules, the
           update phase is initiated.  First, control information  associated
           with  the  text  module  at  which  the  input  exchange  tape  is
           positioned is copied, and the UPDATE command is processed as  when
           inserting  a  new  module.   Then,  the  appearance  of any of the
           commands described in section 3.5.3.1, except  the  NAME  command,
           may be used to augment the control information associated with the
           text module.  The TEXT command indicates that all additions to the
           control  information  have  been  provided, and corrections to the
           text of the module follow.
0
           3.5.4.3.  Updating the Text of a Module
0
           The  text of a module may be updated after the control information
           has been modified or augmented.  Corrections  to  the  text  of  a
           module may insert new lines of text, replace old lines of text, or
           modify old lines of text.  Instructions provided to the program to
           direct the updating process refer to the position of images in the
           text module on the input  exchange  tape.   Updating  instructions
           begin  with  a  signal  character.   The  signal  character may be
           provided by a SIGNAL command associated with the text module.   If
           no SIGNAL command is provided, the signal character is initially a
           dash.  The signal character may be changed  during  processing  of
           updating  instructions  by  an image containing '-=*' in the first
           three columns, where - is the current signal, and  *  is  the  new
           signal.   Such changes of the signal character are not recorded on
           the output exchange tape or native format  output  file.   In  the
           descriptions  below,  the current signal character is denoted by a
           dash.
                 There  are  three  forms of instructions to update text.  To
           insert text after the k'th image of  a  text  module,  provide  an
 .
 .
                                          3-16
1
                                  Text Exchange System
 .
 .
                                   System Description
0          instruction  beginning with '-k '.  Examination of the instruction
           stops when the space following the  number  k  is  detected.   All
           images following the instruction until another instruction appears
           are inserted after the k'th image of the text module.
                To replace the i'th through j'th images  of  a  text  module,
           provide an instruction beginning with '-i,j '.  Examination of the
           instruction stops  when  the  space  following  the  number  j  is
           detected.   All  images  following  the  instruction until another
           instruction appears replace images i through j of the text module.
           To delete images i through  j,  do  not  provide  any  replacement
           images.
                To modify the  k'th  image  of  a  text  module,  provide  an
           instruction beginning with '-k$ '.  Examination of the instruction
           stops when the space after the dollar sign  is  detected.   Images
           following  the  instruction  until  another  instruction  is input
           specify modifications of the k'th line of the  text  module.   The
           change  specifications are of the form 'N1,N2/old text/new text/'.
           N1 and N2 are integers specifying a range of columns of the  input
           image  to  be  changed.   If ',N2' is omitted the range of columns
           extends from column N1 to the end of the image; if  'N1'  is  also
           omitted,  all  columns  of the image are to be considered.  In the
           range of columns defined by N1 and N2 (or the default range),  the
           leftmost  occurrence  of 'old text' is replaced by 'new text'.  If
           the lengths of 'old text'  and  'new  text'  are  different,  text
           following  'old  text' in the image will be shifted appropriately.
           If ',N2' is omitted, the length of the image may change.  To allow
           'old text' and 'new text' to contain almost any character, the '/'
           appearing in the description above  denotes  any  character  other
           than  a digit, comma, or space.  (If N1 and N2 are both omitted, a
           dash may only be used if the change specification does  not  begin
           in  column 1).  This character delimits 'old text' and 'new text',
           and may not appear in either string.  If the final delimiter  (the
           third slash in the description) is omitted, columns following 'old
           text' are changed to spaces before 'old text' is replaced by  'new
           text'.   After  modifying an image, the modified image rather than
           the input image is the subject of further modifications.
0
           3.5.5.  Including Text from Alternate Sources
0
                 Collections of related programs frequently contain groups of
           statements  that  must  be  the  same  in  every  member  of   the
           collection.   To  facilitate  maintenance of such collections, the
           exchange program provides a method to include  text  automatically
           from a source specified by the INCLUDE FILE command.
0
 .
 .
                                          3-17
1
                                  Text Exchange System
 .
 .
                                   System Description
0          3.5.5.1.  Format of Request to Include Text
0
                The position in the text of the module at which text from the
           source identified by the INCLUDE FILE command is to be inserted is
           identified by a control record on the input exchange tape, or by a
           request  in  the  text  stream.   The  request  in the text stream
           generates the appropriate control record on  the  output  exchange
           tape.   The  request  for  text  to be included begins with '-I ',
           where '-' is the  current  signal,  and  at  least  one  space  is
           required  after  the  I.  The text to be included is identified by
           the remainder of the request.  The string of  characters  starting
           with  the first non-space character after column 3, and consisting
           of at most 40 characters, is called a search target.   The  source
           identified  by  the  INCLUDE  FILE  command  is searched until the
           search target is found, and the text associated  with  the  search
           target  is  then  copied to the native format output file.  If the
           INCLUDE FILE is not defined, or the search target  is  not  found,
           the request is written on the native format output file.
0
           3.5.5.2.  Format of Information on the INCLUDE FILE
0
                The structure of information on the INCLUDE  FILE  is  rigid.
           Information    is   divided   into   identifiable   groups.    The
           identification of a group consists of the sequence  '-I'  followed
           by  exactly  one  blank,  followed by up to 40 characters of text.
           The first image following the group identification defines the end
           marker  for that group, consisting of up to 40 characters of text.
           The body of the group follows, and consists of all text until  the
           end  marker  defined above is found.  The INCLUDE FILE is searched
           sequentially.  Thus, if several groups are to be  included  during
           output  of  several  text  modules,  requests  to include text are
           processed most efficiently if they appear in the same order as the
           text  groups  are  stored  on  the  INCLUDE  FILE.  The end of the
           INCLUDE FILE may be sensed in a system dependent way,  or  by  the
           sequence   '--'   appearing  when  text  group  identification  is
           expected.
0
           3.5.6.  The QUIT Command
0
                The end of input cannot be sensed in  a  portable  way.   The
           QUIT  command  provides a method to indicate the end of input.  If
           the QUIT command  appears  in  the  file  defined  by  the  READER
           command,  all  files  are closed and program execution ceases.  If
 .
 .
                                          3-18
1
                                  Text Exchange System
 .
 .
                                   System Description
0          the QUIT command appears in the file defined  by  the  INPUT  FILE
           command,  subsequent  commands and text are obtained from the file
           defined by the READER command.  In addition, when the QUIT command
           appears  in  the  file  defined  by  the INPUT FILE command, the R
           modifier may be selected to indicate that the file defined by  the
           INPUT  FILE  command  is to be rewound.  A QUIT command may appear
           during any command processing phase of program execution.
0
           3.6.  Printed Output of the Comprehensive Program
0
0
           3.6.1.  Format of Tape Label Information
0
                When exchange tapes are written the title of  the  tape,  the
           site  at  which  it  was  written,  and the date are recorded in a
           special record at the beginning of the tape, called a label.  When
           exchange  tapes  are  read  or  written  the  label information is
           printed.  The format of the display of tape label  information  is
           shown below.
0             TAPE WRITTEN yymmdd, TITLE=user title            line 1
              ORIGINALLY WRITTEN yymmdd BY site                line 2
              LAST UPDATE yymmdd BY site                       line 3
              DATA CHARACTERS PER BLOCK = nnnnn                line 4
              ERROR CORRECTION CHARACTERS PER BLOCK = nnnnn    line 5
0          The date in line 1 above is the date the tape was written, even if
           no changes were made to the contents of the tape.   The  title  in
           line  1  is  the  title  provided  for the tape, either by a TITLE
           command or from the title of an input exchange tape.  The date  in
           line  2  is  the  date the tape was originally created from native
           format information without using an input exchange tape.  The site
           in line 2 is the site supplied by a SITE command when the tape was
           originally written.  The date in line 3 is the date the  tape  was
           last updated or added to.  The site in line 3 is the site supplied
           by a SITE command when the tape was updated.  The  information  in
           line  3 is put in the tape label when the U modifier of the OUTAPE
           command is selected.  The number  in  line  4  is  the  number  of
           characters  used  to  record  data.  Since the text is compressed,
           this is not necessarily equal to the number  of  significant  text
           characters  per  block.   The  number  in  line 5 is the number of
           characters  appended  to  each  block  for  error  detection   and
           correction  purposes.   If  this  number  is  zero  line  5 is not
           printed.  The total number of characters  in  each  block  is  the
 .
 .
                                          3-19
1
                                  Text Exchange System
 .
 .
                                   System Description
0          number in line 4, plus the number in line 5 if any, plus 9.
0
           3.6.2.  Format of Index Information
0
                Index information is  printed  using  one  line  per  control
           record  associated  with  the text module.  Each line of the index
           appears as
0          mmmm nnnn*   type=text
0          where mmmm is a module number, nnnn is the ordinal position of the
           control record in the index for the module, type is the first four
           letters of the command used to generate the  control  record,  and
           text is the text provided by that command.  The module number that
           is printed depends upon whether  the  input  and  output  exchange
           tapes  are  defined.   If  the  output  tape is defined the module
           number is the ordinal position of the module on the  output  tape.
           If  the  output  tape  is  not defined and a COPY command is being
           processed the module number is the ordinal position of the  module
           on the input tape.  If the output tape is not defined and a module
           is being inserted the module number is zero.
0          If the text of the module is to be listed the index is followed by
0          mmmm*        TEXT
0          where mmmm is the module number,  and  one  blank  line.   If  the
           module is not to be listed the index is followed by
0             nnnnn IMAGES COPIED
0          where  nnnnn  is the number of images written on the native format
           output file or output exchange tape.  If  neither  destination  is
           defined nnnnn is zero.
0
           3.6.3.  Format of List of a Module
0
                If the V option is selected, or the A option is selected  for
           a  module  having  the  text  of  the last associated DATA control
           record equal to LIST, column 1 of each image of the module is used
           for  a  vertical  format  control character by the Fortran library
           output procedures of the host machine, and  the  content  of  each
           image  from  column 2 to the end is printed.  On some machines the
           text is printed beginning in column 2 of the listing, and on other
 .
 .
                                          3-20
1
                                  Text Exchange System
 .
 .
                                   System Description
0          machines it begins in column 1.
                Otherwise the text is printed  with  line  numbers.   If  the
           module is not being updated text lines are printed as
0          nnnn*   text
0          where  nnnn  is  the  ordinal  position  of the image on the input
           exchange tape (if a COPY command is being executed) or the ordinal
           position  of  the  image  in  the  data source defined by the TEXT
           command (if a module is being inserted).  If the line of text came
           from the source defined by the INCLUDE FILE command nnnn refers to
           the position of the request causing text to be included,  and  the
           asterisk is replaced by a dash.
0          If the module is being updated text lines are printed as
0          mmmm nnnn*   text
0          where  mmmm  is  the  ordinal  position  of the image on the input
           exchange tape if the image came from the input exchange  tape,  or
           'NEW  '  if  the  image  is  a  new image, and nnnn is the ordinal
           position of the image on the output exchange tape (if  the  output
           exchange  tape is not defined nnnn is the position the image would
           have if the tape were defined).  If the text  image  is  an  image
           partially  modified  by  corrections  specified  using  '-n$'  the
           asterisk is replaced by a plus sign.  If the text image came  from
           the source defined by the INCLUDE FILE command mmmm and nnnn refer
           to the position of the request causing text to  be  included,  and
           the asterisk is replaced by a dash.
0
           3.6.4.  Informative Messages
0
           Most informative messages are preceded by three  blank  lines  and
           followed by the command being processed.
0          END OF FILE ENCOUNTERED ON INPUT TAPE
             Self explanatory.
0          LIMIT=nnnnnn REACHED.
             The  module  number  specified  by  a  LIMIT  command  has  been
             processed  during  the execution of a copy command of the second
             form.
0          MAXIMUM ERROR SEVERITY DURING COPY WAS n.
           MAXIMUM ERROR SEVERITY DURING INSERT WAS n.
           MAXIMUM ERROR SEVERITY DURING UPDATE WAS n.
 .
 .
                                          3-21
1
                                  Text Exchange System
 .
 .
                                   System Description
0            At least one error occurred during  the  named  process.   Error
             messages are described in the next section.
0          MAXIMUM ERROR SEVERITY WAS n.
             This  message  can  only  be printed when the program stops.  It
             means that at least one  error  occurred.   Error  messages  are
             described in the next section.
0          MORE THAN 20 UNRECOGNIZED COMMANDS,
           PROGRAM ASSUMES TEXT COMMAND IS MISSING.
             If this message appears while processing a text module the  text
             processing  phase  is not entered until a text command is found.
             If a text command really is missing, control records,  text  and
             corrections  intended for the next module will be applied to the
             current module.  The contents of the output exchange tape  could
             be badly confused.
0          SKIPPING TEXT
             Is printed when a TEXT command is improperly placed, prohibiting
             the processing of the text, or when the program believes that  a
             text command is missing.
0
           3.6.5.  Error Messages
0
                 Errors  detected by the program are of varying severity.  In
           the descriptions below, the severity of each message is noted with
           the message.  The error severity is not printed by the program.
0          4 ALL SPECIFIED MODULES PRECEDE CURRENT INTAPE POSITION.
             All module numbers specified by a COPY command of the first form
             are  smaller  than the module number at which the input exchange
             tape is positioned.
0          2 AT LINE mmmmm, EDIT CONTROL FORMAT ERROR, COLUMN nnnnn
             A format error  has  been  detected  while  processing  an  edit
             request  following  a  change  control  instruction  of the form
             '-mmmmm$'.  Edit requests are of the form  N1,N2/target/replace/
             where  N1  and  N2  are  optional integers, and / represents the
             first character that is not a blank, digit or comma.   A  format
             error  is  detected  if N1 is greater than N2 or there are fewer
             than two of the delimiters represented here by /.
0          2 AT LINE mmmmm, NO FIND ON SEARCH STRING.
             The  string  represented  by  'target'  was  not   found   while
             processing  an  edit  request  of the form N1,N2/target/replace/
             following a change control instruction of the form '-mmmmm$'.
 .
 .
                                          3-22
1
                                  Text Exchange System
 .
 .
                                   System Description
0          1 ATTEMPT TO CHANGE OUTSIDE FILE, NEW TEXT APPENDED AT END.
             A change control instruction of the form '-m', '-k,l'  or  '-j$'
             is  being  processed,  and  one  of the integers j, k, l or m is
             greater than the number of lines of text in the  module  on  the
             input  exchange  tape.  If there is any text following the first
             two of these instructions it is  appended  at  the  end  of  the
             output  module.   If any edit requests follow the change control
             request of the form '-j$' the message 'AT LINE mmmmm, NO FIND ON
             SEARCH STRING.' will be produced.
0          9 BLOCK IS TOO SHORT.
             A  block of information read from the input exchange tape is too
             short to contain crucial structural information.
0          9 BLOCK SEQUENCE NUMBER WAS nnnnn, SHOULD HAVE BEEN mmmmm
             BLOCK SEQUENCE ERROR
             If this message is produced while reading an input exchange tape
             the  block  sequence  number  expected to be read from the input
             exchange tape was not the block sequence  number  actually  read
             from  the  input  exchange  tape.   This is usually caused by an
             input data transfer  error  that  was  not  detected.   If  this
             message  is  produced  while  writing an output exchange tape it
             probably means a program error has occurred.
0          2 CHANGE CONTROL FORMAT ERROR, COLUMN nn
             A change control instruction of the form '-m' or '-k,l' is being
             processed  and  one  of  the integers m, k or l does not consist
             entirely of digits, or a change control instruction of the  form
             '-j$'  is  being  processed  and  either  the integer j does not
             consist entirely of digits or the $ is not followed by a  blank.
0          2 CHANGE CONTROL SEQUENCE ERROR
             A change control instruction of the from '-m', '-k,l'  or  '-j$'
             is  being processed and one of the integers j, k, l or m is less
             than such an integer specified  by  a  previous  change  control
             instruction.
0          2 CHANGE TO CONTROL RECORDS NOT ALLOWED DURING INSERT OR UPDATE
             A  request  of  the form '-n text' to change control record n of
             the text module at which the input exchange tape  is  positioned
             has   been   detected  while  processing  control  records  when
             inserting or updating a text module.  If a text module is  being
             inserted  there  are  no  control  records to change.  If a text
             module is  being  updated  all  control  records  on  the  input
             exchange  tape  have already been processed.  This error message
             may appear if a TEXT command is accidentally  omitted  after  an
             UPDATE command.
0.
 .
                                          3-23
1
                                  Text Exchange System
 .
 .
                                   System Description
0          5 COMMAND HAS IMPROPER DATE.
             A DATE, ORIGIN or UPDATE command is being processed and the date
             does not consist entirely of digits, or the  integers  represent
             impossible  dates  (e.g.  the  month number is greater than 12).
             This message is produced by ORIGIN or UPDATE  commands  only  if
             the current date has not been supplied.
0          5 COMMAND IS INCOMPLETE.
             A  PREDICATE command is being processed and the parameter is too
             short to contain the variable name, record  type,  and  position
             indicator.
0          5 COMMAND MAY NOT APPEAR IN INPUT FILE.
             A  READER  command  appeared in a file defined by the INPUT FILE
             command.
0          5 COMMAND MUST HAVE A PARAMETER STRING.
             A command that must have a parameter either  contains  no  equal
             sign, or the equal sign is the last character of the command.
0          5 COMMAND NOT ALLOWED AT THIS TIME - PROBABLY MISPLACED
             A command has been detected during a processing phase when it is
             not allowed.  The command may be misplaced, or  another  command
             such as NAME or UPDATE may have been omitted.
0          - COMMAND NOT PROCESSED.
             This  message appears only with other messages and has no single
             error severity.
0          2 CONTROL RECORD CHANGE REQUESTS NOT IN ASCENDING ORDER.
             A control record change request of the form '-n text'  is  being
             processed and the integer n is less than or equal to the integer
             on a previous control record  change  request  for  the  current
             module.
0          2 CONTROL RECORD nnn NOT PRESENT.
             A  control  record change request of the form '-n text' is being
             processed and the integer  n  is  greater  than  the  number  of
             control records associated with the current module.
0          1 CURRENT DATE INSERTED IN COMMAND.
             An ORIGIN or UPDATE command is being processed and the first six
             characters of the parameter do not represent a date.   The  date
             supplied   by   the   DATE   command   or  by  system  dependent
             initialization is inserted into the command.
0          6 DATE NOT SUPPLIED.
             The date has not been supplied by a DATE command  or  by  system
 .
 .
                                          3-24
1
                                  Text Exchange System
 .
 .
                                   System Description
0            dependent  initialization.   The  date  is required when writing
             exchange tapes.
0          9 ERROR n WHILE TRYING TO READ INTAPE.
           9 ERROR n WHILE TRYING TO WRITE OUTAPE.
             An  error  has  occurred while performing the specified input or
             output operation.  Further description of the error condition is
             provided by an additional message.
0          9 FIRST BLOCK NOT A LABEL.
             The  first block of information on an input exchange tape is not
             an exchange tape label.   If  this  message  is  produced  while
             trying to read an input exchange tape it may have been caused by
             an input data transfer error that was not detected, by incorrect
             specification  to the operating system of the characteristics of
             the medium, or by an attempt to read  a  tape  that  is  not  an
             exchange  tape.   If  this  message  is produced while trying to
             write an output exchange tape it probably means a program  error
             has occurred.
0          9 I/O ERROR.
             An  input  or  output  error  has  been  detected  by the system
             dependent subprograms for reading or writing exchange tapes.
0          5 INPUT, INCLUDE OR TEXT MAY  NOT  BE  MADE  EQUAL  TO  OUTAPE  OR
             OUTPUT.
             The  program does not allow INPUT, INCLUDE or TEXT files to have
             the same unit number as OUTAPE or OUTPUT files.
0          6 INTAPE AND OUTAPE BOTH EQUAL nnn
             The program does not allow the input and output  exchange  tapes
             to have the same unit number.
0          6 INTAPE NOT DEFINED.
             A  COPY,  REWIND,  SKIP  or  UPDATE command, or a control record
             change request  was  detected  when  no  unit  number  had  been
             provided for the input exchange tape.
0          5 INTAPE POSITIONED AT nnnn.  BACKWARD SKIP IGNORED.
             If  a  backward  skip is really desired a REWIND command must be
             used.
0          5 MISSING OPERATOR BEFORE COLUMN nn.
             A COPY command of the second  form  is  being  processed  and  a
             logical  variable  name  (A-H,N)  or  left  parenthesis  follows
             another variable name or right parenthesis.
0          5 MISSING PRIMARY SYMBOL BEFORE COLUMN nn.
 .
 .
                                          3-25
1
                                  Text Exchange System
 .
 .
                                   System Description
0            A COPY command of the second form  is  being  processed  and  an
             operator is the first character of the logical expression, there
             are two adjacent operators in  the  logical  expression,  or  an
             operator  follows  a  left  parenthesis.   A primary symbol is a
             logical variable (A-H,N) or a  logical  expression  enclosed  in
             parentheses.
0          5 MODULE NUMBERS NOT IN ORDER.
             A COPY command of the first form is being processed and the list
             of modules to  be  copied  does  not  consist  of  an  ascending
             sequence of integers.
0          5 MODULES PRECEDING CURRENT INTAPE POSITION (nnnnn) NOT COPIED.
             A  COPY command of the first form is being processed and some of
             the specified module numbers are less than the module number  at
             which the input exchange tape is positioned.
0          2 NO TARGET STRING ON REQUEST TO INCLUDE TEXT.
             A  request of the from '-I (search target)' to include text from
             the source defined by the INCLUDE FILE command did  not  have  a
             string of characters to identify the text to be included.
0          5 PARAMETER MUST BEGIN WITH INTEGERS.  NOT PROCESSED.
             Self explanatory.
0          - PROGRAM EXECUTION TERMINATED.
             This  message  appears only with other error messages and has no
             single error severity.
0          9 RECORD TOO LARGE.
             A record on the input exchange tape, or a record to  be  written
             on  the output exchange tape, contains more than 180 characters.
             In the former case, this is usually the result of an  undetected
             input data transfer error.  In the latter case it is probably an
             indication of program error.
0          5 REFERENCE TO UNDEFINED PREDICATE x.
             A COPY command of the second form is  being  processed  and  the
             logical  expression  contains  a logical variable (A-H) that has
             not been defined by a PREDICATE command.
0          2 REQUEST TO INCLUDE TEXT NOT ALLOWED DURING EDIT.
             A request of the from '-I (search target)' to include text  from
             the source defined by the INCLUDE FILE command has been detected
             while processing edit requests after a change control command of
             the form '-j$'.
0          3 SEARCH TARGET CANNOT BE FOUND ON INCLUDE FILE.
 .
 .
                                          3-26
1
                                  Text Exchange System
 .
 .
                                   System Description
0            A  request of the form '-I (search target)' to include text from
             the  source  defined  by  the  INCLUDE  FILE  command  is  being
             processed,  but  the  text  named by the search target cannot be
             found.  The request to include text will be output in  place  of
             the desired text.
0          6 SITE NOT SUPPLIED.
             If an exchange tape is being modified (as indicated by selection
             of the U modifier of the OUTAPE command) or created from  native
             format data (as indicated by the absence of a definition for the
             input exchange tape) the site at which the tape is being written
             must be supplied.
0          6 TITLE NOT PROVIDED FOR OUTPUT TAPE.
             A  title  has not been provided for the output tape, either by a
             TITLE command or from an input exchange tape.
0          5 TOO MANY (.
           5 TOO MANY ) DETECTED IN COLUMN nn.
             A  COPY  command  of  the  second  form  is  being processed and
             parentheses do not balance in the logical expression.
0          5 U MODIFIER OF OUTAPE COMMAND NOT SELECTED.
             A NAME or UPDATE command, or  a  request  to  change  a  control
             record  has  been  detected  while  neither  of the unit numbers
             defined by the INTAPE or OUTAPE commands  is  zero,  and  the  U
             modifier of the OUTAPE command was not selected.  Changes (other
             than omission of modules) are not allowed if the date  and  site
             of  the changes has not been recorded in the label of the output
             exchange tape.
0          6 UNABLE TO OPEN INTAPE.
           6 UNABLE TO OPEN OUTAPE.
             These  errors  usually  occur as the result of some other error,
             such as an input data transfer error.
0          9 UNKNOWN RECORD TYPE.
             A record that is neither a  text  record  nor  a  valid  control
             record  has  been  detected.   If detected on the input exchange
             tape, it usually means that an input data transfer error was not
             detected.   If detected while trying to write an output exchange
             tape, it probably means a program error has occurred.
0          5 UNRECOGNIZED COMMAND
             May mean that a TEXT command has been omitted.  If more that  20
             successive  unrecognized  commands  are encountered, the program
             assumes that a TEXT command has been omitted.  The  contents  of
             the   output  exchange  tape  will  almost  certainly  be  badly
 .
 .
                                          3-27
1
                                  Text Exchange System
 .
 .
                                   System Description
0            confused.
0          5 UNRECOGNIZED CHARACTER IN COLUMN nn
           1 UNRECOGNIZED CHARACTER IN COLUMN nn IGNORED.
             Self explanatory.
0          6 WORK = INTAPE OR OUTAPE OR OUTPUT FILE.
             The  program  does not allow the work file to have the same unit
             number as the input exchange tape, the output exchange tape,  or
             the native format output file.
0          6 WORK FILE NOT DEFINED.
             A  COPY  command  of  the  second  form or a request to change a
             control record has been  encountered,  and  no  value  has  been
             provided  for  the  work  file,  either  by a WORK command or by
             system dependent initialization.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          3-28
1
                                  Text Exchange System
 .
 .
                                   System Description
0          4.  Usage Examples for Comprehensive Program
0
0
           4.1.  Reading Exchange Tapes
0
0
           4.1.1.  Ex R.1 Retrieve entire tape contents
0
0              * TO GET EVERY MODULE FROM AN EXCHANGE TAPE (ON UNIT 10)
               * TO A SYMBOLIC TEXT FILE (ON UNIT 11)
0              INTAPE=10
               OUTPUT FILE=11
               COPY=1-999
               QUIT
0          Ex. R.1 shows the simplest method for retrieving every module from
           the exchange tape.  The assumption in this example is  that  there
           are  no  more  than  999  text modules on the tape.  A more direct
           technique for getting the entire contents of the tape  involves  a
           form  of  the  predicate controlled copy, section 3.5.2.  One uses
           the so-called NULL predicate, N=NULL=Nothing.
0              * TO GET EVERY MODULE FROM AN EXCHANGE TAPE (ON UNIT 10)
               * TO A SYMBOLIC TEXT FILE (ON UNIT 11) COPY (EVERYTHING).
0              INTAPE=10
               OUTPUT FILE=11
               * THE '-' OPERATOR IN THE NEXT COMMAND MEANS 'OR NOT'.
               COPY=N-N
               QUIT
0
0          4.1.2.  Ex R.2 What's on an exchange tape?
0
0              * TO LIST ALL CONTROL INFORMATION FOR MODULES ON AN
               * EXCHANGE TAPE (ON UNIT 10) TO THE PRINTER FILE, USE THE
               * INDEX COMMAND AND REQUEST LISTING OF EVERY
               * CONTROL RECORD BY EXCLUDING NOTHING.
 .
 .
                                          4-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0
               INTAPE=10
               INDEX=-
               COPY=N-N
               QUIT
0
0          4.1.3.  Ex R.3 Copy some text modules from exchange tape
0
0              * TO COPY SELECTED TEXT MODULES (TAPE SEQUENCE NUMBERS
               * KNOWN) FROM THE EXCHANGE TAPE, SELECT THE NUMBERS
               * NEEDED.  SUPPOSE MODULES 1,2,5 THROUGH 15 AND 100
               * ARE NEEDED.
0              INTAPE=10
               OUTPUT FILE=11
               COPY=1,2,5-15,100
               QUIT
0
0          4.1.4.  Ex R.4 Copy using selected control information
0
0
           4.1.4.1.  Ex R.4.1 Copy with one logical operand
0
0              * TO SELECT MODULES FROM AN EXCHANGE TAPE CORRESPONDING
               * TO KEYWORDS OR PHRASES IN THE CONTROL INFORMATION USE
               * THE SECOND OR PREDICATE FORM OF THE COPY COMMAND.
               * FOR EXAMPLE ALL MODULES WITH A GROUP CONTROL RECORD
               * CONTAINING THE WORD BLAS CAN BE RETRIEVED FROM THE
               * EXCHANGE TAPE.
0              INTAPE=10
               OUTPUT FILE=11
               PREDICATE=BGA BLAS
               COPY=B
               QUIT
0              * HERE THE ABOVE STRING (B)(G)(A) BLAS STANDS FOR LOGICAL
               * VARIABLE LABELED B, EXAMINING INFORMATION IN CONTROL
 .
 .
                                          4-2
1
                                  Text Exchange System
 .
 .
                                   System Description
0              * RECORDS G (=GROUP), (A)NYWHERE WITHIN THESE CONTROL RECORDS,
               * SEARCHING FOR THE STRING OF 4 CHARACTERS, BLAS.
0
           4.1.4.2.  Ex R.4.2 Copy with three logical operands
0
               * COPY MODULES HAVING GROUP CONTROL RECORDS
               * CONTAINING THE STRING BLAS, THAT DO NOT HAVE MACHINE
               * CONTROL RECORD CONTAINING THE STRING IBM AND DATA
               * CONTROL RECORD CONTAINING THE STRING ASSEMBLER.
0              INTAPE=10
               OUTPUT FILE=11
               PREDICATE=BGA BLAS
               PREDICATE=CMA IBM
               PREDICATE=DDA ASSEMBLER
               * THE '/' OPERATOR MEANS 'AND NOT'.
               * THE '*' OPERATOR MEANS 'AND'.
               COPY=B/(C*D)
               QUIT
0
           4.1.5.  Ex R.5 Limit the number of modules processed
0
0              * THE MODULES TO BE RETRIEVED ALL HAVE NUMBERS BETWEEN
               * 101 AND 150.  RESTRICTING PROCESSING ACTIVITY TO THIS
               * RANGE MAY REDUCE PROCESSING TIME.
0              INTAPE=10
               OUTPUT FILE=11
               * MOVE INPUT TAPE UP TO START OF MODULE 101.
               SKIP=100
               * LIMIT THE RANGE OF MODULE NUMBERS EXAMINED.
               LIMIT=150
               PREDICATE=BGA BLAS
               COPY=B
               QUIT
0
           4.1.6.  Ex R.6 List module with line numbers
0
0              * TEXT MODULE NUMBER 101 NEEDS TO BE UPDATED.
               * THE NUMBERS OF THE LINES ARE NEEDED SO THAT
 .
 .
                                          4-3
1
                                  Text Exchange System
 .
 .
                                   System Description
0              * THE UPDATES CAN BE INSERTED.
0              INTAPE=10
               OPTION=L
               COPY=101
               QUIT
0
0          4.1.7.  Ex R.7 Copy module with control records intact
0
0              * MAJOR MODIFICATIONS ARE NEEDED IN TEXT MODULE NUMBERED
               * 101.  THE CONTROL RECORDS NEED TO BE KEPT INTACT WITH
               * THE TEXT MODULE.
0              INTAPE=10
               OUTPUT FILE=11
               OPTION=C
               COPY=101
               QUIT
0
           4.1.8.  Ex R.8 Copy module including another module
0
           Text module number 100 contains the line image
0              -I COMMON VARIABLES
0          This signals the TES that the block of text named COMMON VARIABLES
           is to be inserted into the output file at this place.  Text module
           number 101 contains the text to be inserted:
0              -I COMMON VARIABLES
               CCC
                     COMMON /BLOCK/ A,B,C
               CCC
               --
0          The first step for this process is reading module number 101  into
           an output file.  This is followed by a redesignation of the output
           file.  The include file is next defined.  Finally a copy of module
           number 100 is made.
0              INTAPE=10
               OUTPUT FILE=11
 .
 .
                                          4-4
1
                                  Text Exchange System
 .
 .
                                   System Description
0              * GET MODULE TO BE INCLUDED INTO OUTPUT FILE=11.
               COPY=101
               * REDESIGNATE OUTPUT FILE AND ASSIGN THE INCLUDE FILE=11.
0              OUTPUT FILE=12
               INCLUDE FILE=11
               * REWIND THE INPUT TAPE BECAUSE MODULE NUMBER 100
               * IS BEHIND THE READ POSITION.
               REWIND
               COPY=100
               QUIT
0
           4.2.  Writing Exchange Texts
0
0
           4.2.1.  Ex W.1 Make duplicate of exchange tape
0
           A  duplicate  copy  of  an existing exchange tape is desired.  The
           exchange tape reel is mounted on file number 10.  The  fresh  tape
           reel  that  will  have  the  contents of the tape written on it is
           mounted on file 15.  The SITE and DATE signifying where  and  when
           the data was copied must be specified.  The SITE input card is not
           needed if the output tape is to  contain  only  modules  from  the
           input  tape.  It is good practice to include a SITE input whenever
           a modified form of an exchange tape  is  created.   The  TITLE  is
           copied from the input to the output tape.
0              INTAPE=10
               OUTAPE=15
               SITE=(WHERE TAPE IS BEING COPIED.)
               * TODAY IS CHRISTMAS DAY, 1979.
               DATE=791225
               * COPY EVERYTHING ON THE EXCH TAPE.
               COPY=N-N
               QUIT
0
           4.2.2.  Ex W.2 Initially make an exchange tape
0
0
0
 .
 .
                                          4-5
1
                                  Text Exchange System
 .
 .
                                   System Description
0          4.2.2.1.  Ex W.2.1 Put one module on EXCH tape
0
           A  text  module consisting of a single Fortran subroutine is to be
           put on an exchange tape mounted on file number 15.
0              OUTAPE=15
               TITLE=(NAME FOR THE TAPE REEL.)
               SITE=(WHERE TAPE IS BEING WRITTEN.)
               DATE=(YYMMDD)
               * CONTROL RECORDS FOR THE NEW MODULE.
               NAME=(SUBROUTINE OR MODULE NAME.)
               ORIGIN=(YYMMDD)
               AUTHOR=(PERSON WHO WROTE THE SUBROUTINE.)
               DATA=FORTRAN
               * SUBROUTINE SOURCE CARDS START AFTER THE TEXT CARD.
               TEXT
                      SUBROUTINE ...
                      ...
                      END
               --
               QUIT
0
0          4.2.2.2.  Ex W.2.2 Put several modules on EXCH tape
0
           For  a  second  example in this section we consider the problem of
           writing  several  subroutines  on  an  EXCH  tape.   The   control
           information  for  each module is largely the same.  Only the names
           of the modules are different.  To do this effectively we  put  the
           constant  control  information  on  file  number  11.   This  file
           contains the lines
0              ORIGIN=(YYMMDD SITE WHERE SUBROUTINES WERE WRITTEN.)
               AUTHOR=(PERSON WHO WROTE THE SUBROUTINES.)
               GROUP=(CLASSIFICATION OF THE SUBROUTINES.)
               REFERENCE=(JOURNAL ARTICLE RELEVENT TO THE SUBROUTINES.)
               DATA=FORTRAN
               MACHINE=PORTABLE
               KEYWORD=(INDUSTRY-RECOGNIZED WORDS FOR THE PROGRAM FUNCTION.)
               COMMENT=(REMARKS ON FEATURES OR LIMITATIONS OF THE PROGRAM.)
               * REWIND THE FILE WHEN IT HAS BEEN READ.
               QUIT,R
0          The  writing  of the exchange tape, mounted on file number 15, can
           now be illustrated.
 .
 .
                                          4-6
1
                                  Text Exchange System
 .
 .
                                   System Description
0              OUTAPE=15
               TITLE=(...)
               SITE=(...)
               DATE=(YYMMDD)
               NAME=(SBNAME...)
               * GET CONSTANT CONTROL INFORMATION FROM FILE 11.
               INPUT FILE=11
               TEXT
                      SUBROUTINE SBNAME(...)
                        ...
                      END
               --
               NAME=(...)
               INPUT FILE=11
               TEXT
                      SUBROUTINE ...
                        ...
                      END
               --
                         ...
               QUIT
0
0
           4.2.2.3.  Ex W.2.3 Put modules from file onto tape
0
           For  a  third  example we will modify the second example slightly.
           The only difference is that the subroutines  are  all  located  on
           file number 12 as follows.
0                     SUBROUTINE SBNAME(...)
                        ...
                      END
               --
                      SUBROUTINE ...
                        ...
                      END
               --
                        ...
               QUIT
0          After defining the OUTAPE, TITLE, SITE and DATE input as shown  in
           the examples W.2.1 and W.2.2, the remaining input is
0              NAME=(SBNAME...)
               * GET CONSTANT CONTROL INFORMATION FROM FILE 11.
 .
 .
                                          4-7
1
                                  Text Exchange System
 .
 .
                                   System Description
0              INPUT FILE=11
               * READ SUBROUTINE TEXT FROM FILE 12.
               TEXT=12
0              NAME=(...)
               INPUT FILE=11
               * THIS USAGE ASSUMES THAT FILE 12 STAYS POSITIONED.
               * THIS IS TRUE FOR THE PORTABLE VERSION OF THE PROGRAM.
               TEXT=12
                         ...
               QUIT
0
           4.2.3.  Ex W.3 Add module to the end of an EXCH tape
0
           An existing exchange tape is mounted on file number 10.   A  fresh
           reel is mounted on file number 15.  A new module is to be added to
           the end of the new tape.
0              INTAPE=10
               OUTAPE,U=15
               TITLE=(...)
               SITE=(...)
               DATE=(YYMMDD)
               * GET THE OLD TAPE CONTENTS TO THE NEW TAPE.
               COPY=N-N
               * INSERT THE NEW MODULE ON THE NEW TAPE
               NAME=(...)
               ORIGIN=(YYMMDD)
               AUTHOR=(...)
               DATA=FORTRAN
               TEXT
                      SUBROUTINE ...
                        ...
                      END
               --
               QUIT
0
0          4.2.4.  Ex W.4 Updating modules on EXCH tape
0
0
0
 .
 .
                                          4-8
1
                                  Text Exchange System
 .
 .
                                   System Description
0          4.2.4.1.  Ex W.4.1 Updating entire lines on EXCH tape
0
           In  this  example  module  number 101 is a Fortran subroutine that
           requires a number of  changes.   The  existing  exchange  tape  is
           mounted on file number 10.  A fresh reel is mounted on file number
           15.
0              INTAPE=10
               OUTAPE,U=15
               TITLE=(...)
               SITE=(...)
               DATE=(YYMMDD)
               * COPY THE MODULES THAT REQUIRE NO CHANGE.
               COPY=1-100
               * INSERT A CARD AT THE FRONT OF THE PROGRAM,
               * REMOVE LINE 5, INSERT A LINE AFTER LINE 7,
               * AND REPLACE LINE 9 THROUGH 11 BY FOUR NEW LINES.
0              UPDATE=(YYMMDD)
               TEXT
               -0
               C      SOME COMMENT.
               -5,5
               -7
                      A=0.
               -9,11
                      B=0.
                      C=0.
                      D=0.
                      E=0.
               --
               * COPY THE REMAINING MODULES THAT ARE UNCHANGED.
               COPY=N-N
               QUIT
0
0          4.2.4.2.  Ex W.4.2 Editing individual lines on EXCH tape
0
           In this second example the only difference from the first  example
           is that module number 101 requires editing.  The input for INTAPE,
           OUTAPE, etc. is identical through the UPDATE card.
0              TEXT
               -27$ CHANGE REAL*4 TO REAL IN LINE 27.
               /REAL*4/REAL/
 .
 .
                                          4-9
1
                                  Text Exchange System
 .
 .
                                   System Description
0              --
               COPY=N-N
               QUIT
0
           4.2.4.3.  Ex W.4.3 Updating control records on EXCH tape
0
           In this third example the only difference from the  first  example
           is  that  module  number  101  requires  changes  in  the  control
           information.  The input is identical through the COPY=1-100  card.
0              * REMOVE CONTROL RECORD NUMBER 2, CHANGE CONTROL RECORD
               * NUMBER 4, AND INSERT A NEW GROUP CONTROL RECORD.
               -2
               -4 (NEW TEXT FOR CONTROL RECORD 4.)
               UPDATE=(YYMMDD)
               GROUP=(NEW GROUP CONTROL RECORD.)
               TEXT
               --
               COPY=N-N
               QUIT
0
           4.2.5.  Ex W.5 Merge two EXCH tapes
0
           In this example one wants to take two  exchange  tapes,  on  files
           numbered  10  and 11, and merge them to write a fresh reel on file
           number 15.
0              INTAPE=10
               OUTAPE,U=15
               TITLE=(...)
               SITE=(...)
               DATE=(YYMMDD)
               COPY=N-N
               * OPEN A NEW INTAPE ON FILE 11.
               INTAPE=11
               COPY=N-N
               QUIT
0
0
0
0.
 .
                                          4-10
1
                                  Text Exchange System
 .
 .
                                   System Description
0          5.  Reporting Errors Discovered in the TES
0
           If errors are discovered in the TES,  the  authors  would  greatly
           appreciate  accurate reporting of the circumstances of the errors.
           To facilitate correction of the error, reproduce  the  environment
           of  the  error as accurately as possible.  In particular, describe
           the desired  action,  provide  all  commands  used,  describe  the
           result,  and if possible provide the input exchange tape in use at
           the time of  the  error.   To  the  extent  possible,  all  errors
           reported will be given prompt attention.
0          Report errors to:
0              W. V. Snyder
               Mail Stop 171-249
               Jet Propulsion Laboratory
               4800 Oak Grove Drive
               Pasadena, CA 91109
0              Telephone 213/354-6271, or FTS 792-6271.
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          5-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0          6.  Suggesting Changes to the TES
0
           Several extensions of the TES have been proposed.  Suggestions for
           changes to the TES should be forwarded to Snyder.
0          * Implement  error detection and correction in a portable way that
             is compatible with efficient machine dependent processing.
0          * Implement a command that allows text to be written on the native
             format  output  file  but  not  the  output exchange tape.  This
             command  could  be  used  to  place  operating  system   control
             statements on the native format output file.
0          * Provide  separate files for messages and listings.  If the files
             have different unit numbers, messages would be printed  on  both
             files.  Listings would be printed only on the listing file.
0          * Implement  a  command  to  save  the  state  of the program (the
             contents of the tape buffers and all common blocks).  This would
             allow  concurrent reading and writing of several exchange tapes,
             or temporarily leaving the exchange program to perform a  system
             dependent task.
0          * Implement  a  WHAT  command  to print everything known about the
             environment - unit numbers, machine sensitive file names, title,
             site,  date,  predicates,  parameters of the IDENTIFY OUTPUT and
             LIMIT commands,  options,  index  selections,  and  any  machine
             sensitive environmental information.
0          * Print  a  page  heading while making a listing (without vertical
             format control).  The page heading would consist of  the  module
             number  and  the  text of the module name record.  A page length
             command would be useful in this respect.
0          * Some versions would benefit from an INPUT WIDTH command.
0          * The Univac 1100 version would  benefit  from  an  automatic  JCL
             generator.
0
0
0
0
0.
 .
                                          6-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0          7.  Acknowledgments
0
           Several individuals  have  contributed  to  both  the  design  and
           implementation  of  the TES.  T. Aird of IMSL, Incorporated helped
           with the development of system  sensitive  modules  for  the  Data
           General MV/8000.  Modules for the Cray-1 using COS were written by
           A. Elsbernd of System Development Corporation at  Sandia  National
           Laboratories.   Modules  for  the  DECSystem-20 using TOPS-20 were
           written by P. Gaffney at Oak Ridge National  Laboratory.   Modules
           for the DEC VAX using Berkeley UNIX (TM) were written by D. Gay at
           Bell Laboratories in Murray Hill, NJ.  Modules for the DEC  PDP-11
           using  RSX-11m  were  written  by  J.  Gomez at the Jet Propulsion
           Laboratory.  Modules for the DEC PDP-10 using TOPS-10 were written
           by  J.  Greif  at  the  California  Institute of Technology and J.
           Wisniewski at Sandia National  Laboratories.   K.  H.  Haskell  at
           Sandia  National  Laboratories assisted in the implementations for
           the CDC 6000/7000 using SCOPE and NOS, IBM 360/370  using  OS  and
           DEC VAX using VMS.  F. T. Krogh at JPL contributed ideas regarding
           the command syntax and the needed capabilities of the system.  The
           authors  have  also  implemented  the  system  for Univac 1100 and
           modified the work of some of the contributors mentioned above.
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          7-1
1
                                  Text Exchange System
 .
 .
                                   System Description
0          8.  References
0
           1.  Robert  McEliece,  "The  Theory  of  Information  and Coding",
               Addison-Wesley, 1971.
           2.  W.  V.  Snyder  and  R.  J.  Hanson,  "Text  Exchange  System,
               Installation Instructions and Description of System  Dependent
               Variants,"   Jet   Propulsion   Laboratory  internal  document
               1846-109.
           3.  W.  V. Snyder and R. J. Hanson, "Text Exchange System, Program
               Descriptions," Jet  Propulsion  Laboratory  internal  document
               1846-110.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          8-1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0
           1.  Abstract                                                   1-1
0          2.  Introduction                                               2-1
0          3.  User's Guide for the Comprehensive Program                 3-1
               3.1.  Processing Sequence                                  3-1
               3.2.  General Command Syntax                               3-2
               3.3.  Control Record References                            3-3
               3.4.  Commands for Defining the Environment                3-4
               3.4.1.  General Environment Description                    3-4
               3.4.2.  Defining Data Sources                              3-5
               3.4.3.  Defining Data Destinations                         3-6
               3.4.4.  Selecting Global Options                           3-8
               3.5.  Defining the Program Action                         3-10
               3.5.1.  Positioning the Input Exchange Tape               3-10
               3.5.2.  Copying Selected Text Modules                     3-10
               3.5.3.  Inserting Text Modules                            3-13
               3.5.3.1.  Inserting Control Information                   3-13
               3.5.3.2.  Inserting the Text of New Modules               3-15
               3.5.4.  Updating Text Modules                             3-15
               3.5.4.1.  Updating Control Information                    3-15
               3.5.4.2.  Adding Control Information                      3-16
               3.5.4.3.  Updating the Text of a Module                   3-16
               3.5.5.  Including Text from Alternate Sources             3-17
               3.5.5.1.  Format of Request to Include Text               3-18
               3.5.5.2.  Format of Information on the INCLUDE FILE       3-18
               3.5.6.  The QUIT Command                                  3-18
               3.6.  Printed Output of the Comprehensive Program         3-19
               3.6.1.  Format of Tape Label Information                  3-19
               3.6.2.  Format of Index Information                       3-20
               3.6.3.  Format of List of a Module                        3-20
               3.6.4.  Informative Messages                              3-21
               3.6.5.  Error Messages                                    3-22
0          4.  Usage Examples for Comprehensive Program                   4-1
               4.1.  Reading Exchange Tapes                               4-1
               4.1.1.  Ex R.1 Retrieve entire tape contents               4-1
               4.1.2.  Ex R.2 What's on an exchange tape?                 4-1
               4.1.3.  Ex R.3 Copy some text modules from exchange tape   4-2
               4.1.4.  Ex R.4 Copy using selected control information     4-2
               4.1.4.1.  Ex R.4.1 Copy with one logical operand           4-2
               4.1.4.2.  Ex R.4.2 Copy with three logical operands        4-3
               4.1.5.  Ex R.5 Limit the number of modules processed       4-3
               4.1.6.  Ex R.6 List module with line numbers               4-3
               4.1.7.  Ex R.7 Copy module with control records intact     4-4
               4.1.8.  Ex R.8 Copy module including another module        4-4
               4.2.  Writing Exchange Texts                               4-5
 .
 .
                                           1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0              4.2.1.  Ex W.1 Make duplicate of exchange tape             4-5
               4.2.2.  Ex W.2 Initially make an exchange tape             4-5
               4.2.2.1.  Ex W.2.1 Put one module on EXCH tape             4-6
               4.2.2.2.  Ex W.2.2 Put several modules on EXCH tape        4-6
               4.2.2.3.  Ex W.2.3 Put modules from file onto tape         4-7
               4.2.3.  Ex W.3 Add module to the end of an EXCH tape       4-8
               4.2.4.  Ex W.4 Updating modules on EXCH tape               4-8
               4.2.4.1.  Ex W.4.1 Updating entire lines on EXCH tape      4-9
               4.2.4.2.  Ex W.4.2 Editing individual lines on EXCH tape   4-9
               4.2.4.3.  Ex W.4.3 Updating control records on EXCH tape  4-10
               4.2.5.  Ex W.5 Merge two EXCH tapes                       4-10
0          5.  Reporting Errors Discovered in the TES                     5-1
0          6.  Suggesting Changes to the TES                              6-1
0          7.  Acknowledgments                                            7-1
0          8.  References                                                 8-1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                           2
1
                                  Text Exchange System
 .
 .
                                         Index
0
           Adding text to a module                        3.5.           3-16
           AUTHOR=author of text module.                  3.5.           3-13
0          Command Sequence                               3.1.            3-1
           COMMENT=...                                    3.5.           3-13
           Comments about commands begin with *           3.2.            3-3
           Control Record References                      3.3.            3-3
           CONTROL RECORD,type=...                        3.5.           3-13
           COPY,IPSX=logical expression                   3.5.           3-11
           COPY=                                          3.5.           3-10
           COPY=list of module positions                  3.5.           3-10
0          DATA=data type                                 3.5.           3-13
           DATE=yymmdd                                    3.4.            3-4
0          Error Messages, Comprehensive Program          3.6.           3-22
           Ex R.1 Retrieve entire tape contents           4.1.            4-1
           Ex R.2 What's on an exchange tape?             4.1.            4-1
           Ex R.3 Copy some text modules from EXCH Tape   4.1.            4-2
           Ex R.4 Copy using selected control information 4.1.            4-2
           Ex R.4.1 Copy with one logical operand         4.1.            4-2
           Ex R.4.2 Copy with three logical operands      4.1.            4-3
           Ex R.5 Limit the number of modules processed   4.1.            4-3
           Ex R.6 List module with line numbers           4.1.            4-3
           Ex R.7 Copy module with control records intact 4.1.            4-4
           Ex R.8 Copy module including another module    4.1.            4-4
           Ex W.1 Make duplicate of exchange tape         4.2.            4-5
           Ex W.2 Initially make an exchange tape         4.2.            4-5
           Ex W.2.1 Put one module on EXCH tape           4.2.            4-6
           Ex W.2.2 Put several modules on EXCH tape      4.2.            4-6
           Ex W.2.3 Put modules from file onto tape       4.2.            4-7
           Ex W.3 Add module to the end of an EXCH tape   4.2.            4-8
           Ex W.4 Updating modules on EXCH tape           4.2.            4-8
           Ex W.4.1 Updating entire lines on EXCH tape    4.2.            4-9
           Ex W.4.2 Editing individual lines on EXCH tape 4.2.            4-9
           Ex W.4.3 Updating control records on EXCH tape 4.2.           4-10
           Ex W.5 Merge two EXCH tapes                    4.2.           4-10
0          Format of Index Information                    3.6.           3-20
           Format of List of a Module                     3.6.           3-20
           Format of Tape Label Information               3.6.           3-19
0          GROUP=membership list                          3.5.           3-14
0          IDENTIFY OUTPUT,IOFC=C1,C2,STEP,START,IDTEXT   3.4.            3-7
           INCLUDE FILE format                            3.5.           3-18
           INCLUDE FILE=unit number system info           3.4.            3-6
 .
 .
                                           1
1
                                  Text Exchange System
 .
 .
                                         Index
0          Include text request format                    3.5.           3-18
           INDEX[,L]=(-)control record type selectors     3.4.           3-10
           Informative Messages, Comprehensive Program    3.6.           3-21
           INPUT FILE=unit number system info             3.4.            3-5
           INTAPE=unit number system info                 3.4.            3-5
0          KEYWORD=key words and phrases                  3.5.           3-14
0          LIMIT=text module number                       3.5.           3-12
0          MACHINE=machine type                           3.5.           3-14
           MARGIN=Command margin                          3.4.            3-5
           Modifying text images                          3.5.           3-17
0          NAME=text module name                          3.5.           3-13
0          OPTION=ACEILSV and other characters            3.4.            3-8
           ORIGIN=yymmdd site                             3.5.           3-14
           OUTAPE=unit number system info                 3.4.            3-6
           OUTPUT FILE=unit number system info            3.4.            3-7
0          PREDICATE=VRPMtarget                           3.5.           3-12
           PRINTER=unit number                            3.4.            3-6
0          QUIT[,R]                                       3.5.           3-18
0          READER=unit number                             3.4.            3-5
           REFERENCE=bibliographic references             3.5.           3-14
           REMOVE=character to remove for compression     3.5.           3-14
           Replacing text in a module                     3.5.           3-17
           Reporting Errors Discovered in the TES         5.              5-1
           REWIND                                         3.5.           3-10
0          SIGNAL=signal character                        3.5.           3-14
           SITE=40 characters                             3.4.            3-5
           SKIP[,F]=module number                         3.5.           3-10
0          Text of New Modules                            3.5.           3-15
           TEXT=unit number system info                   3.4.            3-6
           TITLE=40 characters                            3.4.            3-7
0          UPDATE=yymmdd site (insert)                    3.5.           3-14
           UPDATE=yymmdd site (updating)                  3.5.           3-16
           Updating Control Information                   3.5.           3-15
           Updating the Text of a Module                  3.5.           3-16
0          WORK=unit number                               3.5.           3-13
0.
 .
                                           2

1
0.
 .
0
0
0
0
0                                 Text Exchange System
0                              Installation Instructions
                                   and Description of
                               System Dependent Variants
0                                     Section 366
                                        1846-109
0
0
0                                   October 11, 1983
0
0
0
                                     W. V. Snyder *
                               Jet Propulsion Laboratory
                                   Pasadena, CA 91109
0
                                    R. J. Hanson **
                              Sandia National Laboratories
                                 Albuquerque, NM 87185
0
0
0
0
                           California Institute of Technology
                               Jet Propulsion Laboratory
                                  4800 Oak Grove Drive
                                   Pasadena, CA 91109
0.
 .
1
0.
 .
0
0
0
0
0
0
                *  This  work represents the results of one phase of research
                   carried out at the Jet Propulsion  Laboratory,  California
                   Institute  of  Technology,  under  Contract No. NAS 7-100,
                   sponsored  by   the   National   Aeronautics   and   Space
                   Administration.
0
0               ** Work  performed  under  the  auspices  of  Sandia National
                   Laboratories, Albuquerque, New Mexico 87185 for the United
                   States Department of Energy under Contract AT(29-1)-789.
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          1.  Abstract
0
                The Text Exchange System (TES) provides a method to  exchange
           and  maintain  organized  information.  The system consists of the
           definition of a format for information storage  and  two  computer
           programs.   A  comprehensive  program is used to create, read, and
           maintain TES files.  To allow the TES to be distributed on a  tape
           in  the TES format, a much smaller program capable only of reading
           magnetic tape is also available.   The  programs  are  written  in
           Fortran   and   designed   for   portability,   but  a  few  small
           machine-dependent modules, available  for  several  machines,  are
           required.    Although  the  comprehensive  program  recognizes  35
           commands, information may be read from a TES format file by  using
           as  few as three commands.  In addition to its use for information
           exhange on magnetic tape, we expect the system to be  helpful  for
           maintaining libraries of text.
               This document describes the use of system  dependent  variants
           of  the  TES  programs,  and  provides an installation guide.  The
           programs are described in greater detail in [1].   It  is  assumed
           here that the reader is familiar with [2].
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          1-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          2.  Machine or System Sensitive Modules
0
           The simple tape exchange program consists of eleven program units.
           The comprehensive tape exchange program consists of more  than  35
           program units (the number of program units depends on the computer
           system).  Some of these  modules  are  always  machine  or  system
           sensitive.   Some  may be usable in the portable (usually trivial)
           form  on  some  machines  while  machine  sensitive  versions  are
           required  on  other  machines.  Some may be usable in the portable
           form on most machines, but significant operational convenience  or
           improved   performance  may  be  provided  by  machine  or  system
           dependent modifications.  Most modules, however, are usable on all
           machines  in the portable form, and no significant improvements in
           convenience or performance can be achieved by  machine  or  system
           dependent modifications.
0
           2.1.  Internal Representation of Characters
0
           Character information is stored on exchange tapes using the  seven
           bit ASCII code for a character, stored in the low order seven bits
           of an eight bit frame with the high  order  bit  zero.   The  high
           order  bit  is  not  necessarily zero in every frame, because some
           binary numeric information  is  also  stored  on  the  tape.   The
           internal  character  representation used by both exchange programs
           is  the  integer  equivalent  for  the  ASCII  [3]  code  of  each
           character.   Thus,  for  example,  the  letter  A  (upper case) is
           represented by the integer 65.
0
           2.2.  System Dependent Information from Commands
0
           In   the   comprehensive   exchange   program,   system  dependent
           information  may  be  provided  by  some   commands   [2].    This
           information  is  stored  in two representations in the 180 element
           Fortran type INTEGER vectors COMAND and HOLCMD in the named COMMON
           block  /EXCHPC/.   COMAND  contains  the  command  in the internal
           character representation described  above.   HOLCMD  contains  the
           command in the normal character representation of the host machine
           (the representation used if input is read  using  'A1'  format  or
           character  data  is  declared  using  '1H'  notation).  The system
           dependent information begins  in  the  command  at  the  character
           position indicated by the variable EQUAL in the named COMMON block
           /EXCHPC/, and the last  non-blank  character  of  the  command  is
           indicated  by  the  variable  NCHCMD  in  the  named  COMMON block
 .
 .
                                          2-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          /EXCHPC/.  If EQUAL is zero, or if EQUAL is greater  than  NCHCMD,
           there is no system dependent information in the command.
0          The  command  is  available  when the system dependent subroutines
           EXCHFO, EXCHIM and EXCHOU are called to open native format  files.
           To  provide one point for processing system dependent information,
           the  system  dependent  subroutine  EXCHCX  is  also  called  when
           processing  READER,  INPUT  FILE, TEXT, INCLUDE FILE, OUTPUT FILE,
           INTAPE and OUTAPE  commands.   The  system  dependent  information
           available  on  INTAPE and OUTAPE commands may be processed only in
           EXCHCX.  The  system  dependent  information  available  on  other
           commands  may  be  processed  in  EXCHCX  or  the system dependent
           subroutine EXCHFO, EXCHIM or EXCHOU, as appropriate.  Consult  the
           description of EXCHCX for further information.
0
           2.3.  Modules that are Sensitive to All Machines
0
           Five  modules  of  the  comprehensive  program must be provided in
           machine sensitive form for every machine type.   The  modules  for
           reading  tape  and  unpacking  characters  are  also needed by the
           simple program.
0
           2.3.1.  Main Program Unit
0
           The  main  program  unit  is  the same for both programs.  It must
           provide space for tape input and values  for  several  machine  or
           system sensitive parameters.
0          Physical  records  on  exchange  tapes  (the unit of data transfer
           between tape and the  main  memory  of  the  computer)  contain  a
           multiple  of  180  characters,  each  consisting  of  8 bits.  For
           computer word sizes of 8, 12, 16, 24, 32, 36, 48 and 60 bits, this
           amount  of  data will exactly fill the last computer word required
           to hold the data.  Thus, there should be  no  problems  caused  by
           requirements  to  transfer  partial words between tape and memory.
           The main program  must  provide  sufficient  space  to  read  3600
           eight-bit  characters in the format used for transfer between tape
           and main memory.  This format may depend upon the  design  of  the
           module used to read tape, EXCHRT, described below.
0          The  parameters  that  must  have values provided are variables in
           named COMMON blocks.  A listing of the current  contents  of  each
           named  COMMON  block  should  accompany  each  transmittal  of the
           exchange programs to a new site.  The variable in the named COMMON
 .
 .
                                          2-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          block /EXCHIC/ that must have an initial value provided is:
0           NWCBI, the number of Fortran type INTEGER words occupied by NCCBI
             characters.   This  probably can be computed as (NCCBI*8)/WSIZE,
             where WSIZE denotes the number of bits of a Fortran type INTEGER
             word  provided by input data transfers.  The method of computing
             the value of NWCBI may depend on the system dependent subprogram
             EXCHRT described below.
0          The  variables  in  the named COMMON block /EXCHUC/ that must have
           initial values provided are:
0           PRINTR  Provides the default Fortran unit number for the printer.
0           READER Provides the default Fortran unit number for the reader.
0          When initialization of the environment is complete,  execution  of
           either program is initiated by
0                CALL EXCH (IBLOCK)
0          where IBLOCK is the space provided for tape input.
0          When  execution  of the exchange program is complete, EXCH returns
           to the main program unit.  The main program  unit  may  then  stop
           program execution or initiate another process.
0
           2.3.2.  Interface to the Comprehensive Program
0
           As  described  above,  the  system  dependent  main  program  unit
           executes
0                CALL EXCH (IBLOCK)
0          after  providing  initial  values  for  several  parameters.   The
           portable  part  of  the simple program is a subroutine named EXCH.
           To interface between the system dependent main  program  unit  and
           the  comprehensive  exchange  program,  a  subroutine EXCH must be
           provided.  This subroutine has  responsibilities  similar  to  the
           system dependent main program unit: it must provide space for tape
           output,  and  initial  values  for  several  machine  and   system
           dependent  parameters.   It  may  provide  a default value for the
           site, and may fetch the date from  the  operating  system.   Other
           machine sensitive initialization of the environment, such as using
           information from the operating system  command  that  invoked  the
           exchange program to provide initial values for parameters normally
 .
 .
                                          2-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          provided by exchange program commands is also possible.
0          The interface subprogram must provide sufficient  space  to  write
           3600  eight-bit characters in the format used for transfer between
           main memory and tape.  This format may depend on the design of the
           module used to write tape, EXCHWT, described below.
0          The  parameters  that  must  have values provided are variables in
           named COMMON blocks.  The variables  in  the  named  COMMON  block
           /EXCHOC/ that must have initial values provided are:
0           NDATAO Is the number of data characters per output  block.   This
             is  usually  nine  characters  less  than  the nominal number of
             characters per tape block.  If an error correction code is used,
             the value of this variable must be further reduced by the number
             of characters of error correction information, provided  by  the
             variable  NERRCO  described below.  That is, NDATAO + NERRCO + 9
             must be the number of characters in the output tape block.  This
             variable  usually has the value 3591, provided by the block data
             subprogram noted in the description of NCCBI.
0           NERRCO Is the number of characters added to each tape  block  for
             error detection and correction.  NDATAO + NERRCO + 9 must be the
             number of characters in the output tape  block.   This  variable
             usually   has  the  value  zero,  provided  by  the  block  data
             subprogram noted in the description of NCCBI.
0           NWCBO Is the number of Fortran type  INTEGER  words  occupied  by
             NCCBO   characters.    This   probably   can   be   computed  as
             (NCCBO*8)/WSIZE, where WSIZE denotes the number  of  bits  of  a
             Fortran  type  INTEGER word used for output data transfers.  The
             method of computing the value of NWCBO may depend on the  system
             dependent subprogram EXCHWT described below.
0          The variable in the named COMMON block /EXCHUC/ that must have  an
           initial value provided is:
0           WORKF Provides the default Fortran unit number for the work file.
0          When  initialization  of the environment is complete, execution of
           the comprehensive exchange program is initiated by
0               CALL EXCHTR (IBLOCK,OBLOCK)
0          where IBLOCK is the space provided for  tape  input  by  the  main
           program unit, and OBLOCK is the space provided for tape output.
0          When execution of the exchange program is complete, EXCHTR returns
 .
 .
                                          2-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          to the interface subroutine EXCH.  EXCH should return to the  main
           program unit, but may stop or initiate another process.
0
           2.3.3.  Character Unpacking in Both Programs
0
           The  machine  sensitive  subprogram  EXCHUN is required to extract
           individual eight bit characters from the block of  input  provided
           by  the  machine  sensitive subprogram EXCHRT described below, and
           store them in the representation described above.  This extraction
           usually involves unpacking characters, several of which are stored
           in each word, and storing individual characters  in  single  words
           using  the  internal  character  representation  described  above.
           Since  the  internal  representation   of   characters   and   the
           representation of characters on exchange tapes uses the same code,
           extracting characters may involve shifting and masking,  but  will
           not  require  character  code  translation.  To reduce the cost of
           subprogram linkage, EXCHUN must unpack NCCBI characters each  time
           it  is  called.   The  value  of  NCCBI is not changed by portable
           subprograms of either exchange program.  If the value of NCCBI  is
           not  changed  by machine sensitive subprograms, the use of a local
           constant to determine the number of characters to  unpack  may  be
           more  efficient  than using NCCBI.  The exact format of the packed
           information depends on the input data transfer method used by  the
           machine sensitive subprogram EXCHRT described below.  Unpacking of
           NCCBI characters always begins at a word boundary.  The subprogram
           EXCHUN is invoked by
0               CALL EXCHUN (INPBUF,CHARS)
0          where  INPBUF  is  part  of  the  tape input buffer, and EXCHUN is
           responsible for placing the NCCBI characters beginning  at  INPBUF
           into  the  Fortran  type  INTEGER  vector  CHARS, one per word, as
           described above.
0
           2.3.4.  Character Packing in the Comprehensive Program
0
           The machine  sensitive  subprogram  EXCHPA  is  required  to  pack
           individual  characters  in the representation described above into
           the form necessary for output by the machine sensitive  subprogram
           EXCHWT    described   below.    Since   the   internal   character
           representation and the representation of  characters  on  exchange
           tapes  uses  the  same  code,  packing  the characters may involve
           shifting and masking, but will not involve code  translation.   To
           reduce  the  cost  of  subprogram  linkage  EXCHPA must pack NCCBO
 .
 .
                                          2-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          characters each time it is called.  The  value  of  NCCBO  is  not
           changed  by  portable subprograms of the exchange program.  If the
           value of NCCBO is not changed by  machine  sensitive  subprograms,
           the  use of a local constant to determine the number of characters
           to pack may be more efficient than using NCCBO.  The exact  format
           of  the  packed  information  depends  on the output data transfer
           method used by the machine sensitive subprogram  EXCHWT  described
           below.   Packed  information  is always stored beginning at a word
           boundary.  The subprogram EXCHPA is invoked by
0               CALL EXCHPA (CHARS,OUTBUF)
0          where EXCHPA is  responsible  for  placing  the  NCCBO  characters
           stored in the Fortran type INTEGER vector CHARS in the part of the
           output tape buffer denoted by OUTBUF using the format required  by
           EXCHWT.
0
           2.3.5.  Reading Exchange Tapes
0
           Since  the run time Fortran input/output services of most computer
           systems enforce a system dependent format for  input  and  output,
           and  the  exchange tape has a fixed system independent format, the
           machine sensitive subprogram EXCHRT is  needed  to  read  exchange
           tapes.  The subprogram EXCHRT is invoked by
0               CALL EXCHRT (ISTAT,DBLOCK)
0          where  ISTAT  is a scalar in-out INTEGER variable and DBLOCK is an
           output INTEGER vector.  EXCHRT must perform one of four functions,
           determined by ISTAT, each time it is invoked.
0           ISTAT=1 Means open the file designated by the unit number  INTAPE
             in  the  named  COMMON  block /EXCHUC/ for input with no rewind.
             Information stored by a call to EXCHCX may be  used  to  provide
             operational convenience.  Note, however, that EXCHCX is not part
             of the simple program.  Thus, if EXCHRT uses  such  information,
             there   must   be   some  method  of  determining  whether  such
             information has been provided.  The information probably will be
             passed  from  EXCHCX  to  EXCHRT  by using COMMON variables.  An
             appropriate initial value should be provided  for  these  COMMON
             variables by the system dependent main program unit.
0           ISTAT=2  Means  rewind  the  file  designated  by the unit number
             INTAPE.  (Close with rewind, because this request is followed by
             a request with ISTAT=1).
0.
 .
                                          2-6
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0           ISTAT=3 Means read a block of NDATAI + NERRCI + 9 characters from
             the file designated by the unit number  INTAPE.   The  variables
             NDATAI and NERRCI are in the named COMMON block /EXCHIC/.  Every
             character of the block must be stored in DBLOCK  in  the  format
             necessary   for  EXCHUN,  described  above.   If  possible,  the
             variable NCDBI in the named COMMON block /EXCHIC/ should be  set
             to  the  number  of  characters  actually  transferred.  If this
             number is not available, set NCDBI equal to NDATAI + NERRCI + 9.
             If  an  exchange  format  label  is  expected,  indicated by the
             variable BLKSQI in the named COMMON block /EXCHIC/  equal  zero,
             allow  a  single  end  of file mark.  Otherwise, treat an end of
             file mark as an error.  If NERRCI is not zero, NERRCI characters
             beginning  in the first character position of DBLOCK may be used
             for error detection or correction [4].
0           ISTAT=4 Means close with no rewind.
0          The  variable  ISTAT  is  also  used  to  return the status of the
           operation to the calling program.  If errors occur  EXCHRT  should
           write  a  message  on  the  Fortran unit identified by the INTEGER
           variable PRINTR in the named COMMON block /EXCHUC/.  If no  errors
           occur,  or if only trivial errors occur, set ISTAT equal zero.  If
           catastrophic errors occur, set ISTAT equal 3.  Do not set ISTAT to
           any other values.
0
           2.3.6.  Writing Exchange Tapes
0
           Since  the  run  time Fortran input/output system of most computer
           systems enforces a system dependent format for input  and  output,
           and  the  exchange tape has a fixed system independent format, the
           machine sensitive subprogram EXCHWT is needed  to  write  exchange
           tapes.  The subprogram EXCHWT is invoked by
0               CALL EXCHWT (ISTAT,DBLOCK)
0          where  ISTAT is a scalar in-out INTEGER variable, and DBLOCK is an
           input INTEGER vector.  EXCHWT must perform one of three functions,
           determined by ISTAT, each time it is invoked.
0           ISTAT=1 Means open the file designated by the unit number  OUTAPE
             in  the  named  COMMON block /EXCHUC/ for output with no rewind.
             Information stored by a call to EXCHCX may be  used  to  provide
             operational  convenience.   This  information  will  usually  be
             passed from EXCHCX to EXCHWT by using COMMON variables.
0           ISTAT=2 Means write a block of NDATAO +  NERRCO  +  9  characters
 .
 .
                                          2-7
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            from  DBLOCK  to  the file designated by the unit number OUTAPE.
             The variables NDATAO and NERRCO are in the  named  COMMON  block
             /EXCHOC/.   NERRCO  characters of error detection and correction
             may be  stored  in  DBLOCK  beginning  in  the  first  character
             position.  Every character in DBLOCK must then be transferred to
             the file, and no information may be appended to the block.
0           ISTAT=3 Means write an end  of  file  mark  and  close  the  file
             designated by the unit number OUTAPE with no rewind.
0          The variable ISTAT is also  used  to  return  the  status  of  the
           operation  to  the calling program.  If errors occur EXCHWT should
           write a message on the Fortran  file  identified  by  the  INTEGER
           variable  PRINTR in the named COMMON block /EXCHUC/.  If no errors
           occur, or if only trivial errors occur, set ISTAT equal zero.   If
           catastrophic errors occur, set ISTAT equal 3.  Do not set ISTAT to
           any other values.
0
           2.4.  Modules that may be Machine Sensitive
0
           Six modules of the comprehensive program and three modules of  the
           simple  program  may  be  required in machine sensitive form.  The
           module EXCHFO is used by both programs but may be different in the
           two programs.
0
           2.4.1.  Block Data in the Simple Program
0
           The block data subprogram of the simple program, identified on the
           exchange program distribution tape as EXCHBX, contains a translate
           table  from  the  internal (ASCII) representation of characters to
           the hollerith representation of the host  machine.   Two  versions
           are  provided  on  the  distribution  tape,  one  having hollerith
           symbols for only the 47 characters defined in the ANSI Fortran  66
           standard  [5],  the  other having graphics for 95 ASCII characters
           (including space).  When the  simple  program  is  distributed  on
           cards  special  attention should be given to this program unit, as
           the most frequent problem with punched cards is getting the  punch
           codes correct.
0
0
0
 .
 .
                                          2-8
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          2.4.2.  Block Data in the Comprehensive Program
0
           The block data subprogram of the comprehensive program, identified
           on the exchange program distribution tape as  EXCHBD,  contains  a
           translate  table similar to the table in the block data subprogram
           of the simple program.  Two versions of EXCHBD are  provided,  one
           having  a full ASCII translate table as for EXCHBX, and one having
           no translate table (consult section 2.5).  Since  the  modules  of
           the  comprehensive  program  are  always  copied from the exchange
           distribution tape by using the simple program, the translate table
           in  the  simple  program  completely determines the content of the
           translate table in EXCHBD.
0          The array COMD in the named COMMON  block  /EXCHPC/  contains  the
           first  four  letters  of commands to be recognized by EXCHC1.  The
           array contains space for 40 commands  but  only  34  commands  are
           recognized  by  the portable version of the comprehensive program.
           The extra space may be used to assist in the recognition of system
           dependent  commands.   If  such  commands  are  placed in COMD the
           variable NCOMDT in the  named  COMMON  block  /EXCHPC/  should  be
           changed to indicate the total number of commands in COMD.  Consult
           the description of EXCHCX for more information.
0
           2.4.3.  Opening and Closing Native Format Files
0
           Some Fortran run time systems require that Fortran files be opened
           and  closed  by  using  a  non-portable statement.  The subroutine
           EXCHFO is called when some  of  these  files  must  be  opened  or
           closed.   In most systems, EXCHFO is trivial, consisting of only a
           return statement.  EXCHFO is invoked by
0               CALL EXCHFO (IOP)
0          where IOP is an INTEGER scalar.  If IOP is positive, a file is  to
           be  opened.   If  IOP  is  negative,  a file is to be closed.  The
           absolute value of IOP determines the file to open or  close.   The
           files  are  identified  by  a  Fortran unit number, indicated by a
           variable in the named COMMON block /EXCHUC/.  If IABS(IOP)  is  1,
           open  or  close the file identified by READER.  If IABS(IOP) is 2,
           open or close the file identified by PRINTR.  If IABS(IOP)  is  3,
           open  or  close  the file identified by WORKF.  If IABS(IOP) is 4,
           open or close the file identified by INFILE.  EXCHFO  is  used  by
           both  the  simple  and  comprehensive  programs.   In  the  simple
           program, WORKF is used for formatted output.  In the comprehensive
           program,  WORKF  is used for unformatted output and input.  EXCHFO
 .
 .
                                          2-9
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          is called with IABS(IOP) equal 4 only when EXCHFO is part  of  the
           simple program.
0          In  the comprehensive program, the system dependent information in
           the READER FILE, WORK FILE or PRINTER  commands  may  be  used  to
           provide operational convenience (consult section 2.2).
0
           2.4.4.  Reading Native Format Files
0
           The  subprogram  EXCHIM  is  used  by the comprehensive program to
           perform operations on native format input files.  When  EXCHIM  is
           invoked by
0               CALL EXCHIM
0          the  operation  to  be performed is determined by the value of the
           INTEGER variable ACTION in the named COMMON  block  /EXCHPC/.   If
           ACTION  is  -1 a native format file is to be closed.  If ACTION is
           zero a native format file is to be read.  If ACTION is +1 a native
           format file is to be opened.  If ACTION is +2 a native format file
           is to be rewound.  The file upon which to  act  is  determined  by
           examining  the  unit  numbers  indicated  by  the variables INALT,
           INTEXT, INFILE and READER in the named COMMON  block  /EXCHUC/  in
           the  order  shown,  and  acting  upon the file associated with the
           first  positive  unit  number.   The  rewind  operation  is  never
           requested  for  the  READER and INTEXT files.  After the requested
           operation has been performed, ACTION must be set to zero.
0          Data read when ACTION is zero is to be placed in the  180  element
           Fortran type INTEGER vectors COMAND and HOLCMD in the named COMMON
           block /EXCHPC/, storing one character per  element.   HOLCMD  must
           contain   the   representation  used  by  the  host  machine  when
           characters are read using 'A1' format.  COMAND  must  contain  the
           integer  equivalent  of  the  characters in HOLCMD as described in
           section 2.1.  The portable version of EXCHIM translates  only  the
           47 characters defined by the ANSI Fortran 66 standard [5], using a
           very slow method.  A more  complete  translation,  or  significant
           improvement  in performance, may be achieved by a system dependent
           translation method.  The position of the last non-blank  character
           must  be stored in the INTEGER variable NCHCMD in the named COMMON
           block /EXCHPC/.  If an end of file mark is detected while  reading
           data, NCHCMD must be set to -1.
0          In  some  systems  files  must be opened and closed by executing a
           non-portable statement.  Such statements are not possible  in  the
           (almost) portable version of EXCHIM.
 .
 .
                                          2-10
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          When  an input native format file is to be opened (ACTION=+1), the
           command causing the file to be opened is still  stored  in  COMAND
           and   HOLCMD   (consult   section   2.2).   The  system  dependent
           information may be  used  at  this  time  to  provide  operational
           convenience.   The  system  dependent  information  may instead be
           processed by the system  sensitive  subprogram  EXCHCX,  described
           below.
0
           2.4.5.  Writing Native Format Files
0
           The  subprogram  EXCHOU  is  used  by the comprehensive program to
           write the native format file indicated by the unit  number  OUFILE
           in  the  named  COMMON block /EXCHUC/.  In some systems it is also
           necessary to open and close Fortran files by using a  non-portable
           statement,  and  take  special  actions at the beginning of end of
           text modules.  Such processing is not  possible  in  the  (almost)
           portable version of EXCHOU.  When EXCHOU is invoked by
0               CALL EXCHOU (OUTPUT)
0          the  action  to be performed is determined by the INTEGER variable
           ACTION in the named COMMON block /EXCHPC/.  If ACTION is  -2,  the
           end  of  a  text  module has been processed.  If ACTION is -1, the
           file is to be closed.  If ACTION is zero, data in the type INTEGER
           vector  OUTPUT  is to be written on the file.  If ACTION is +1 the
           file is to be opened.  if ACTION is +2 the first line  of  a  text
           module will be the next output.
0          When  data  are  to be written, the number of characters is in the
           INTEGER variable  NCHOUT  in  the  named  COMMON  block  /EXCHPC/.
           (NCHOUT  is  always  less  than 178).  The elements of the INTEGER
           vector OUTPUT are individual characters represented by the integer
           equivalent  of  the  ASCII  code  [3].   This  representation must
           usually be converted to the normal hollerith representation of the
           host machine.  If OUTPUT(180) is less than one, the data in OUTPUT
           represent a control record.  If OUTPUT(180) is greater than  zero,
           the data in OUTPUT represent a text image.
0          When the file associated with the Fortran unit number OUFILE is to
           be opened (ACTION=+1) the OUTPUT FILE command is still  stored  in
           the  INTEGER vectors COMAND and HOLCMD (consult section 2.2).  The
           system dependent information from the OUTPUT FILE command  may  be
           used  at this time to provide operational convenience.  The system
           dependent information may  instead  be  processed  by  the  system
           sensitive subprogram EXCHCX, described below.
0.
 .
                                          2-11
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          2.4.6.  Segmentation of the Compehensive Program
0
           The major operations of the comprehensive program are performed by
           9 subprograms that need not occupy main memory simultaneously.  In
           minicomputer  systems it is usually necessary to allow only one of
           these subprograms to occupy memory at a time, due to  memory  size
           limitations.   In  some systems loading of non-resident parts of a
           program must be initiated by explicit program action.  Before  any
           of  the  potentially  non-resident  segments  of  the  program are
           entered, the subprogram EXCHSL is invoked by
0               CALL EXCHSL
0          to allow the program to request the segment to be loaded.  In most
           systems, EXCHSL is trivial, consisting of only a return statement.
           The segment to be loaded is determined  by  the  INTEGER  variable
           TRANS in the named COMMON block /EXCHPC/, as shown below.
0           Value of TRANS     Contents of Segment
                  1            EXCHC1, EXCHCX
                  2            EXCHC2
                  3            EXCHC3, EXCHRH, EXCHWH
                  4            EXCHC4, EXCHLX
                  5            EXCHC5, EXCHCG
                  6            EXCHC6
                  7            EXCHC7
                  8            EXCHC8
                  9            EXCHC9
0          In  the  Sperry  V-70  VORTEX  system, the operations of loading a
           non-resident segment and passing control to  it  are  inseparable.
           Due  to memory size limitations, the segment loading was performed
           in EXCHTR, and EXCHSL was deleted.  This may also be  required  in
           other systems.
0
           2.5.  Optional System Dependent Enhancements
0
           Several  subprograms  of the comprehensive program may be modified
           in system  dependent  ways  to  provide  operational  convenience,
           enhanced  performance,  or  capabilities  having meaning only in a
           system dependent  context.   Such  modifications  of  the  modules
           EXCHIM, EXCHOU, EXCHRT, EXCHWT, and EXCHFO were discussed above.
0
0.
 .
                                          2-12
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          2.5.1.  Conversion of Character Codes for Output
0
           The subprogram EXCHAH is invoked by
0               CALL EXCHAH (RECORD,NCHAR)
0          where  NCHAR  is  an  INTEGER  scalar  indicating  the  number  of
           characters in the INTEGER in-out vector  RECORD  to  be  converted
           from  the  internal  ASCII representation [3] to the host system's
           hollerith representation.  The portable version of EXCHAH uses the
           translate table provided in the block data subprogram EXCHBD.  But
           in some systems, the internal hollerith  representation  uses  the
           ASCII   code,   and   the  translation  from  the  internal  ASCII
           representation may therefore be performed without  the  use  of  a
           translate table.  If a version of EXCHAH is provided that does not
           require a translate table, and the translate table is not used  by
           any  other  system  dependent  modules, the translate table may be
           removed.  (The translate table is stored in the named COMMON block
           /EXCHXC/  and  is probably referenced only in the main program and
           EXCHBD).
0
           2.5.2.  System Dependent Command Processing
0
0
           2.5.2.1.  Extra Commands in the Comprehensive Program
0
           When commands are being processed by the comprehensive program and
           an  input  image  does  not  contain  a  command recognized by the
           portable command interpreter the subroutine EXCHCX is invoked by
0               CALL EXCHCX (0)
0          to examine the input image.  The input image is stored  in  COMAND
           and  HOLCMD  by  EXCHIM (consult the description of the method for
           reading native format files).  If the input image is not a  system
           dependent  command  EXCHCX  should make sure the variable ICOMD in
           the named COMMON block /EXCHPC/ is zero, and return.  If the image
           is  a system dependent command certain processing performed by the
           portable command interpreter may be useful.  The command word  may
           be recognized by EXCHC1 if the variable NCOMDT in the named COMMON
           block /EXCHPC/ is greater than the variable NCOMDP  in  the  named
           COMMON block /EXCHPC/ and locations in the array COMD in the named
           COMMON block  /EXCHPC/  have  been  provided  appropriate  values.
 .
 .
                                          2-13
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          Examination of the subprograms EXCHBD, EXCHC1 and system dependent
           variants of EXCHCX should provide sufficient understanding of  the
           changes  necessary.   If  the command word is recognized by EXCHC1
           the variable ICOMD in the named  COMMON  block  /EXCHPC/  will  be
           greater  than  NCOMDP  and  less  than  or  equal  to NCOMDP.  The
           modifier character  of  the  command  is  stored  in  the  INTEGER
           variable  MODIFY  in  the  named COMMON block /EXCHPC/.  MODIFY is
           zero if no modifier  was  selected.   The  position  of  the  last
           non-blank  character  of  the  image  is  indicated by the INTEGER
           variable NCHCMD in the named COMMON block /EXCHPC/.   The  INTEGER
           variable  EQUAL  in  the named COMMON block /EXCHPC/ indicates the
           position of the first non-blank character following the equal sign
           in the image, is zero if no equal sign appears in the image, or is
           greater than NCHCMD if  the  equal  sign  is  the  last  non-blank
           character of the image.
0          System dependent commands have been used to indicate the character
           code to use for native format output (UNIVAC 1100 version), and to
           indicate  whether the horizontal tab character (ASCII 9) is a data
           character or is to be replaced by the appropriate number of spaces
           (DEC  PDP-10, PDP-11, VAX/VMS and VAX/UNIX versions and DG MV/8000
           AOS/VS version).
0
           2.5.2.2.  Processing of System Dependent Information
0
           When   certain   commands   that   may  contain  system  dependent
           information are recognized by  EXCHC1  the  subroutine  EXCHCX  is
           invoked by
0                CALL EXCHCX (REASON)
0          where  the  value  of  reason  is  determined by the command being
           processed, as shown in the table below.
0            Value of REASON     Command
                   1             READER
                   2             INPUT FILE
                   3             TEXT
                   4             INCLUDE FILE
                   5             OUTPUT FILE
                   6             INTAPE
                   7             OUTAPE
0          This  provides  a  common  point  for  processing system dependent
           information from commands.  In some systems EXCHC1 and EXCHCX will
           be part of a nonresident segment.  When EXCHCX is invoked any file
 .
 .
                                          2-14
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          defined by a previous occurrence of the  command  will  have  been
           closed,  and the file to be defined by the command will not yet be
           opened.  The file defined by the READER command may be  opened  in
           EXCHCX  or  EXCHFO.   The files defined by the INPUT FILE, TEXT or
           INCLUDE FILE commands may be opened in EXCHIM or EXCHCX.  The file
           defined  by  the  OUTPUT  FILE  command may be opened in EXCHOU or
           EXCHCX.  The system dependent information provided by  the  INTAPE
           and  OUTAPE  commands  must  be  processed  in  EXCHCX because the
           command is not available when EXCHRT or EXCHWT is called  to  open
           the  file defined by the command.  The file defined by the command
           should not be opened by EXCHCX.
0
           2.5.3.  System Dependent Use of Control Records
0
           Before each control record is written on the output exchange tape,
           the subprogram EXCHCG is invoked by
0               CALL EXCHCG (OUTREC)
0          to allow system dependent processing of control records.  The type
           of the control record is indicated by the INTEGER variable  ITYPEO
           in  the  named  COMMON  block /EXCHPC/ and the text of the control
           record is contained in the INTEGER vector OUTREC, both  using  the
           internal representation (ASCII) of the comprehensive program.  The
           number of characters of text of the control record is indicated by
           the  INTEGER  variable  NCHOUT in the named COMMON block /EXCHPC/.
           If NCHOUT is zero a control record is not being processed;  NCHOUT
           equal zero means all control records associated with a text module
           have previously been processed and processing of text is to begin.
           EXCHCG   may  be  used  for  automatic  creation  of  job  control
           statements.
0
0
0
0
0
0
0
0.
 .
                                          2-15
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          3.  Installation Instructions
0
0
           3.1.  Organization of the Distribution Tape
0
           The first file  of  the  exchange  program  distribution  tape  is
           written  using the comprehensive exchange program, and may be read
           using either program.  The second and following files of the  tape
           contain  job  control statements and machine sensitive versions of
           the complete simple program, written in a format  intended  to  be
           easy  to  read  by  each  machine for which the programs have been
           implemented.  The exact number of files, and  the  format  of  the
           individual  files  may change as the programs evolve.  If the tape
           is long enough, all files will be recorded a second time.
0          The first file of the tape contains all modules of  both  programs
           for  all  machines  for  which the programs have been implemented,
           documentation (including this document), and some  small  programs
           for  exchanging  text  on punched cards.  Although the modules are
           all part of a single file, they are recorded in  clusters  on  the
           tape.   The  number  of clusters and the number of modules in each
           cluster may change as the programs evolve.  In general, the  first
           file of the tape contains:
0           Machine dependent declarations.  These  should  NOT  include  the
            '--' sentinel at the end of the module because it is difficult to
            remove before processing by the simple program.
0           Fortran declarations for the named COMMON blocks in the  portable
            subprograms of both programs.
0           Machine sensitive versions of the main program unit.
0           The simple exchange program.
0           Two  versions  of  the  BLOCK DATA subprogram EXCHBX, part of the
            simple program.
0           Two versions of the BLOCK DATA subprogram  EXCHBD,  part  of  the
            comprehensive program.
0           Machine sensitive and machine specific modules (except EXCHCX and
            EXCHCG) for both programs, grouped by machine.
0           Portable versions of modules for which machine sensitive versions
 .
 .
                                          3-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0           may or may not be included.  Do not use the portable version if a
            machine sensitive version is included.
0           Machine insensitive modules of the root segment.
0           Modules  of  the  non-resident  segments  (including  EXCHCX  and
            EXCHCG), in the order shown in section 2.4.6.
0           Documentation.
0           Job Control Language statements for several machines.
0           Small related programs.
0          An index of the first file of the  exchange  program  distribution
           tape, and a description of the other files, should accompany every
           transmittal of the tape.
0
           3.2.  Constructing the Simple Program
0
                If your machine  is  one  for  which  the  machine  sensitive
           modules  have been written, constructing the simple program should
           not be difficult.  If you receive the  simple  program  on  cards,
           steps 1 through 3 are not needed.  The instructions below are only
           a general guide; they may need modification for your machine.
             1.  The content and format of  the  distribution  tape  will  be
                 explained in a cover letter.  Determine the file(s) you need
                 to copy from the distribution tape.
             2.  The  format  of the necessary files of the distribution tape
                 should be convenient for your machine.  Copy  the  necessary
                 program  text  files  to files of the format most convenient
                 for the compiler (and assembler if necessary).
             3.  Copy  the file containing job control statements, if any, to
                 a medium accessible by your text editor.
             4.  Examine the translate table in the block data subprogram, if
                 included in your version of the simple  program.   (See  the
                 section  titled  "Contents  of the Simple Program" in one of
                 chapters 6-14, as  appropriate).   The  translate  table  is
                 contained  in  the  128  element  vector XLATE in the common
                 block  /EXCHXC/,  and  provided  values  by  a  BLOCK   DATA
                 subprogram.   It  is indexed by one more than the ASCII code
                 [3] for a character to be translated to the  character  code
                 of  the  host  machine.   The table may have been damaged by
                 incorrect or incomplete translations of  the  program  text.
                 Some  machines  and  compilers  do  not support the complete
                 ASCII graphic set.  If your  system  does  not  support  the
 .
 .
                                          3-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0                complete  ASCII  graphic  set,  there  is  probably a system
                 standard translation from ASCII  to  the  supported  graphic
                 set.   It  is  important  to  get the translate table right,
                 because it is used  to  translate  the  character  codes  on
                 exchange  tapes  to  the  correct  character  code  for your
                 system.  The value of each element of  the  translate  table
                 should be:
                   1 through 32 - all dollar signs ($);
                   33 - blank;
                   34 - exclamation point (!);
                   35 - double quote (");
                   36 - number sign (#);
                   37 - dollar sign ($);
                   38 - percent sign (%);
                   39 - ampersand (&);
                   40 - apostrophe (');
                   41 - left parenthesis (();
                   42 - right parenthesis ());
                   43 - asterisk (*);
                   44 - plus sign (+);
                   45 - comma (,);
                   46 - minus sign (-);
                   47 - period (.);
                   48 - slash (/);
                   49 through 58 - digits zero through nine;
                   59 - colon (:);
                   60 - semicolon (;);
                   61 - less than sign (<);
                   62 - equal sign (=);
                   63 - greater than sign (>);
                   64 - question mark (?);
                   65 - commercial at sign (@);
                   66 through 91 - upper case alphabet;
                   92 - left square bracket ([);
                   93 - backward slash (\);
                   94 - right square bracket (]);
                   95 - circumflex (^);
                   96 - underscore (_);
                   97 - accent grave (`);
                   98 through 123 - lower case alphabet;
                   124 - left curly bracket ({);
                   125 - vertical bar (|);
                   126 - right curly bracket (});
                   127 - tilde (~);
                   128 - dollar sign ($);
             5.  Make any necessary changes to the job control statements  to
                 accomodate  site  dependent  equipment codes, file names and
                 tape reel numbers.
 .
 .
                                          3-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            6.  Use  the  job  control statements to compile and execute the
                 simple program.  Executing the  simple  program,  using  the
                 input provided, copies the text of the comprehensive program
                 from the distribution tape;  see section 3.3 below.
                If the machine sensitive modules have not  been  written  for
           your  machine,  consult  chapter  2  for  specifications  of these
           modules.  Information in chapters 6-14 may also be helpful.   When
           the  machine  sensitive  modules  are  written,  copy the complete
           simple program for any machine from  the  distribution  tape,  and
           substitute your machine sensitive modules.
0
           3.3.  Constructing the Comprehensive Program
0
                 The  comprehensive  program  is distributed only on exchange
           format tapes.  Constructing the comprehensive program is therefore
           a bootstrap process:
             1.  Construct the simple program (see above).
             2.  Use the simple program to copy the  required  modules  to  a
                 file  having  the  format of the host machine (called native
                 format below).  Copying  the  modules  requires  two  steps,
                 performed by the simple program in one execution:
                 A.  Copy  some  common  program  text (variable declarations
                     etc.) from the first few  modules  of  the  distribution
                     tape  to a native format file.  The modules to be copied
                     depend on the machine.
                 B.  Copy  the  program  text from the distribution tape to a
                     native  format  file.   The  simple  program   must   be
                     instructed  to insert the common program text as needed.
                     See sections 4.2 and 5.4.
             3.  Use the simple program to copy job  control  statements,  if
                 provided, to a native format file.
             4.  Make any necessary changes to the job control statements  to
                 accomodate  site  dependent  equipment codes, file names and
                 tape reel numbers.
             5.  Use  the job control statements to compile the comprehensive
                 program.
0
0
0
0
0
 .
 .
                                          3-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          4.  User's Guide for the Simple Program
0
0
           4.1.  Functional Overview of the Simple Program
0
                The simple  tape  exchange  program  is  a  relatively  small
           program  that  provides  a  basic capability for transferring text
           from an Exchange tape to a native format output file and  printing
           descriptive information for all text modules copied.  This program
           requires four machine sensitive  subprograms  that  are  presently
           available   for   several   machine  types.   See  chapter  1  for
           installation details.
                This program references three files:  an input Exchange tape,
           an output native format file  and  an  optional  "include"  native
           format  file.   By  using appropriate commands one can copy all or
           selected modules from the Exchange tape to the output file.
                Literal text can be inserted from the command stream into the
           output file.  This would normally be used to insert command  lines
           that have meaning to the host operating system.
                The Exchange tape  may  contain  one  or  more  instances  of
           "include"  text in some modules.  These segments of "include" text
           may be  referenced  by  name  from  one  or  more  other  modules.
           Commands are provided so one can initially copy the "include" text
           to the "include" file.  Thereafter whenever a module being  copied
           from the Exchange tape to the native format output file contains a
           reference to a named segment of "include" text the referenced text
           will be copied from the "include" file to the native format output
           file at that point.   The  syntax  for  defining  and  referencing
           "include" segments is described in section 3.5.5 of [2].
0
           4.2.  Command Repertoire of the Simple Program
0
                  The   program  accepts  control  images  in  three formats,
           designated A, B and C.
                 The first image must be an A image and this must be the only
           A image.  The A image is read using a Fortran format  (3I5,4X,A1).
0             Image Columns      Meaning
             1-5, rt justified   The  Fortran  unit  number  for  the   input
                                 Exchange tape.
            6-10, rt justified   The  Fortran  unit  number  for  the  native
                                 format  output  file.   If  the  unit number
                                 specified in columns 11-15 is  greater  than
 .
 .
                                          4-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0                                zero,  this  unit  will not be used until op
                                 code 6 (described below) is executed.
           11-15, rt justified   If  greater  than  zero  this is the Fortran
                                 unit number of  the  "include"  file.   This
                                 file  will  be used for native format output
                                 until  op  code  6  (described   below)   is
                                 executed.
           20                    A  single  character,  called  C1   in   the
                                 following descriptions.
0               The second command image must  be  a  B  image.   A  B  image
           contains  an  op  code  of  0,  1, 2, ... or 9 in column 1 and may
           contain arbitrary text in columns 2-80.  The op  code  selects  an
           operation to be performed and determines the command that follows:
0           Op    Next
           Codes  Input  Operation
             0      B    Op  codes  0  and  2  cause  an  80  character image
             2      C    consisting  of  the  character  C1  from the A image
                         followed by the contents of columns 2-80 of  this  B
                         image  to  be  inserted  in the native format output
                         file.
0            1      B    Op  codes  1  and  3  cause  a  79  character  image
             3      C    consisting  of  columns  2-80  of this B image to be
                         inserted in columns 1-79 of the native format output
                         file.
0            4      C    No operation.
0            5      B    Rewind the input Exchange tape.
0            6      B    If  the  "include"  file is currently being used for
                         native format output, and some text has been written
                         on  the "include" file, write an end of file mark on
                         the "include" file and rewind it.  In any case,  use
                         the  output  file  for  all  further  native  format
                         output.  A previously prepared  "include"  file  may
                         therefore be used by specifying op code 6 before any
                         other operations.
0          7,8,9  None   Write an  end-of-file  mark  on  the  native  format
                         output file and terminate processing.
0               A C image triggers transmission  of  text  modules  from  the
           input  Exchange  tape to the native format output file.  A C image
           follows a B image with op code 2, 3 or 4 and is always followed by
           a B image.
 .
 .
                                          4-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0               A C image contains up to eight pairs of 5 digit numbers  that
           select  up  to  eight ranges of modules to be copied.  The Fortran
           format used to read C images is (16I5).
                If the first number of any pair is zero or negative, the pair
           of numbers is ignored.  If the first number of a pair is  positive
           but  the  second  number  is  negative the magnitude of the second
           number indicates the end of the range and an end-of-file  mark  is
           written  on  the  native  format  output  file after this range of
           modules has been copied.  This program does not  prohibit  further
           writing  after an end-of-file mark is written on the native format
           output file.  The host operating  system  may,  however,  prohibit
           such further writing.
                The modules to be accessed on the input tape as the result of
           left-to-right scanning of C images must be in increasing numerical
           sequence.  Out-of-sequence retrieval from the input  tape  may  be
           accomplished  by  use of op code 5 whenever the input tape must be
           rewound.
0
           4.3.  Printed Output of the Simple Program
0
0
           4.3.1.  Table of Contents of the EXCH Tape.
0
           The  simple  tape  exchange  program  produces a table of contents
           listing describing all modules copied from  the  EXCH  tape.   The
           entries  in  the  table  of  contents consist of three parts:  The
           module number, the control  record  type,  and  the  text  of  the
           control record.  Control record types are described in section 3.3
           of [2].
0
           4.3.2.  Error Messages
0
           SELECTIONS nnnnn-nnnnn NOT INCREASING.
             The module numbers indicated by input  C  are  not  provided  in
             increasing order.
0          TEXT TO BE INCLUDED CANNOT BE FOUND.
           -I (search target)
             There is an image '-I (search target)'  in  some  module  to  be
             copied  from  the  input  EXCH  tape, and the text identified by
             (search target) cannot be found on the include file.
0.
 .
                                          4-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          BLOCK SEQUENCE NUMBER WAS nnnnn, SHOULD HAVE BEEN mmmmm
             The block sequence number on the EXCH tape was not the  expected
             value.
0          ERROR n WHILE TRYING TO ...
             An  error occurred while trying to perform an input operation on
             the EXCH tape.  The values of n (always between 1 and 6) mean:
                1. The block sequence number on the EXCH  tape  was  not  the
                   expected value.
                2. The block read from the EXCH tape was too short to contain
                   crucial structural information.
                3. An error was reported by the supporting operating  system.
                4. A  record  on  the  EXCH  tape  will  not fit in the space
                   allowed  in  the  program.   Space  is  allowed  for   180
                   characters.
                5. The  type  of  a  record  on  the  EXCH  tape  cannot   be
                   determined.
                6. The first block of the EXCH tape is not a TES label.
0          Other  error messages may be produced by system dependent modules.
           Consult appropriate chapters of this document for  description  of
           these messages.
0          Consult [3] for detailed information on the EXCH tape format.
0
           4.3.3.  Informative Messages
0
           END FILE AND REWIND INCLUDE FILE.
             Means  that  an end of file mark has been written on the include
             file, and the include file has been rewound.  The  include  file
             may  subsequently  be  searched  for  text  to be included while
             copying modules from the exchange tape.
0          END-OF-FILE MARK WRITTEN.
             Means that an end of file mark has been written  on  the  native
             format output file.
0          PROGRAM EXECUTION TERMINATED.
             Means  the  program has stopped operation.  If there is no prior
             error message, program execution terminated  normally,  and  the
             output file should be usable.
0          Other informative messages may be  produced  by  system  dependent
           modules.   Consult  appropriate  chapters  of  this  document  for
           description of these messages.
0.
 .
                                          4-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          5.  Reading Exchange Tapes with the Simple Program
0
0
           5.1.  Ex. R.0.1 Simple read of EXCH tape, IBM 360/370
0
           In  this example we suppose that modules numbered 1 through 50 and
           101 through 150 are needed.  The input exchange tape is mounted on
           file  number  10.   The  output modules will be on file number 11,
           followed by two end  of  file  marks.   The  input  needed  is  as
           follows.
0              123456789012345678901234567890              Column alignment
                  10   11    0                             input A
               4                                           input B
                   1   50  101 -150                        input C
               9                                           input B
0
           5.2.  Ex. R.0.2 Simple read of EXCH tape, CDC 6000-7000
0
           The problem here is the same one as in Ex. R.0.1,  except  that  a
           CDC PROGRAM statement must be placed on the output file before the
           first module.  The input needed is as follows.
0              123456789012345678901234567890              Column alignment
                  10   11    0                             input A
               0     PROGRAM (INPUT,OUTPUT,TAPE5=INPUT,    input B
               2    1         TAPE6=OUTPUT)                input B
                   1   50  101 -150                        input C
               9                                           input B
0
           5.3.  Ex. R.0.3 Simple read of EXCH tape, UNIVAC 1100
0
           In this example we suppose that modules  number  50  and  101  are
           needed.   The  input  tape  and  output file numbers are 10 and 11
           respectively.  Since each of the two modules are  Fortran  program
           units,  it  is desirable to insert @FOR,IS MAIN in front of module
           number 50,  and  @FOR,IS  SUB  in  front  of  module  number  101.
           Following  execution of the simple program these two program units
           may be compiled by using the UNIVAC 1100  control  statement  @ADD
           11.
0.
 .
                                          5-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0              123456789012345678901234567890              Column alignment
                  10   11    0    @                        input A
               2FOR,IS MAIN                                input B
                  50   50                                  input C
               2FOR,IS SUB                                 input B
                 101  101                                  input C
               9                                           input B
0
           5.4.  Ex. R.0.4 Simple read with include, IBM 360/370
0
           This example is different from Ex. R.0.1  only  in  one  important
           respect.  Several of the modules contain the line image
0              -I FILE/NAME
0          indicating  that  text  identified by FILE/NAME is to be inserted.
           The block of text identified by FILE/NAME is part of module number
           51.  The steps are:
           1.  Copy module 51 to file 12.
           2.  Append an image containing only -- to file 12.  This image  is
               used  as an end marker, and is required.  It may already be in
               module 51, but it does not hurt to append it here just  to  be
               safe.
           3.  Write an end of file mark on file  12,  rewind  file  12,  and
               search  file 12 for text to be included while writing file 11.
           4.  copy modules 1-50 and 101-150 to file 11.
           The input needed is as follows.
0              123456789012345678901234567890              Column alignment
                  10   11   12                             input A
               4                                           input B
                  51   51                                  input C
               1--                                         input B
               6                                           input B
               5                                           input B
               4                                           input B
                   1   50  101 -150                        input C
               9                                           input B
0
0
0
0
 .
 .
                                          5-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          6.  IBM System/360
0
0
           6.1.  System Dependent Information from Commands
0
           The IBM System/360 version of the comprehensive  exchange  program
           does  not  examine the parts of command images reserved for system
           dependent information.
0
           6.2.  Default Values for File Unit Numbers
0
           The default value for the READER file  is  unit  5.   The  default
           falue  for  the PRINTER file is unit 6.  The default value for the
           WORK file is unit 8.
0
           6.3.  Default Value for the Command Margin
0
           The default value for the command margin is 72.  This value may be
           changed by the MARGIN command.
0
           6.4.  Information Provided by the Environment
0
           The DATE is not provided by the system dependent environment.  The
           SITE may be provided.  Consult site dependent documentation.
0
           6.5.  Interpretation of Option Letters
0
           The IBM System/360 version of the comprehensive  exchange  program
           is not affected by any option letters other than those interpreted
           by the portable parts of the program.
0
           6.6.  Special Commands
0
           The IBM System/360 version of the comprehensive  exchange  program
           does  not  interpret  any commands other than those interpreted by
 .
 .
                                          6-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          the portable parts of the program.
0
           6.7.  Interface to OS/MVT
0
0
           6.7.1.  Job Control Language Statements for OS/MVT
0
           The  Job  Control  Language  Statements  shown  below  declare two
           exchange tapes, and  a  work  file  needed  by  the  comprehensive
           exchange  program.  The input exchange tape is Fortran unit 9, the
           output exchange tape is Fortran unit 10,  and  the  work  file  is
           Fortran unit 8.
0          Exchange  tapes  are always unlabelled, having a blocksize of 3600
           bytes, and unspecified recording format.  The DCB parameter  DEN=X
           specifies  the  recording density, where X is 0 if the tape is 200
           BPI, X is 1 if the tape is 556 BPI, X is 2 if the tape is 800 BPI,
           and  X is 3 if the tape is 1600 BPI.  Densities of 200 and 556 BPI
           are only available on 7 track tapes; 800 BPI is available on 7  or
           9  track  tapes; 1600 BPI is only available on 9 track tapes.  The
           UNIT parameter specifies the device type.  The values of the  UNIT
           parameter  are  site dependent.  The data set (file) to be used by
           the program is specified by the first LABEL parameter.  The VOLUME
           parameter specifies the tape reel identity.
0          The  comprehensive  exchange  program  is  assumed  to  be  in the
           catalogued data set EXCH(ABS).
0          //GO          EXEC PGM=EXCH(ABS)
           //GO.FT09F001   DD DSNAME=TAPE9,DISP=(OLD,PASS),LABEL=(1,BLP,,IN),
           //                 DCB=(BLKSIZE=3600,RECFM=U,DEN=3),UNIT=TAPE,
           //                 VOLUME=SER=IBMTPE
           //GO.FT10F001   DD DSNAME=TAPE10,DISP=(OLD,PASS),LABEL=(1,BLP),
           //                 DCB=(BLKSIZE=3600,RECFM=U,DEN=3),UNIT=TAPE,
           //                 VOLUME=SER=IBMNEW
           //GO.FT08F001   DD DSNAME=WORKF,DISP=(NEW,DELETE),UNIT=SYSSQ,
           //                 DCB=(BLKSIZE=7000,LRECL=800,RECFM=VB),
           //                 SPACE=(TRK,(2,2))
           //GO.SYSIN      DD *
           INTAPE=9
           OUTAPE=10
           DATE=(YYMMDD)
           COPY=N-N
           QUIT
 .
 .
                                          6-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          /*
0          Commands are read from the data set defined for GO.SYSIN.  In  the
           above JCL sample, GO.SYSIN is the JCL stream.
0
           6.7.2.  Input/Output Interface
0
           All input and output is performed by the Fortran I/O library.  End
           of file marks are detected automatically; QUIT commands  and  '--'
           sentinels are optional at the end of input files.
0
           6.8.  Contents of the Simple Program
0
           The simple exchange program for the IBM System/360 consists of the
           machine sensitive main program unit; the simple exchange  program,
           identified  on  the distribution tape as EXCHSP; the ASCII version
           of the BLOCK DATA subprogram EXCHBX; machine sensitive versions of
           EXCHRT and EXCHUN; portable versions of EXCHAH and EXCHFO; and the
           machine insensitive modules EXCHGB, EXCHGR and EXCHRH.
0
           6.9.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the IBM System/360 consists
           of  the  machine  sensitive  main  program;  the  ASCII version of
           EXCHBD;  machine  sensitive  versions  of  EXCH,  EXCHUN,  EXCHPA,
           EXCHRT,  EXCHWT,  EXCHIM  and EXCHOU; portable versions of EXCHAH,
           EXCHFO,  EXCHSL,  EXCHTR,  EXCHCX  and  EXCHCG;  and  the  machine
           insensitive   modules  EXCHGB,  EXCHGR,  EXCHNP,  EXCHPB,  EXCHPR,
           EXCHSC, EXCHTP, EXCHTW, EXCHC1, EXCHC2,  EXCHC3,  EXCHRH,  EXCHWH,
           EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7, EXCHC8 and EXCHC9.
0
           6.10.  Error Messages
0
           The IBM System/360  versions  of  the  exchange  programs  do  not
           produce  any  error  messages  other  than  those  produced by the
           portable versions.
0
0
 .
 .
                                          6-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          7.  Univac 1100
0
0
           7.1.  System Dependent Information from Commands
0
                The Univac 1100 version of the comprehensive exchange program
           interprets the parts of commands  reserved  for  system  dependent
           information  when the file associated with the Fortran unit number
           specified by the command is a disk or Fastrand file.   The  system
           dependent information must not be supplied for tape files.
                For the INTAPE and  OUTAPE  commands,  the  system  dependent
           information provides the name of an OMNIBUS element in the program
           file associated with the Fortran unit number.  If the element name
           is  omitted,  the  file associated with the Fortran unit number is
           assumed not to be a program file.
                  For  the  INPUT  FILE,  INCLUDE FILE, OUTPUT FILE, and TEXT
           commands, the system dependent information provides the name of  a
           SYMBOLIC element in the program file specified by the Fortran unit
           number.  If the element name is omitted, the Fortran  unit  number
           is  assumed to designate an SDF data file prepared by the exchange
           program, the Univac DATA processor, a Fortran V program, an  ASCII
           Fortran  (FTN)  program,  or  a  symbiont  file.   If  the  system
           dependent information begins with a + sign, input  or  output  (as
           appropriate)  will  continue  on  the  designated file AT THE DISK
           ADDRESS LAST USED FOR DATA TRANSFER ON THE FILE LAST SPECIFIED  BY
           THE SAME COMMAND.  DO NOT USE A DIFFERENT UNIT NUMBER!
0
           7.2.  Default Values for File Unit Numbers
0
           The  default  value  for  the  READER file is unit 5.  The default
           value for the PRINTER file is unit 6.  The default value  for  the
           WORK file is unit 9.
0
           7.3.  Information Provided by the Environment
0
           The  DATE  is  provided  by the system dependent environment.  The
           SITE may be provided.  Consult site dependent documentation.   The
           option field of the processor call statement or @XQT statement may
           be used to provide options usually provided by the OPTION command.
0
 .
 .
                                          7-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          7.4.  Interpretation of Option Letters
0
           The Univac 1100 version of the comprehensive exchange  program  is
           not affected by any option letters other than those interpreted by
           the portable parts of the program.
0
           7.5.  Special Commands
0
           The Univac 1100 version  of  the  comprehensive  exchange  program
           recognizes  two  commands  in  addition to those recognized by the
           portable parts of the program.  Neither command has  a  parameter.
           The   ASCII   command   causes  all  further  SDF  output  to  use
           quarter-word ASCII code.  The FIELDATA command causes all  further
           SDF output to use sixth-word FIELDATA code.  The initial condition
           of the program  is  to  output  ASCII  code.   (But  consult  site
           dependent  documentation).   The  character  code  of SDF input is
           determined automatically.
0
           7.6.  Native Format (SDF) Files
0
           The Univac 1100 version of the exchange program may read SDF files
           or elements prepared by the standard system processors (e.g. DATA,
           ELT, ED, FOR), SDF files produced by formatted writes  in  FOR  or
           FTN  programs, symbiont files prepared by EXEC using @FILE, @BRKPT
           or alternate print or punch files.  When reading print files, line
           spacings of zero one, or two cause Fortran vertical format control
           characters of +, blank and zero respectively, to  be  prefixed  to
           the  image.  Line spacing greater than 2 causes a Fortran vertical
           format control character of 1 to be prefixed to the image.
0
           7.7.  Interface to EXEC
0
0
           7.7.1.  Executive Control Statements
0
           Assume the exchange program  is  stored  in  the  catalogued  file
           Q*F.EXCH,  a 9 track 800 BPI exchange tape having reel number INEX
           is to be read, an output exchange format OMNIBUS element is to  be
           written  in  Q*E.EXOUT, and SDF output is to be written in Q*S.SDF
 .
 .
                                          7-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          using  ASCII  code.   The  executive  control   statements   below
           illustrate a possible specification.
0          @ASG,A Q*F.
           @ASG,TJ IN,U9H,INEX      . EXCHANGE TAPES ARE ALWAYS UNLABELLED.
           @ASG,UP Q*E.
           @ASG,UP Q*S.
           @USE 10,IN
           @USE 11,Q*E
           @USE 12,Q*S
           @Q*F.EXCH,options        . @XQT,options Q*F.EXCH WOULD ALSO WORK.
           INTAPE=10
           OUTAPE=11 EXOUT
           OUTPUT=12 SDF
           ASCII
0
0          7.7.2.  Input/Output Interface
0
           Input and output for exchange format or SDF files and elements are
           performed by assembly language subroutines (which may be useful in
           other applications).   Input  files,  or  files  containing  input
           elements  must  be  assigned prior to use.  Output files, or files
           containing output elements, are assigned with no  options  by  the
           interface subprograms if they are not assigned prior to use.
0          End  of  file marks are detected in input files; QUIT commands and
           '--' sentinels are optional at the end of input files or elements.
0
           7.8.  Contents of the Simple Program
0
           The simple exchange program for the UNIVAC 1100  consists  of  the
           machine  sensitive main program unit; the simple exchange program,
           identified on the distribution tape as EXCHSP; the  ASCII  version
           of the BLOCK DATA subprogram EXCHBX; the machine sensitive version
           of EXCHRT; the machine specific module ASMEXCH1; portable versions
           of  EXCHAH and EXCHFO; and the machine insensitive modules EXCHGB,
           EXCHGR and EXCHRH.  The Fortran modules may be compiled with  @FOR
           or  @FTN.   The assembler module must be assembled with @ASM.  The
           subprogram linkage generated  by  the  FOR  and  FTN  comilers  is
           different.   The symbol 'FTN' is used in ASMEXCH1 to determine the
           linkage.   This  symbol  is  defined  in  the  machine   dependent
           declarations  in the block identified by '-I UNIVAC-FTN/FOR'.  The
           tape is distributed with this symbol having the value 1.   If  the
 .
 .
                                          7-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          Fortran  modules  are  compiled with the FOR compiler the value of
           FTN must be changed to zero.
0
           7.9.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the UNIVAC 1100 consists of
           the  machine  sensitive main program; the ASCII version of EXCHBD;
           machine sensitive versions of EXCH, EXCHRT, EXCHWT, EXCHIM, EXCHOU
           and  EXCHCX;  machine specific modules EXCHEM, ASMEXCH1, ASMEXCH2,
           EORSR and EORSW; portable  versions  of  EXCHAH,  EXCHFO,  EXCHSL,
           EXCHTR  and  EXCHCG  and  the  machine insensitive modules EXCHGB,
           EXCHGR, EXCHNP, EXCHPB, EXCHPR, EXCHSC,  EXCHTP,  EXCHTW,  EXCHC1,
           EXCHC2,  EXCHC3,  EXCHRH,  EXCHWH, EXCHC4, EXCHLX, EXCHC5, EXCHC6,
           EXCHC7, EXCHC8, and EXCHC9.  The Fortran modules may  be  compiled
           with  @FOR  or @FTN.  The assembler modules must be assembled with
           @ASM.  The  subprogram  linkage  generated  by  the  FOR  and  FTN
           compilers is different.  The symbol 'FTN' is used in the assembler
           modules to determine the linkage.  This symbol is defined  in  the
           machine  dependent  declarations  in  the  block identified by '-I
           UNIVAC-FTN/FOR'.  The tape is distributed with this symbol  having
           the  value  1.   If  the Fortran modules are compiled with the FOR
           compiler the value of FTN must  be  changed  to  zero.   When  the
           modules are compiled or assembled the relocatable output should be
           placed in TPF$, using the name from the index on the  distribution
           tape  for the element name.  If this is done the MAP directives in
           the module EXCHMAP  may  be  used  to  collect  the  comprehensive
           program.
0
           7.10.  Error Messages
0
           The severity  is  shown  in  the  description  of  error  messages
           produced  by the Univac-1100 sensitive subprograms of the exchange
           programs.  The error severity is not printed by the program.
0          6 ELEMENT NOT FOUND
             WHILE TRYING TO ...
             The  element described by the system dependent information could
             not be found in the program file indicated by  the  unit  number
             while trying to perform the described action.
0          6 EXEC I/O ERROR
             WHILE TRYING TO ...
             EXEC  encountered  an  unspecified  input  or output error while
             trying to perform the  described  action  on  the  program  file
 .
 .
                                          7-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            indicated by the unit number.
0          6 FILE NOT ASSIGNED OR NOT PF
             WHILE TRYING TO ...
             The  file indicated by the unit number either is not assigned or
             is not a program file.
0          6 FILE/ELEMENT NOT OPENED
             WHILE TRYING TO ...
             This message almost certainly means that  a  program  error  has
             occurred.
0          5 IMPROPER ELEMENT NAME, OPEN FILE
             The  element  name  provided  on  an  OUTPUT FILE command is not
             proper.  Use the file indicated by the unit  number  as  an  SDF
             file.
0          6 I/O ERROR STATUS = nn
             WHILE TRYING TO ...
             An  Input  or  Output error has occurred while trying to perform
             the described operation.  The octal number 'nn' is the EXEC  I/O
             error code described in [6].
0          6 NO ELEMENT NAME, TREAT AS FILE
             The element name provided on a READER, INPUT FILE, TEXT, INCLUDE
             FILE, INTAPE or OUTAPE command is improper.
0          6 PROGRAM FILE OVERFLOW
             WHILE TRYING TO ...
             The program file indicated by the unit number  is  probably  too
             small.  make it bigger.
0
           7.11.  Informative Messages
0
           The message
0          mmmmm BLOCKS WRITTEN ON TAPE nnn
0          provides the number of blocks written on the exchange format  disk
           or  tape  file indicated by the unit number nnn.  The number mmmmm
           is the number of blocks  that  contain  data;  the  label  is  not
           counted.   This  message  is printed when the output exchange disk
           file or tape is closed.
0
0.
 .
                                          7-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          8.  CDC 6000/7000 Using NOS or SCOPE
0
0
           8.1.  System Dependent Information from Commands
0
           The  CDC  6000/7000  version of the comprehensive exchange program
           does not examine the parts of command images reserved  for  system
           dependent information.
0
           8.2.  Default Values for File Unit Numbers
0
           The  default  value  for  the  READER file is unit 5.  The default
           value for the PRINTER file is unit 6.  The default value  for  the
           WORK file is unit 7.
0
           8.3.  Information Provided by the Environment
0
           The DATE is provided by the system dependent environment using the
           subprogram DATE() from the CDC Fortran library.  The SITE  may  be
           provided.  Consult site dependent documentation.
0
           8.4.  Interpretation of Option Letters
0
           The CDC 6000/7000 version of the comprehensive exchange program is
           not affected by any option letters other than those interpreted by
           the portable parts of the program.
0
           8.5.  Special Commands
0
           The  CDC  6000/7000  NOS  and  SCOPE versions of the comprehensive
           exchange program recognize two special commands:  6BIT and  12BIT.
           These  commands are used to obtain conversion between the CDC 12/6
           bit code and ASCII, using the translate table in section 3.2.
0          For example, the two 6 bit characters "^A" can mean lower case "a"
           for  CDC  machines using the NOS operating system when the user is
           operating in "ASCII" mode.  This pair, however, means exactly "^A"
 .
 .
                                          8-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          when  the  user is operating in "NORMAL" mode.  The user who wants
           to retrieve or store a  text  module  that  uses  the  full  ASCII
           character set shown in section 3.2 must use the 12/6 bit character
           set.  Translation using the 12/6 bit character set is  enabled  by
           executing the command 12BIT before processing text.
0          For example, to copy an upper/lower case document from text module
           1 of an exchange tape 10 to CDC output file 11:
0                INTAPE=10
                 OUTPUT FILE=11
                 12BIT
                 COPY=1
0          To  copy  a  CDC upper/lower case document from the CDC file 11 to
           text module 1 of an exchange tape 15:
0                OUTAPE,U=15
                 12BIT
                 NAME=(Document's identifying name)
                 TEXT=11
0          Some further processing of the output files may be required before
           files in 12/6 bit code can be printed.  For example,  on  NOS  the
           user may need to execute the NOS command
0                FCOPY(P=file-in-12/6-bit-code,N=file-to-print).
0          Then file-to-print, now in CDC 12/8 bit code, is ROUTEd or sent to
           an upper/lower case printer.
0          The effects of executing the command 6BIT,  when  storing  a  text
           module,  are  to  convert  each 6 bit code to its ASCII equivalent
           using the table.  Conversely, when copying text modules into a CDC
           file,  lower case letters and special characters not in the CDC 64
           character graphic set will be mapped into approximate  upper  case
           counterparts.   For  example,  lower  case letters appear as upper
           case letters, etc.  The nominal setting is 6BIT.  Users can switch
           back  and  forth  between  the  two translation modes by executing
           either command at any time during processing.
0          If a CDC "ASCII" mode input stream, containing 12/6 bit code pairs
           such  as "^A" is supplied to the exchange program when in the 6BIT
           mode, each 6 bit character will be separately converted  to  ASCII
           and  stored  on the tape.  Thus a user of equipment other than CDC
           equipment would find for example "^A" on the tape instead of  "a".
           Thus,  a  CDC  "ASCII" mode stream stored on an exchange tape with
           the 6BIT command in effect could only be correctly interpreted  as
 .
 .
                                          8-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          ASCII  data  by  a  user of CDC equipment, using "ASCII" mode, but
           with the 6BIT command in effect.
0          The translations between CDC 12/6 bit code and ASCII use the table
           below.
0          CDC 12/6 bit code     ASCII equivalent
                 @D              59 - colon (:)
                 @A              65 - commercial at sign (@)
                 @B              95 - circumflex (^)
                 @G              97 - accent grave (`)
                 ^A,...,^Z       90,...,123 - lower case alphabet
                 ^0              124 - left curly bracket({)
                 ^1              125 - vertical bar (|)
                 ^2              126 - right curly bracket (})
                 ^3              127 - tilde (~)
                 ^(Display code equivalent of ASCII code + 32)
                                 0,...,31 - ASCII Control codes.
0
           8.6.  Interface to NOS or SCOPE
0
0
           8.6.1.  Job Control Statements for NOS
0
           Assume  the  exchange  program is stored in the direct access file
           EXCH.  A 9 track 1600 BPI  (unlabelled)  exchange  tape  known  as
           INEXCH  is  to  be copied to the local file TAPE15.  The following
           control statements show how this might be done.
0          ATTACH,EXCH.
           LABEL,TAPE10,NT,F=S,D=PE,PO=R,LB=KU,VSN=INEXCH.
           EXCH.
           COMMENT. ENTER THREE LINES: INTA=10, OUTA=15, COPY=N-N.
0
           8.6.2.  Job Control Statements for SCOPE
0
           Assume the exchange program is stored in cycle 1 of the file EXCH,
           and that a 7 track 800 BPI exchange tape known as INEXCH  on  file
           10 is to be copied to a 9 track 1600 BPI PE exchange tape known as
           OUEXCH on file 11.  The control statements shown below  illustrate
           a possible specification.
0.
 .
                                          8-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          ATTACH,EXCH,EXCH,CY=1.
           FILE,TAPE10,RT=U,BT=K.
           REQUEST,TAPE10,HY,VSN=INEXCH. RING OUT.
           FILE,TAPE11,RT=U,BT=K.
           REQUEST,TAPE11,PE,VSN=OUEXCH. RING IN.
           EXCH.
           COMMENT.  REPLACE THIS WITH 7-8-9.
           INTAPE=10
           OUTAPE=11
           DATE=(YYMMDD)
           COPY=N-N
           QUIT
           COMMENT.  REPLACE THIS WITH 7-8-9.
           COMMENT.  REPLACE THIS WITH 6-7-8-9.
           COMMENT.  REPLACE THIS WITH 6-7-8-9.
0
           8.6.3.  Program Statement
0
           The  simple and comprehensive exchange programs have the same main
           program unit.  The PROGRAM statement in this program unit is shown
           below.
0              PROGRAM EXCHMN (INPUT=/180,OUTPUT=/180,TAPE5=INPUT,
              1                TAPE6=OUTPUT,INTAPE,OUTAPE,TAPE7,
              2                TAPE10=/180,TAPE11=/180,TAPE12=/180,
              3                TAPE13=/180,TAPE14=/180,TAPE15=/180)
0          Thus  the  files  INPUT,  OUTPUT,  TAPE10,  ..., TAPE15 can handle
           individual records with at most 180 6 bit characters.
0
           8.6.4.  Input/Output Interface
0
           Exchange tapes and exchange format disk files are read and written
           using  Fortran BUFFER IN and BUFFER OUT statements.  Native format
           files are read and written using Fortran formatted read and  write
           statements.   End of file marks are detected in input files;  QUIT
           commands and '--' sentinels are  optional  at  the  end  of  input
           files.
0
0
0
 .
 .
                                          8-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          8.7.  Contents of the Simple Program
0
           The  simple exchange program for the CDC 6000/7000 consists of the
           machine sensitive main program unit; the simple exchange  program,
           identified  on  the distribution tape as EXCHSP; the ASCII version
           of the BLOCK DATA subprogram EXCHBX; machine sensitive versions of
           EXCHUN  and  EXCHRT;   portable versions of EXCHAH and EXCHFO; and
           the machine insensitive modules EXCHGB, EXCHGR and EXCHRH.
0
           8.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the CDC 6000/7000  consists
           of  the  machine  sensitive  main  program;  the  ASCII version of
           EXCHBD;  machine  sensitive  versions  of  EXCH,  EXCHUN,  EXCHPA,
           EXCHRT,  EXCHWT,  EXCHIM  and EXCHOU; portable versions of EXCHAH,
           EXCHFO,  EXCHSL,  EXCHTR,  EXCHCX  and  EXCHCG;  and  the  machine
           insensitive   modules  EXCHGB,  EXCHGR,  EXCHNP,  EXCHPB,  EXCHPR,
           EXCHSC, EXCHTP, EXCHTW, EXCHC1, EXCHC2,  EXCHC3,  EXCHRH,  EXCHWH,
           EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7, EXCHC8 and EXCHC9.
0
           8.9.  Error Messages
0
           The CDC 6000/7000 versions of the exchange  programs  produce  the
           self explanatory error messages
0           EOF ENCOUNTERED ON INPUT TAPE
            PARITY ERROR ENCOUNTERED ON INPUT TAPE
            EOF ENCOUNTERED ON EXCHANGE OUTPUT TAPE
            PARITY ERROR ENCOUNTERED ON EXCHANGE OUTPUT TAPE
0          These messages are always followed by the messages
0           ERROR n WHILE TRYING TO READ INTAPE.
0          or
0           ERROR n WHILE TRYING TO WRITE OUTAPE.
0          The latter messages are described in section 3.6.5 of [2].
0
0
 .
 .
                                          8-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          9.  DEC PDP-10 using TOPS 10
0
0
           9.1.  System Dependent Information from Commands
0
           The  DEC PDP-10 version of the comprehensive exchange program uses
           the system dependent information from READER, INPUT FILE,  INCLUDE
           FILE,  OUTPUT  FILE,  TEXT,  INTAPE  and  OUTAPE commands for file
           names.  If no file name is specified on an instance of one of  the
           first five commands above, the system default name of FORxx.DAT is
           used, where xx is the Fortran logical unit number.   Logical  unit
           numbers  greater than or equal to 20 default to disk (DSK:) files.
           The user should consult the Fortran manual for the default devices
           (e.g.  printer,  TTY,  disk,  tape)  associated  with each Fortran
           logical unit number.  The user may  override  the  default  device
           association by using the DEFINE command at the monitor level.
0          If  no file name is specified on the INTAPE command, it is assumed
           that one wishes to access a tape, and a  logical  device  name  of
           'MTIN'  is  used.   Similarly, if no file name is specified on the
           OUTAPE command, it is assumed that one wishes to  access  a  tape,
           and  a  logical  device  name  of  'MTOUT' is used.  The file name
           provided (or implied) on the INTAPE or OUTAPE command must be  the
           same as the logical device name provided on the MOUNT command used
           to request TOPS 10 to assign the tape.  Since  the  tape  exchange
           system  assumes  that  INTAPE  and  OUTAPE  are  assigned  to tape
           devices, the user must redefine the logical device names  (at  the
           monitor level) if the file associated with either INTAPE or OUTAPE
           is not tape.  If, for example, the  file  associated  with  INTAPE
           were  on disk, one must DEFINE MTIN: DSK: before invoking the tape
           exchange program.
0          If more than 10 characters are provided for a file  name  only  10
           are used.
0
           9.2.  Default Values for File Unit Numbers
0
           The  default  value  for  the  READER file is unit 5.  The default
           value for the PRINTER file is unit 5.  The default value  for  the
           Work file is unit 1.
0
0.
 .
                                          9-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          9.3.  Information Provided by the Environment
0
           The  DATE  is  provided  by the system dependent environment.  The
           SITE may be provided.  Consult site dependent documentation.
0
           9.4.  Interpretation of Option Letters
0
           The DEC PDP-10 version of the comprehensive  exchange  program  is
           not affected by any option letters other than those interpreted by
           the portable parts of the program.
0
           9.5.  Special Commands
0
           The DEC PDP-10  version  of  the  comprehensive  exchange  program
           interprets  one  command  in  addition to those interpreted by the
           portable parts of the program.  The TABS command specifies whether
           tab  characters (ASCII HT) appearing in text read from the sources
           specified by  the  READER,  INPUT  FILE,  INCLUDE  FILE,  or  TEXT
           commands  are  data  characters or horizontal tabulation requests.
           The parameter is a single letter.  If the letter is Y the ASCII HT
           character  is  a  data character.  If the letter is N the ASCII HT
           character is a  horizontal  tabulation  request.   In  the  latter
           circumstance  ASCII  HT  characters are converted to the number of
           blanks required so that the next character is stored in a position
           that  is  the  smallest multiple of 8 that is larger than the last
           position used for  input  text.   The  initial  condition  of  the
           program  is  to  interpret ASCII HT characters as data characters.
           Other values of the first character  of  the  parameter  cause  an
           error  message.   Only  the  first  character  of the parameter is
           examined.
0
           9.6.  Interface to TOPS-10
0
0
           9.6.1.  Job Control Statements for TOPS-10
0
           The exchange program cannot skip files.   Suppose  one  wishes  to
           copy an exchange file from the second file of a tape.  PIP must be
           used  to  position  the  exchange  tape.   The  JCL  shown   below
 .
 .
                                          9-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          illustrates  a  possible specification.  (The TOPS 20 form of some
           commands is slightly different).
0           .MOUNT MTA1: TPIN/REELID:INTAPE/WLOCK
            .MOUNT MTA2: TPOUT/REELID:OUTAPE/WENABLE
            .R PIP
            TPIN:(M#2A)=
            ^C
            .RU EXCHNG
            SITE=...
            INTAPE=17 TPIN
            OUTAPE=18 TPOUT
            OUTPUT FILE=21 PROGS.FOR
            COPY=2-76
            QUIT
            .PRINT PROGS.FOR
0
           9.6.2.  Input/Output Interface
0
           Exchange tapes and exchange format disk files are read and written
           using assembly language subroutines.  Native format files are read
           and written using Fortran formatted  read  and  write  statements.
           Since   FOROTS  reserves  most  unit  numbers  less  than  20  for
           attachment to specific devices,  native  format  files  should  be
           accessed  using  unit  numbers of 20 or greater.  The maximum unit
           number is a site dependent parameter.
0          The output file and the include file in the  simple  program,  and
           the  work  file in the comprehensive program, are opened using the
           file name 'EXCHnn.TMP', where 'nn' is the unit number.
0          End of file marks are detected in input files; QUIT  commands  and
           '--' sentinels are optional at the end of input files.
0
           9.6.3.  An Error in the Fortran Library
0
           There  is  an  error  in  the  Fortran  library  service of rewind
           statements at some sites.  The rewind  statement  apparently  uses
           the correspondences
0                                     16 = MTA000:
                                      17 = MTA001:
                                      18 = MTA002:
0.
 .
                                          9-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          instead  of  associating  the Fortran unit number with a device by
           using a logical device association.  One may  need  to  specify  a
           logical  unit  number  on  the  INTAPE command that depends on the
           device where the input exchange tape is mounted.   Otherwise,  the
           wrong tape could be rewound, or a FOROTS error produced.
0
           9.7.  Contents of the Simple Program
0
           The  simple  exchange  program  for the DEC PDP-10 consists of the
           machine sensitive main program unit; the simple exchange  program,
           identified  on  the distribution tape as EXCHSP; the ASCII version
           of the BLOCK DATA subprogram EXCHBX; machine sensitive versions of
           EXCHFO,  EXCHRT  and  EXCHUN;  the portable version of EXCHAH; the
           machine specific  modules  TAPOPN,  BYTMNP  and  TAPCHN;  and  the
           machine insensitive modules EXCHGB, EXCHGR and EXCHRH.
0
           9.8.  Contents of the Comprehensive Program
0
           The  comprehensive exchange program for the DEC PDP-10 consists of
           the machine sensitive main program  unit;  the  ASCII  version  of
           EXCHBD;  machine  sensitive  versions  of  EXCH,  EXCHFO,  EXCHIM,
           EXCHOU,  EXCHPA,  EXCHRT,  EXCHUN,  EXCHWT  and  EXCHCX;   machine
           specific  modules  TAPOPN, BYTMNP and TAPCHN; portable versions of
           EXCHAH, EXCHSL, EXCHTR and EXCHCG;  and  the  machine  insensitive
           modules  EXCHGB,  EXCHGR,  EXCHNP, EXCHPB, EXCHPR, EXCHSC, EXCHTP,
           EXCHTW, EXCHC1, EXCHC2, EXCHC3, EXCHRH,  EXCHWH,  EXCHC4,  EXCHLX,
           EXCHC5, EXCHC6, EXCHC7, EXCHC8 and EXCHC9.
0
           9.9.  Error Messages
0
           ?CHNCHK:CAN'T MATCH CHANNEL TO DEVICE
             Is produced if FOROTS used a different channel for exchange tape
             input or output than the channel expected to be used.
0          ?CHNFND:NO CHANNEL AVAILABLE
             Is produced when an input or  output  exchange  tape  is  to  be
             opened and no input/output channel is available.
0          ?EXCHRT:CAN'T CLOSE INTAPE,ERROR= iiiiii jjjjj
           ?EXCHWT:CAN'T CLOSE OUTAPE,ERROR= iiiiii jjjjj
           ?EXCHWT: CAN'T WRITE TAPE,ERROR = iiiiii jjjjj
           READ ERROR ON INTAPE = iiiiii jjjjj
 .
 .
                                          9-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            Are produced when errors are encountered  during  operations  on
             the  input  or  output  exchange  tapes.  The numbers iiiiii and
             jjjjj are produced by the system subroutine ERRSNS.
0          UNABLE TO OPEN INCLUDE FILE.
             Is produced only by the simple program.  The program stops after
             producing this message.
0          UNABLE TO OPEN nn FOR ...
             Is  produced  only  by  the  comprehensive program when a native
             format file cannot be opened.  The message has error severity 5.
             If  input  or output is attempted on the file, TOPS-10 will kill
             the program.
0          UNABLE TO OPEN WORKFILE.
             May be produced by either program.  If it  is  produced  by  the
             simple  program,  it  means the output file could not be opened.
             The programs stop after producing this message.
0          UNRECOGNIZED PARAMETER ON TABS COMMAND
             Is printed by the comprehensive program if the parameter on  the
             tabs  command  is neither N nor Y.  The interpretation of the HT
             character is not changed.
0
           9.10.  Informative Messages
0
           OPEN nn FOR   access   ON filename
             Is produced by  the  comprehensive  program  whenever  a  native
             format  file  is  opened.   'nn' is the unit number, 'access' is
             either 'SEQIN' or  'SEQOUT',  and  'filename'  is  the  filename
             specified by the command.
0
0
0
0
0
0
0
0.
 .
                                          9-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          10.  DEC PDP-11 using RSX-11M V3
0
0
           10.1.  System Dependent Information from Commands
0
           The DEC PDP-11 version of the comprehensive exchange program uses
           the system dependent information from READER, INPUT FILE, INCLUDE
           FILE, OUTPUT FILE and TEXT commands for file names.  If no file
           name is specified, a file name of all spaces is used.
0
           10.2.  Default Values for File Unit Numbers
0
           The default value for the READER file is unit 5.  The default
           value for the PRINTER file is unit 6.  The default value for the
           WORK file is unit 7.
0
           10.3.  Information Provided by the Environment
0
           The DATE is provided by the system dependent environment.  The
           SITE may be provided.  Consult site dependent documentation.
0
           10.4.  Interpretation of Option Letters
0
           The DEC PDP-11 version of the comprehensive exchange program is
           not affected by any option letters other than those interpreted by
           the portable parts of the program.
0
           10.5.  Special Commands
0
           The DEC PDP-11 version of the comprehensive exchange program
           interprets one command in addition to those interpreted by the
           portable parts of the program.  The TABS command specifies whether
           tab characters (ASCII HT) appearing in text read from the sources
           specified by the READER, INPUT FILE, INCLUDE FILE, or TEXT
           commands are data characters or horizontal tabulation requests.
           The parameter is a single letter.  If the letter is Y the ASCII HT
           character is a data character.  If the letter is N, the ASCII HT
 .
 .
                                          10-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          character is a horizontal tabulation request.  In the latter
           circumstance, ASCII HT characters are converted to the number of
           blanks required so that the next character is stored in a position
           that is the smallest multiple of 8 that is larger than the last
           position used for input text.  The initial condition of the
           program is to interpret ASCII HT characters as data characters.
           Other values of the first character of the parameter cause an
           error message.  Only the first character of the parameter is
           examined.
0
           10.6.  Interface to RSX-11M V3
0
0
           10.6.1.  Job Control Statements for RSX-11M V3
0
           The DEC PDP-11 RSX-11M version of the comprehensive exchange
           program knows about two exchange tape units.  It thinks the input
           exchange tape is MT0: and the output exchange tape is MT1:.  Thus,
           the user must direct these device names to the proper physical
           device before executing the program.
0          Suppose the input exchange tape is on physical tape unit 1, the
           output exchange tape is on physical tape unit 4, and the exchange
           program is known as $EXCH.  The MCR commands below illustrate a
           possible specification.
0          >ASN MT1:=MT0:
           >ASN MT4:=MT1:
           >RUN $EXCH
           ...  (exchange program commands)  ...
           >ASN =MT0:
           >ASN =MT1:
0          The last two commands cancel the  associations  of  exchange  tape
           logical units with physical units.
0
           10.6.2.  Input/Output Interface
0
           Exchange tapes and exchange format disk files are read and written
           using the WTQIO system subroutine [7].  Native  format  files  are
           read   and   written   using  Fortran  formatted  read  and  write
           statements.  The output file and the include file  in  the  simple
 .
 .
                                          10-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          program,  and  the  work  file  in  the comprehensive program, are
           opened using the file name 'EXCHnn.TMP', where 'nn'  is  the  unit
           number.   End  of  file  marks  are  detected in input files; QUIT
           commands and '--' sentinels are  optional  at  the  end  of  input
           files.
0
           10.7.  Contents of the Simple Program
0
           The  simple  exchange  program  for the DEC PDP-11 consists of the
           machine sensitive main program unit; the simple exchange  program,
           identified  on  the distribution tape as EXCHSP; machine sensitive
           versions of  EXCHAH,  EXCHFO  and  EXCHRT;  the  machine  specific
           modules  DOTAPE  and  ASMEXCH; and the machine insensitive modules
           EXCHGB, EXCHGR and EXCHRH.
0
           10.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the DEC PDP-11 consists  of
           the  machine  sensitive  main  program unit; the version of EXCHBD
           having no translate table; machine  sensitive  versions  of  EXCH,
           EXCHFO, EXCHAH, EXCHRT, EXCHWT, EXCHIM, EXCHOU and EXCHCX; machine
           specific modules DOTAPE and ASMEXCH; portable versions of  EXCHSL,
           EXCHTR  and  EXCHCG;  and  the machine insensitive modules EXCHGB,
           EXCHGR, EXCHNP, EXCHPB, EXCHPR, EXCHSC,  EXCHTP,  EXCHTW,  EXCHC1,
           EXCHC2,  EXCHC3,  EXCHRH,  EXCHWH, EXCHC4, EXCHLX, EXCHC5, EXCHC6,
           EXCHC7, EXCHC8 and EXCHC9.  RSX  TKB  commands  for  building  the
           comprehensive  program task and defining the overlay structure are
           contained  in  the  machine  specific   modules   TASK-BUILD   and
           OVLAY-STRU respectively.
0
           10.9.  Error Messages
0
           TAPE PROCESSOR ERROR mmmm FOR COMMAND nnnnnn
             May  be produced by the subroutine DOTAPE after a call to WTQIO.
             Consult [7] for a description of mmmm and nnnnnn.  This  message
             is  followed  by a message produced by the portable parts of the
             comprehensive exchange program, described in  section  3.6.5  of
             [2].
0          UNABLE TO OPEN INCLUDE FILE
             Is produced only by the simple program.  The program stops after
             producing this message.
 .
 .
                                          10-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          UNABLE TO OPEN UNIT nn FOR FILE ...
             Is produced only by the  comprehensive  program  when  a  native
             format file cannot be opened.  The message has error severity 5.
             If input or output is attempted on the file, RSX will  kill  the
             program.
0          UNABLE TO OPEN WORK FILE
             May  be  produced  by  either program.  If it is produced by the
             simple program, it means the output file could  not  be  opened.
             The programs stop after producing this message.
0          UNRECOGNIZED PARAMETER ON TABS COMMAND
             Is  printed by the comprehensive program if the parameter on the
             tabs command is neither N nor Y.  The interpretation of  the  HT
             character is not changed.
0
           10.10.  Informative Messages
0
           EXCHANGE PROGRAM
           DEFAULT DATE IS yy-mm-dd
             Is printed by the comprehensive  program  when  initiated.   The
             date  is fetched from RSX.  If you want to use a different date,
             use the DATE command, described in section 3.4.1 of [2].
0          The messages
           OPEN UNIT nn FOR INPUT FROM ...
           OPEN UNIT nn FOR OUTPUT TO ...
             Are produced by the comprehensive program  whenever  a  file  is
             opened.
0
0
0
0
0
0
0
0
0.
 .
                                          10-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          11.  DEC VAX-11 using VMS
0
0
           11.1.  System Dependent Information from Commands
0
           The  DEC  VAX-11  using  VMS version of the comprehensive exchange
           program  uses  the  system  dependent  information  from   READER,
           PRINTER,  INPUT  FILE, INCLUDE FILE, OUTPUT FILE, TEXT, INTAPE and
           OUTAPE commands for file names.  If no file name is specified, the
           following defaults are used.
0          Suppose NN (or NNN) denote the decimal digits of a unit number.
0            TES Command                          Default File Name
0            READER=NN   (NN .NE. 5)              EXCHNN.TMP;Version #
             PRINTER=NN  (NN .NE. 6)              EXCHNN.LIS;Version #
0            WORK FILE=NNN                        FORNNN.DAT;Version #
               (Default name is only possible name, and is deleted
               after the job is completed.)
             INCLUDE FILE=NN                      EXCHNN.TMP;Version #
             TEXT=NN                              EXCHNN.TMP;Version #
             INPUT FILE=NN                        EXCHNN.TMP;Version #
             OUTPUT FILE=NN                       EXCHNN.TMP;Version #
0            INTAPE=NN                            TEIONN.TES;Version #
             OUTAPE=NN                            TEIONN.TES;Version #
0          The  input,  output and include files in the simple version of the
           program are assigned to files named EXCHNN.TMP;Version #.
0
           11.2.  Default Values for File Unit Numbers
0
           The default value for the READER file  is  unit  5.   The  default
           value  for  the PRINTER file is unit 6.  The default value for the
           WORK file is unit 7.
0
0
0
 .
 .
                                          11-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          11.3.  Information Provided by the Environment
0
           The DATE is provided by the  system  dependent  environment.   The
           SITE may be provided.  Consult site dependent documentation.
0
           11.4.  Interpretation of Option Letters
0
           The  DEC  VAX-11  using  VMS version of the comprehensive exchange
           program is affected only by the selection  of  option  T  and  the
           option  selections  to which the portable parts of the program are
           sensitive.  If the T option is selected when an input file  is  to
           be opened, and the file is already open, it is not re-opened.
0
           11.5.  Special Commands
0
           The  DEC  VAX-11  using  VMS version of the comprehensive exchange
           program interprets one command in addition to those interpreted by
           the  portable  parts  of  the program.  The TABS command specifies
           whether tab characters (ASCII HT = 09) appearing in text read from
           the  sources specified by the READER, INPUT FILE, INCLUDE FILE, or
           TEXT  commands  are  data  characters  or  horizontal   tabulation
           requests.   The  parameter is a single letter.  If the letter is D
           or Y the ASCII HT character is a data character.  If the letter is
           T or N, the ASCII HT character is a horizontal tabulation request.
           In the latter circumstance, ASCII HT characters are  converted  to
           the number of blanks required so that the next character is stored
           in a position that is the smallest multiple of 8  that  is  larger
           than the last position used for input text.  The initial condition
           of the program  is  to  interpret  ASCII  HT  characters  as  data
           characters.   Other values of the first character of the parameter
           cause an error message.  Only the first character of the parameter
           is examined.
0
           11.6.  Interface to VMS
0
0
0
0
 .
 .
                                          11-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          11.6.1.  Job Control Statements for VMS
0
           Exchange format files can be read from magnetic tape or disk files
           by either the simple or comprehensive exchange programs.  Exchange
           format  files can be written on magnetic tape or disk files by the
           comprehensive program.  Four common uses of the exchange  programs
           are illustrated below.
0
           11.6.1.1.  Using the Simple Program
0
           $MOUNT/FOREIGN/NOWRITE/DENSITY=1600/BLOCK=3600 MT0: DL EXCHNN.TMP
0          The  reel  is  mounted on the tape drive before the MOUNT command,
           see [8], is executed.  The tape is write disabled.  The name  "DL"
           on  the MOUNT command is a dummy label.  This specification may be
           necessary on some systems and prohibited on others.  The number NN
           in  "EXCHNN.TMP" is the Fortran unit number for the input exchange
           tape file.
0
           11.6.1.2.  Copying an Exchange Format Tape to a Disk File
0
           $MOUNT/FOREIGN/NOWRITE/BLOCK=3600 MT0: DL TAPEIN
0          The reel is mounted on the tape drive before  the  MOUNT  command,
           see [8], is executed.  The tape is write-disabled.
0          $RUN TES
0          (The compiled and linked comprehensive program is in TES.EXE.)
0          *INTAPE=10 TAPEIN            (At most 40 characters in file name)
           *OUTAPE=11                   (Output to disk file TEIO11.TES;1)
           *COPY=N-N
           *QUIT
0          The asterisk before each command above is not part of the input to
           the comprehensive program;  it is a prompt character  supplied  by
           the comprehensive program.
0          The  name  "DL"  on  the  MOUNT  command  is  a dummy label.  This
           specification may be necessary on some systems and  prohibited  on
           others.  The name "TAPEIN" is the file name for the input exchange
           tape  file.   The  file  names  on  the  MOUNT  command  and   the
 .
 .
                                          11-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          comprehensive program INTAPE command must agree exactly.
0
           11.6.1.3.  Copying an Exchange Format Disk File to a Tape
0
           $MOUNT/FOREIGN/WRITE/DENSITY=1600/BLOCK=3600 MT0: DL TAPEOUT
0          The  reel  is  mounted on the tape drive before the MOUNT command,
           see [8], is executed.  The tape is write-enabled.
0          $RUN TES
0          (The compiled and linked comprehensive program is in TES.EXE.)
0          *INTAPE=11                   (From disk file TEIO11.TES;1)
           *OUTAPE=12 TAPEOUT
           *COPY=N-N
           *QUIT
0          As above, the asterisk shown here is a prompt  character  supplied
           by the comprehensive program, not part of the input.
0          The  name  "DL"  on  the  MOUNT  command  is  a dummy label.  This
           specification may be necessary on some systems and  prohibited  on
           others.   The  name  "TAPEOUT"  is  the  file  name for the output
           exchange file.  The file  names  on  the  MOUNT  command  and  the
           comprehensive program OUTAPE command must agree exactly.
0
           11.6.1.4.  Copying an Exchange Format Disk File to Another
0
           $RUN TES
           *INTAPE=11                   (Disk file is TEIO11.TES;1)
           *OUTAPE=13 NEWFILE.DAT;1     (Disk file is NEWFILE.DAT;1)
           *COPY=N-N
           *QUIT
0
           11.6.2.  Input/Output Interface
0
           Exchange format files are read from or written to magnetic tape or
           internal disk files using Fortran formatted write  statements  and
           "A" format.  The files are opened using variable record length and
           no carriage control.  Native format files  are  read  and  written
           using  Fortran formatted read and write statements and "A" format.
 .
 .
                                          11-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          End of file marks are detected in input files; QUIT  commands  and
           '--' sentinels are optional at the end of input files.
0
           11.7.  Contents of the Simple Program
0
           The  simple exchange program for the DEC VAX-11 using VMS consists
           of the machine sensitive main program unit;  the  simple  exchange
           program,  identified  on  the distribution tape as EXCHSP; machine
           sensitive versions of EXCHAH,  EXCHFO  (special  version  for  the
           simple  program)  and  EXCHRT; the machine specific module EXCHUN;
           and the machine insensitive modules EXCHGB, EXCHGR and EXCHRH.   A
           special  version  of EXCHFO is used for the simple program because
           of differences  between  the  simple  and  comprehensive  exchange
           programs  to  which  VMS fortran is sensitive but most systems are
           not.
0
           11.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the DEC  VAX-11  using  VMS
           consists  of  the machine sensitive main program unit; the version
           of EXCHBD having no translate table; machine sensitive versions of
           EXCH,  EXCHFO,  EXCHAH,  EXCHUN,  EXCHPA,  EXCHRT, EXCHWT, EXCHIM,
           EXCHOU and EXCHCX; portable versions of EXCHSL, EXCHTR and EXCHCG;
           and  the  machine  insensitive  modules  EXCHGB,  EXCHGR,  EXCHNP,
           EXCHPB, EXCHPR, EXCHSC, EXCHTP, EXCHTW,  EXCHC1,  EXCHC2,  EXCHC3,
           EXCHRH, EXCHWH, EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7, EXCHC8 and
           EXCHC9.
0
           11.9.  Error Messages
0
           Attempted open at end-of-file on INTAPE
             May be produced by either program when an exchange  format  file
             on  magnetic tape or disk cannot be opened because the device is
             positioned at the end-of-file signal.
0          End-of-file on close/rewind of INTAPE
             May be produced by either program,  but  probably  only  if  the
             operating system is confused.
0          Error condition occurred while closing OUTAPE, IOSTAT=ZZZZZZZZ
             May  be  produced  only by the comprehensive program if an error
             occurs while closing an output  exchange  format  tape  or  disk
 .
 .
                                          11-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            file.   ZZZZZZZZ is the I/O error status returned by the Fortran
             runtime library.  Consult [9] for a description of ZZZZZZZZ.
0          Error condition occurred while opening INTAPE, IOSTAT=ZZZZZZZZ
             May be produced by either  program  if  an  error  occurs  while
             opening an input exchange format tape or disk file.  ZZZZZZZZ is
             the I/O error status returned by the  Fortran  runtime  library.
             Consult [9] for a description of ZZZZZZZZ.
0          Error condition occurred while opening OUTAPE, IOSTAT=ZZZZZZ
             May  be  produced  only by the comprehensive program if an error
             occurs while opening an output  exchange  format  tape  or  disk
             file.   ZZZZZZZZ is the I/O error status returned by the Fortran
             runtime library.  Consult [9] for a description of ZZZZZZZZ.
0          Error condition occurred while reading INTAPE, IOSTAT=ZZZZZZZZ
             May be produced by either  program  if  an  error  occurs  while
             reading  from  an  input  exchange  format  tape  or  disk file.
             ZZZZZZZZ is the I/O error status returned by the Fortran runtime
             library.  Consult [9] for a description of ZZZZZZZZ.
0          Error condition occurred while writing OUTAPE, IOSTAT=ZZZZZZZZ
             May  be  produced  only by the comprehensive program if an error
             occurs while writing an output  exchange  format  tape  or  disk
             file.   ZZZZZZZZ is the I/O error status returned by the Fortran
             runtime library.  Consult [9] for a description of ZZZZZZZZ.
0          Error   condition   occurred   with   close/rewind   of    INTAPE,
             IOSTAT=ZZZZZZZZ
             May  be  produced  by  either  program  if an error occurs while
             rewinding an input exchange format tape or disk file.   ZZZZZZZZ
             is the I/O error status returned by the Fortran runtime library.
             Consult [9] for a description of ZZZZZZZZ.
0          UNABLE TO OPEN INCLUDE FILE
             Is produced only by the simple program.  The program stops after
             producing this message.
0          UNABLE TO OPEN UNIT nn FOR FILE ...
             Is  produced  only  by  the  comprehensive program when a native
             format file cannot be opened.  The message has error severity 5.
             If  input or output is attempted on the file, VMS will terminate
             the program.
0          UNABLE TO OPEN WORK FILE
             May be produced by either program.  If it  is  produced  by  the
             simple  program,  it  means the output file could not be opened.
             The programs stop after producing this message.
 .
 .
                                          11-6
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          Unexpected end-of-file on INTAPE.
             May be produced by either program if an  end-of-file  signal  is
             returned  when  reading  an  input  exchange format tape or disk
             file.  Since the exchange format defines an end-of-file  record,
             the  end of file signal provided by hardware should only be read
             before an exchange format label record.
0          UNRECOGNIZED PARAMETER ON TABS COMMAND
             Is printed by the comprehensive program if the parameter on  the
             tabs  command is not D, N, T or Y.  The interpretation of the HT
             character is not changed.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          11-7
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          12.  DEC VAX-11 using UNIX (TM)
0
0
           12.1.  System Dependent Information from Commands
0
           The DEC VAX-11  using  UNIX  (TM)  version  of  the  comprehensive
           exchange  program  uses  the  system  dependent  information  from
           READER, PRINTER, INPUT FILE,  INCLUDE  FILE,  OUTPUT  FILE,  TEXT,
           INTAPE  and  OUTAPE  commands  for file names.  If no file name is
           specified, the following defaults are used.
0          Suppose NN denote the decimal digits of a unit number.
0            TES Command                          Default File Name
0            READER=NN   (NN .NE. 5)              EXCHNN.TMP
             PRINTER=NN  (NN .NE. 6)              EXCHNN.LIS
0            WORK FILE=NN                         tmp.Fnnnnn
               (Default name is only possible name, and is deleted
               after the job is completed.  The number nnnnn in the
               generated file name depends on the process ID.)
             INCLUDE FILE=NN                      EXCHNN.TMP
             TEXT=NN                              EXCHNN.TMP
             INPUT FILE=NN                        EXCHNN.TMP
             OUTPUT FILE=NN                       EXCHNN.TMP
0            INTAPE=NN                            EXCHNN.TMP
             OUTAPE=NN                            EXCHNN.TMP
0          The  input,  output and include files in the simple version of the
           program are assigned to files named EXCHNN.TMP.
0
           12.2.  Default Values for File Unit Numbers
0
           The default value for the READER file  is  unit  5.   The  default
           value  for  the PRINTER file is unit 6.  The default value for the
           WORK file is unit 7.
0
0
0.
 .
                                          12-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          12.3.  Information Provided by the Environment
0
           The DATE is provided by the  system  dependent  environment.   The
           SITE  is  not  provided  by  the  distributed  version, but may be
           provided as a result of a local change.   Consult  site  dependent
           documentation.
0
           12.4.  Interpretation of Option Letters
0
           The  DEC  VAX-11  using  UNIX  (TM)  version  of the comprehensive
           exchange program is affected only by the selection of option T and
           the  option  selections to which the portable parts of the program
           are sensitive.  If the T option is selected when an input file  is
           to be opened, and the file is already open, it is not re-opened.
0
           12.5.  Special Commands
0
           The  DEC  VAX-11  using  UNIX  (TM)  version  of the comprehensive
           exchange program interprets  one  command  in  addition  to  those
           interpreted  by  the  portable  parts  of  the  program.  The TABS
           command specifies whether tab characters (ASCII HT = 09) appearing
           in text read from the sources specified by the READER, INPUT FILE,
           INCLUDE FILE, or TEXT commands are data characters  or  horizontal
           tabulation  requests.   The  parameter is a single letter.  If the
           letter is D or Y the ASCII HT character is a data  character.   If
           the  letter  is  T  or  N,  the ASCII HT character is a horizontal
           tabulation  request.   In  the  latter  circumstance,   ASCII   HT
           characters  are converted to the number of blanks required so that
           the next character is stored in a position that  is  the  smallest
           multiple of 8 that is larger than the last position used for input
           text.  The initial condition of the program is to interpret  ASCII
           HT  characters  as  data  characters.   Other  values of the first
           character of the parameter cause an error message.  Only the first
           character of the parameter is examined.
0
           12.6.  Interface to UNIX (TM)
0
0
0
 .
 .
                                          12-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          12.6.1.  Job Control Statements for UNIX (TM)
0
           Exchange format files can be read from magnetic tape or disk files
           by either the simple or comprehensive exchange programs.  Exchange
           format  files can be written on magnetic tape or disk files by the
           comprehensive program.  When using the comprehensive program,  TES
           format  tapes  may  be read and written directly by specifying the
           path name of the tape drive on which the reel is  mounted  in  the
           INTAPE  or  OUTAPE command as appropriate.  For example, if a tape
           reel on which a TES format file is to be written has been  mounted
           on  a  tape drive for which the path name is "/dev/nrmt1" then the
           tape file may be  written  directly  from  the  comprehensive  TES
           program by specifying
0          OUTAPE=NN /dev/nrmt1
0          where  NN  is  the  desired  Fortran  unit number.  When using the
           simple TES program, and in many cases when using the comprehensive
           TES  program, one may desire to copy TES format tape files to disk
           before use, and from disk to tape after use.  Four common uses  of
           the exchange programs are illustrated below.
0
           12.6.1.1.  Copying an Exchange Format Tape to a Disk File
0
           The reel is mounted on the tape drive, and the contents are copied
           to disk by
0           dd if=/dev/nrmt1 ibs=3600 of=temp.disk.file
0          where "/dev/nrmt1" is the path name of the tape drive on which the
           reel  is mounted, and "temp.disk.file" is the disk file into which
           the contents of the tape are to be copied.  The  TES  format  disk
           file may then be accessed in the comprehensive TES program by
0          INTAPE=NN temp.disk.file
0          where  NN  is  the desired Fortran unit number, and temp.disk.file
           contains the contents copied from a TES format tape.
0
           12.6.1.2.  Using the Simple Program
0
           For simplest usage, the TES format tape file should be copied to a
           disk  file,  as  described in the previous section.  The disk file
 .
 .
                                          12-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          name denoted above  by  "temp.disk.file"  should  be  "EXCHNN.TMP"
           where  NN  is the Fortran unit number to be used for the input TES
           format file when the simple program is executed.
0
           12.6.1.3.  Copying an Exchange Format Disk File to a Tape
0
           The reel is mounted on the tape drive, and the contents of  a  TES
           format disk file may be copied to the tape reel by
0           d2tap
            temp.disk.file
            /dev/nrmt1
0          where  "temp.disk.file" is the name of a disk file created by TES,
           and "/dev/nrmt1" is the path name of the tape drive on  which  the
           reel  is  mounted.   The  path  name  of  the  tape  drive is site
           dependent.   The  program  "d2tap"  is  provided  with   the   TES
           distribution.
0
           12.6.1.4.  Copying an Exchange Format Disk File to Another
0
           TES
           *INTAPE=11                   (Disk file is EXCH11.TMP)
           *OUTAPE=13 NEWFILE.DAT       (Disk file is NEWFILE.DAT)
           *COPY=N-N
           *QUIT
0          The asterisks in the example above are not input;  they are prompt
           characters provided by TES.
0
           12.6.2.  Input/Output Interface
0
           Exchange format files are read from or written to magnetic tape or
           internal  disk  files  using  special subprograms written in the C
           programming language.  Native format files are  read  and  written
           using  Fortran formatted read and write statements and "A" format.
           End of file is detected in input files;  QUIT  commands  and  '--'
           sentinels are optional at the end of input files.
0
0
 .
 .
                                          12-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          12.7.  Contents of the Simple Program
0
           The  simple  exchange  program  for the DEC VAX-11 using UNIX (TM)
           consists of the machine sensitive main program  unit;  the  simple
           exchange  program,  identified on the distribution tape as EXCHSP;
           machine sensitive versions of EXCHAH, EXCHFO (special version  for
           the  simple  program)  and  EXCHRT;  the  machine specific modules
           EXCHUN and TAPEIO (The latter  written  in  C);  and  the  machine
           insensitive  modules EXCHGB, EXCHGR and EXCHRH.  A special version
           of EXCHFO is used for the simple program  because  of  differences
           between  the  simple  and comprehensive exchange programs to which
           UNIX (TM) fortran is sensitive but most systems are not.
0
           12.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the DEC VAX-11  using  UNIX
           (TM)  consists  of  the  machine  sensitive main program unit; the
           version of EXCHBD having no  translate  table;  machine  sensitive
           versions  of EXCH, EXCHFO, EXCHAH, EXCHUN, EXCHPA, EXCHRT, EXCHWT,
           EXCHIM, EXCHOU, EXCHCX, TAPEIO and IDATE (the last two are written
           in  C);  portable  versions  of EXCHSL, EXCHTR and EXCHCG; and the
           machine  insensitive  modules  EXCHGB,  EXCHGR,  EXCHNP,   EXCHPB,
           EXCHPR,  EXCHSC,  EXCHTP,  EXCHTW, EXCHC1, EXCHC2, EXCHC3, EXCHRH,
           EXCHWH, EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7, EXCHC8 and EXCHC9.
0
           12.9.  Error Messages
0
           Error  messages  produced  by  the UNIX (TM) version of TES do not
           contain any code numbers, and are all self explanatory.
0
0
0
0
0
0
0
 .
 .
                                          12-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          13.  Data General MV/8000 using AOS/VS
0
0
           13.1.  System Dependent Information from Commands
0
           The Data General MV/8000 using AOS/VS version of the comprehensive
           exchange  program  uses  the  system  dependent  information  from
           READER,  PRINTER,  INPUT  FILE,  INCLUDE  FILE, OUTPUT FILE, TEXT,
           INTAPE and OUTAPE commands for file names.  If  no  file  name  is
           specified, the following defaults are used.
0          Suppose NN (or NNN) denote the decimal digits of a unit number.
0            TES Command                          Default File Name
0            READER=NN   (NN .NE. 5)              TESPNN.LS
             PRINTER=NN  (NN .NE. 6)              EXCHNN.TMP
0            WORK FILE=NNN                        ?PID.F77.SCRATCH.NNN.TMP
               (Default name is only possible name, and is deleted
               after the job is completed.)
             INCLUDE FILE=NN                      EXCHNN.TMP
             TEXT=NN                              EXCHNN.TMP
             INPUT FILE=NN                        EXCHNN.TMP
             OUTPUT FILE=NN                       EXCHNN.TMP
0            INTAPE=NN                            TEIONN.TES
             OUTAPE=NN                            TEIONN.TES
0          The  input,  output and include files in the simple version of the
           program are assigned to files named EXCHNN.TMP.
0
           13.2.  Default Values for File Unit Numbers
0
           The default value  for  the  READER  file  is  unit  5,  device  =
           @CONSOLE.   The  default  value  for  the  PRINTER file is unit 6,
           device = @CONSOLE.  The default value for the WORK file is unit 7.
0
0
0
 .
 .
                                          13-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          13.3.  Information Provided by the Environment
0
           The DATE is provided by the  system  dependent  environment.   The
           SITE may be provided.  Consult site dependent documentation.
0
           13.4.  Interpretation of Option Letters
0
           The Data General MV/8000 using AOS/VS version of the comprehensive
           exchange program is affected only by the selection of option T and
           the  option  selections to which the portable parts of the program
           are sensitive.  If the T option is selected when an input file  is
           to be opened, and the file is already open, it is not re-opened.
0
           13.5.  Special Commands
0
           The Data General MV/8000 using AOS/VS version of the comprehensive
           exchange program interprets  one  command  in  addition  to  those
           interpreted  by  the  portable  parts  of  the  program.  The TABS
           command specifies whether tab characters (ASCII HT = 09) appearing
           in text read from the sources specified by the READER, INPUT FILE,
           INCLUDE FILE, or TEXT commands are data characters  or  horizontal
           tabulation  requests.   The  parameter is a single letter.  If the
           letter is D or Y the ASCII HT character is a data  character.   If
           the  letter  is  T  or  N,  the ASCII HT character is a horizontal
           tabulation  request.   In  the  latter  circumstance,   ASCII   HT
           characters  are converted to the number of blanks required so that
           the next character is stored in a position that  is  the  smallest
           multiple of 8 that is larger than the last position used for input
           text.  The initial condition of the program is to interpret  ASCII
           HT  characters  as  data  characters.   Other  values of the first
           character of the parameter cause an error message.  Only the first
           character of the parameter is examined.
0
           13.6.  Interface to AOS/VS
0
0
0
0
 .
 .
                                          13-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          13.6.1.  Job Control Statements for AOS/VS
0
           Exchange format files can be read from magnetic tape or disk files
           by either the simple or comprehensive exchange programs.  Exchange
           format  files can be written on magnetic tape or disk files by the
           comprehensive program.  Four common uses of the exchange  programs
           are illustrated below.
0
           13.6.1.1.  Using the Simple Program
0
           The  reel  is  mounted on the tape drive before the X TES command,
           see [10], is executed.  The tape is write disabled if the reel has
           no ring.
0
           13.6.1.2.  Copying an Exchange Format Tape to a Disk File
0
           The  reel  is  mounted on the tape drive before the X TES command,
           see [10], is executed.  The tape is write disabled if the reel has
           no ring.
0          )X TES
0          (The compiled and linked comprehensive program is in TES.PR.)
0          *INTAPE=10 @MTD0:0           (At most 40 characters in file name)
           *OUTAPE=11                   (Output to disk file TEIO11.TES)
           *COPY=N-N
           *QUIT
0          The asterisk before each command above is not part of the input to
           the comprehensive program;  it is a prompt character  supplied  by
           the comprehensive program.
0
           13.6.1.3.  Copying an Exchange Format Disk File to a Tape
0
           The  reel  is  mounted on the tape drive before the X TES command,
           see [10], is executed.  The tape is write-enabled.
0          )X TES
0          (The compiled and linked comprehensive program is in TES.PR.)
 .
 .
                                          13-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          *INTAPE=11                   (From disk file TEIO11.TES)
           *OUTAPE=12 @MTD0:0
           *COPY=N-N
           *QUIT
0          As above, the asterisk shown here is a prompt  character  supplied
           by the comprehensive program, not part of the input.
0
           13.6.1.4.  Copying an Exchange Format Disk File to Another
0
           )X TES
           *INTAPE=11                   (Disk file is TEIO11.TES)
           *OUTAPE=13 NEWFILE.DAT       (Disk file is NEWFILE.DAT)
           *COPY=N-N
           *QUIT
0
           13.6.2.  Input/Output Interface
0
           Exchange format files are read from or written to magnetic tape or
           internal disk files using Fortran formatted write  statements  and
           "A" format.  The files are opened using variable record length and
           no carriage control.  Native format files  are  read  and  written
           using  Fortran formatted read and write statements and "A" format.
           End of file marks are detected in input files; QUIT  commands  and
           '--' sentinels are optional at the end of input files.
0
           13.7.  Contents of the Simple Program
0
           The  simple  exchange  program  for the Data General MV/8000 using
           AOS/VS consists the  machine  sensitive  main  program  unit;  the
           simple  exchange  program,  identified on the distribution tape as
           EXCHSP; machine sensitive  versions  of  EXCHAH,  EXCHFO  (special
           version  for  the simple program) and EXCHRT; the machine specific
           module EXCHUN; and the machine insensitive modules EXCHGB,  EXCHGR
           and  EXCHRH.   A  special version of EXCHFO is used for the simple
           program  because   of   differences   between   the   simple   and
           comprehensive   exchange  programs  to  which  AOS/VS  fortran  is
           sensitive but most systems are not.
0
0
 .
 .
                                          13-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          13.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the  Data  General  MV/8000
           using  AOS/VS consists of the machine sensitive main program unit;
           the version of EXCHBD having no translate table; machine sensitive
           versions  of EXCH, EXCHFO, EXCHAH, EXCHUN, EXCHPA, EXCHRT, EXCHWT,
           EXCHIM, EXCHOU and EXCHCX; portable versions of EXCHSL, EXCHTR and
           EXCHCG;  and  the  machine  insensitive  modules  EXCHGB,  EXCHGR,
           EXCHNP, EXCHPB, EXCHPR, EXCHSC, EXCHTP,  EXCHTW,  EXCHC1,  EXCHC2,
           EXCHC3,  EXCHRH,  EXCHWH,  EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7,
           EXCHC8  and  EXCHC9.   The  subprogram  EXCH  calls   the   system
           subprogram DATE from the common runtime library.
0
           13.9.  Error Messages
0
           Attempted open at end-of-file on INTAPE
             May  be  produced by either program when an exchange format file
             on magnetic tape or disk cannot be opened because the device  is
             positioned at the end-of-file signal.
0          End-of-file on close/rewind of INTAPE
             May  be  produced  by  either  program, but probably only if the
             operating system is confused.
0          Error condition occurred while closing OUTAPE, IOSTAT=ZZZZZZZZ
             May be produced only by the comprehensive program  if  an  error
             occurs  while  closing  an  output  exchange format tape or disk
             file.  ZZZZZZZZ is the I/O error status returned by the  Fortran
             runtime  library.   Consult  a list of Fortran runtime or AOS/VS
             System errors for a description of  ZZZZZZZZ.   One  can  access
             this list on-line by
0              )MESSAGE ZZZZZZZZ
0            The system tries to tell you what went wrong.
0          Error condition occurred while opening INTAPE, IOSTAT=ZZZZZZZZ
             May  be  produced  by  either  program  if an error occurs while
             opening an input exchange format tape or disk file.  ZZZZZZZZ is
             the  I/O  error  status returned by the Fortran runtime library.
             The meaning of ZZZZZZZZ may be discovered as described above.
0          Error condition occurred while opening OUTAPE, IOSTAT=ZZZZZZ
             May be produced only by the comprehensive program  if  an  error
             occurs  while  opening  an  output  exchange format tape or disk
 .
 .
                                          13-5
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            file.  ZZZZZZZZ is the I/O error status returned by the  Fortran
             runtime  library.   The meaning of ZZZZZZZZ may be discovered as
             described above.
0          Error condition occurred while reading INTAPE, IOSTAT=ZZZZZZZZ
             May be produced by either  program  if  an  error  occurs  while
             reading  from  an  input  exchange  format  tape  or  disk file.
             ZZZZZZZZ is the I/O error status returned by the Fortran runtime
             library.  The meaning of ZZZZZZZZ may be discovered as described
             above.
0          Error condition occurred while writing OUTAPE, IOSTAT=ZZZZZZZZ
             May be produced only by the comprehensive program  if  an  error
             occurs  while  writing  an  output  exchange format tape or disk
             file.  ZZZZZZZZ is the I/O error status returned by the  Fortran
             runtime  library.   The meaning of ZZZZZZZZ may be discovered as
             described above.
0          Error   condition   occurred   with   close/rewind   of    INTAPE,
             IOSTAT=ZZZZZZZZ
             May  be  produced  by  either  program  if an error occurs while
             rewinding an input exchange format tape or disk file.   ZZZZZZZZ
             is the I/O error status returned by the Fortran runtime library.
             The meaning of ZZZZZZZZ may be discovered as described above.
0          UNABLE TO OPEN INCLUDE FILE
             Is produced only by the simple program.  The program stops after
             producing this message.
0          UNABLE TO OPEN UNIT nn FOR FILE ...
             Is  produced  only  by  the  comprehensive program when a native
             format file cannot be opened.  The message has error severity 5.
             If  input  or  output  is  attempted  on  the  file, AOS/VS will
             terminate the program.
0          UNABLE TO OPEN WORK FILE
             May be produced by either program.  If it  is  produced  by  the
             simple  program,  it  means the output file could not be opened.
             The programs stop after producing this message.
0          Unexpected end-of-file on INTAPE.
             May be produced by either program if an  end-of-file  signal  is
             returned  when  reading  an  input  exchange format tape or disk
             file.  Since the exchange format defines an end-of-file  record,
             the  end of file signal provided by hardware should only be read
             before an exchange format label record.
0          UNRECOGNIZED PARAMETER ON TABS COMMAND
 .
 .
                                          13-6
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0            Is printed by the comprehensive program if the parameter on  the
             tabs  command is not D, N, T or Y.  The interpretation of the HT
             character is not changed.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          13-7
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          14.  Sperry Univac (ex Varian) V-70 using VORTEX
0
0
           14.1.  System Dependent Information from Commands
0
           The Sperry Univac  V-70  version  of  the  comprehensive  exchange
           program uses system dependent information from READER, INPUT FILE,
           TEXT INCLUDE FILE, OUTPUT FILE, INTAPE  and  OUTAPE  commands  for
           file  names, when the device designated by the Fortran unit number
           is a disk partition.  A file name should not be specified  if  the
           device  is  tape.   If  the  device  is  disk  and no file name is
           provided the file name used depends on the unit  number.   If  the
           unit  number is less than 11, a file name is fetched from a system
           FCB.  If the unit number is greater than 10, a default  file  name
           is used.  The first 4 characters are EXCH; the last two characters
           are blanks if the command is an INTAPE  or  OUTAPE  command;   the
           last  two  characters  are  'IN' if the command is a READER, INPUT
           FILE, TEXT or INCLUDE FILE command; the last  two  characters  are
           'OU' if the command is an OUTPUT FILE command.
0
           14.2.  Default Values for File Unit Numbers
0
           The default value for the READER file is unit 2 (SI).  The default
           value for the PRINTER file is unit 5 (LO).  The default value  for
           the  WORK  file  is  unit  8  (SS).   Note that in standard VORTEX
           systems, SS and PO (10) refer to the same disk partition.  If COPY
           commands  of  the second form are to be used or if control records
           are to be changed, either the WORK file and the OUTPUT file should
           not be assigned to SS and PO respectively, or one of SS or PO must
           be assigned to a different partition.  The WORK file is not opened
           by  the  program;  if  it  is to be used for the reasons described
           above it must first be opened with a /PFILE command,  or  assigned
           to tape.
0
           14.3.  Information Provided by the Environment
0
           The DATE is not provided by the system dependent environment.  The
           SITE may be provided.  Consult site dependent documentation.
0
0.
 .
                                          14-1
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          14.4.  Interpretation of Option Letters
0
           The Sperry Univac  V-70  version  of  the  comprehensive  exchange
           program  is  not  affected  by any option letters other than those
           interpreted by the portable parts of the program.
0
           14.5.  Special Commands
0
           The Sperry Univac  V-70  version  of  the  comprehensive  exchange
           program   does   not  interpret  any  commands  other  than  those
           interpreted by the portable parts of the program.
0
           14.6.  Interface to VORTEX
0
0
           14.6.1.  Job Control Language Statements for VORTEX
0
           Suppose the exchange program is in BL as EXCH, an exchange tape is
           on the tape device MT0,  blocked  native  format  text  is  to  be
           written  in  the file PO on the system partition PO (configured as
           LUN 10), and an exchange format file is to be written in the  file
           XCH1 on the disk partition denoted by LUN 21.  The file must first
           be created by FMAIN.  Suppose it is known that the  exchange  tape
           has  53  blocks.   The  Job  Control Statements below illustrate a
           possible specification.
0          /ASSIGN,20,MT0
           /FMAIN
           DELETE,21,,XCH1
           CREATE,21,,XCH1,1800,55 .   LEAVE A LITTLE EXTRA SPACE
           /PFILE,PO,,PO
           /LOAD,EXCH
           INTAPE=20
           OUTAPE=21 XCH1
           OUTPUT FILE=10
0
0
0
 .
 .
                                          14-2
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          14.6.2.  Input/Output Interface
0
           Input and Output for exchange tapes and exchange format disk files
           are performed by assembly language (DASMR) subprograms.  Input and
           output  for native format files are performed by Fortran formatted
           read and write statements.  End of  file  marks  are  detected  in
           input files;  QUIT commands and '--' sentinels are optional at the
           end of input files.
0
           14.6.3.  Restrictions
0
           The current  Sperry  Univac  V-70  version  of  the  comprehensive
           exchange  program assumes all text images input from native format
           files are 80 characters long.  Native format input may be  blocked
           or  unblocked.   If  the input is blocked the 'B' modifier must be
           selected on the READER, INPUT FILE, TEXT or INCLUDE file  command.
           In  any  case,  the  input is assumed to be 80 characters.  Native
           format output to disk files will be blocked, and the image will be
           expanded  to  80  characters  with  blanks,  or  truncated  to  80
           characters.  Native format output to tape will be  unblocked,  and
           the record length will be variable.
0
           14.7.  Contents of the Simple Program
0
           The  simple  exchange  program for the Sperry V-70 consists of the
           machine  sensitive  main  program  unit;   the   simple   program,
           identified  on  the distribution tape as EXCHSP; machine sensitive
           versions  of  EXCHAH  and  EXCHRT;  the  machine  specific  module
           ASMEXCH;   the   portable  version  of  EXCHFO;  and  the  machine
           insensitive modules EXCHGB, EXCHGR and EXCHRH.
0
           14.8.  Contents of the Comprehensive Program
0
           The comprehensive exchange program for the Sperry V-70 consists of
           the  machine  sensitive main program; the version of EXCHBD having
           no translate table; machine sensitive versions  of  EXCH,  EXCHAH,
           EXCHTR,   EXCHRT,  EXCHWT,  EXCHIM,  EXCHOU  and  EXCHCX;  machine
           specific modules  ASMEXCH  and  OVLAY;  the  portable  version  of
           EXCHCG;  and  the  machine  insensitive  modules  EXCHGB,  EXCHGR,
           EXCHNP, EXCHPB, EXCHPR, EXCHSC, EXCHTP,  EXCHTW,  EXCHC1,  EXCHC2,
           EXCHC3,  EXCHRH,  EXCHWH,  EXCHC4, EXCHLX, EXCHC5, EXCHC6, EXCHC7,
 .
 .
                                          14-3
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          EXCHC8 and EXCHC9.  The non-resident segments must be  constructed
           as  described  in  section  2.4.6.   The names of the segments are
           known by EXCHTR and must be as shown below.
0           Value of TRANS    Segment Name
                  1              EXCHV1
                  2              EXCHV2
                  3              EXCHV3
                  4              EXCHV4
                  5              EXCHV5
                  6              EXCHV6
                  7              EXCHV7
                  8              EXCHV8
                  9              EXCHV9
0          When  the modules are compiled or assembled the relocatable output
           should be written on a magnetic tape.  Assume BO is assigned to  a
           tape.   Then  the  first file should be the relocatable output for
           the machine sensitive Fortran modules of  the  root  segment,  the
           second  file should be the relocatable output for DASMR modules of
           the root segment, the third file should be the relocatable  output
           for  portable  or  machine insensitive Fortran modules of the root
           segment, and the next 9 files should be the relocatable output for
           Fortran  modules  of each of the non-resident segments.  If the BO
           file is prepared this  way,  the  module  LMGEN  may  be  used  to
           construct the comprehensive program.  The program will be filed in
           BL with the name EXCH.  LMGEN will produce 9  LG16  errors,  which
           may be ignored.
0
           14.9.  Error Messages
0
           No error messages are produced by the Sperry  620/7x  versions  of
           the  exchange  programs  other than those produced by the portable
           parts of the programs.
0
           14.10.  Informative Messages
0
           The message
0          mmmmm BLOCKS WRITTEN ON TAPE nnn
0          is printed when the output exchange tape is  closed.   The  number
           mmmmm is the number of data blocks written on unit nnn.  The label
           is not counted.
 .
 .
                                          14-4
1
                                  Text Exchange System
 .
 .
                               System Dependent Variants
0          15.  References
0
           1.  W.  V. Snyder and R. J. Hanson, "Text Exchange System, Program
               Descriptions," Jet  Propulsion  Laboratory  internal  document
               number 1846-110.
           2.  W. V. Snyder and  R.  J.  Hanson,  "Text  Exchange  System,  A
               Transportable  System  for Management and Exchange of Programs
               and Other Text," Jet Propulsion Laboratory  internal  document
               number 1846-108.
           3.  "Code  for  Information  Interchange,"   Standard   X3.4-1977,
               American National Standards Institute, New York, 1977.
           4.  Robert McEliece,  "The  Theory  of  Information  and  Coding,"
               Addison-Wesley, 1971.
           5.  "USA Standard Fortran," Standard X3.9-1966, American  National
               Standards Institute, New York, 1966.
           6.  "Sperry Univac 1100 Executive  System  Programmer  Reference,"
               Sperry Univac document number UP-4144, Volume 2, Appendix C.
           7.  "RSX-11M  Executive  Reference  Manual,"   Digital   Equipment
               Corporation document number AA-2544D-TC.
           8.  "VAX/VMS Command Language  User's  Guide,"  Digital  Equipment
               Corporation   document  number  AA-D023B-TE,  March  1980,  pp
               224-234.
           9.  "VAX/VMS  System Services Reference Manual," Digital Equipment
               Corporation  document  number  AA-D018B-TE,  March  1980,   pp
               142-143.
           10. "CLI User's manual," Data General Corporation document  number
               093-000-122-05, various dates April 1976 to May 1982, pp 2-10.
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          15-1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0
           1.  Abstract                                                   1-1
0          2.  Machine or System Sensitive Modules                        2-1
               2.1.  Internal Representation of Characters                2-1
               2.2.  System Dependent Information from Commands           2-1
               2.3.  Modules that are Sensitive to All Machines           2-2
               2.3.1.  Main Program Unit                                  2-2
               2.3.2.  Interface to the Comprehensive Program             2-3
               2.3.3.  Character Unpacking in Both Programs               2-5
               2.3.4.  Character Packing in the Comprehensive Program     2-5
               2.3.5.  Reading Exchange Tapes                             2-6
               2.3.6.  Writing Exchange Tapes                             2-7
               2.4.  Modules that may be Machine Sensitive                2-8
               2.4.1.  Block Data in the Simple Program                   2-8
               2.4.2.  Block Data in the Comprehensive Program            2-9
               2.4.3.  Opening and Closing Native Format Files            2-9
               2.4.4.  Reading Native Format Files                       2-10
               2.4.5.  Writing Native Format Files                       2-11
               2.4.6.  Segmentation of the Compehensive Program          2-12
               2.5.  Optional System Dependent Enhancements              2-12
               2.5.1.  Conversion of Character Codes for Output          2-13
               2.5.2.  System Dependent Command Processing               2-13
               2.5.2.1.  Extra Commands in the Comprehensive Program     2-13
               2.5.2.2.  Processing of System Dependent Information      2-14
               2.5.3.  System Dependent Use of Control Records           2-15
0          3.  Installation Instructions                                  3-1
               3.1.  Organization of the Distribution Tape                3-1
               3.2.  Constructing the Simple Program                      3-2
               3.3.  Constructing the Comprehensive Program               3-4
0          4.  User's Guide for the Simple Program                        4-1
               4.1.  Functional Overview of the Simple Program            4-1
               4.2.  Command Repertoire of the Simple Program             4-1
               4.3.  Printed Output of the Simple Program                 4-3
               4.3.1.  Table of Contents of the EXCH Tape.                4-3
               4.3.2.  Error Messages                                     4-3
               4.3.3.  Informative Messages                               4-4
0          5.  Reading Exchange Tapes with the Simple Program             5-1
               5.1.  Ex. R.0.1 Simple read of EXCH tape, IBM 360/370      5-1
               5.2.  Ex. R.0.2 Simple read of EXCH tape, CDC 6000-7000    5-1
               5.3.  Ex. R.0.3 Simple read of EXCH tape, UNIVAC 1100      5-1
               5.4.  Ex. R.0.4 Simple read with include, IBM 360/370      5-2
0          6.  IBM System/360                                             6-1
               6.1.  System Dependent Information from Commands           6-1
 .
 .
                                           1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0              6.2.  Default Values for File Unit Numbers                 6-1
               6.3.  Default Value for the Command Margin                 6-1
               6.4.  Information Provided by the Environment              6-1
               6.5.  Interpretation of Option Letters                     6-1
               6.6.  Special Commands                                     6-1
               6.7.  Interface to OS/MVT                                  6-2
               6.7.1.  Job Control Language Statements for OS/MVT         6-2
               6.7.2.  Input/Output Interface                             6-3
               6.8.  Contents of the Simple Program                       6-3
               6.9.  Contents of the Comprehensive Program                6-3
               6.10.  Error Messages                                      6-3
0          7.  Univac 1100                                                7-1
               7.1.  System Dependent Information from Commands           7-1
               7.2.  Default Values for File Unit Numbers                 7-1
               7.3.  Information Provided by the Environment              7-1
               7.4.  Interpretation of Option Letters                     7-2
               7.5.  Special Commands                                     7-2
               7.6.  Native Format (SDF) Files                            7-2
               7.7.  Interface to EXEC                                    7-2
               7.7.1.  Executive Control Statements                       7-2
               7.7.2.  Input/Output Interface                             7-3
               7.8.  Contents of the Simple Program                       7-3
               7.9.  Contents of the Comprehensive Program                7-4
               7.10.  Error Messages                                      7-4
               7.11.  Informative Messages                                7-5
0          8.  CDC 6000/7000 Using NOS or SCOPE                           8-1
               8.1.  System Dependent Information from Commands           8-1
               8.2.  Default Values for File Unit Numbers                 8-1
               8.3.  Information Provided by the Environment              8-1
               8.4.  Interpretation of Option Letters                     8-1
               8.5.  Special Commands                                     8-1
               8.6.  Interface to NOS or SCOPE                            8-3
               8.6.1.  Job Control Statements for NOS                     8-3
               8.6.2.  Job Control Statements for SCOPE                   8-3
               8.6.3.  Program Statement                                  8-4
               8.6.4.  Input/Output Interface                             8-4
               8.7.  Contents of the Simple Program                       8-5
               8.8.  Contents of the Comprehensive Program                8-5
               8.9.  Error Messages                                       8-5
0          9.  DEC PDP-10 using TOPS 10                                   9-1
               9.1.  System Dependent Information from Commands           9-1
               9.2.  Default Values for File Unit Numbers                 9-1
               9.3.  Information Provided by the Environment              9-2
               9.4.  Interpretation of Option Letters                     9-2
               9.5.  Special Commands                                     9-2
 .
 .
                                           2
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0              9.6.  Interface to TOPS-10                                 9-2
               9.6.1.  Job Control Statements for TOPS-10                 9-2
               9.6.2.  Input/Output Interface                             9-3
               9.6.3.  An Error in the Fortran Library                    9-3
               9.7.  Contents of the Simple Program                       9-4
               9.8.  Contents of the Comprehensive Program                9-4
               9.9.  Error Messages                                       9-4
               9.10.  Informative Messages                                9-5
0          10.  DEC PDP-11 using RSX-11M V3                              10-1
               10.1.  System Dependent Information from Commands         10-1
               10.2.  Default Values for File Unit Numbers               10-1
               10.3.  Information Provided by the Environment            10-1
               10.4.  Interpretation of Option Letters                   10-1
               10.5.  Special Commands                                   10-1
               10.6.  Interface to RSX-11M V3                            10-2
               10.6.1.  Job Control Statements for RSX-11M V3            10-2
               10.6.2.  Input/Output Interface                           10-2
               10.7.  Contents of the Simple Program                     10-3
               10.8.  Contents of the Comprehensive Program              10-3
               10.9.  Error Messages                                     10-3
               10.10.  Informative Messages                              10-4
0          11.  DEC VAX-11 using VMS                                     11-1
               11.1.  System Dependent Information from Commands         11-1
               11.2.  Default Values for File Unit Numbers               11-1
               11.3.  Information Provided by the Environment            11-2
               11.4.  Interpretation of Option Letters                   11-2
               11.5.  Special Commands                                   11-2
               11.6.  Interface to VMS                                   11-2
               11.6.1.  Job Control Statements for VMS                   11-3
               11.6.1.1.  Using the Simple Program                       11-3
               11.6.1.2.  Copying an Exchange Format Tape to a Disk Fil  11-3
               11.6.1.3.  Copying an Exchange Format Disk File to a Tap  11-4
               11.6.1.4.  Copying an Exchange Format Disk File to Anoth  11-4
               11.6.2.  Input/Output Interface                           11-4
               11.7.  Contents of the Simple Program                     11-5
               11.8.  Contents of the Comprehensive Program              11-5
               11.9.  Error Messages                                     11-5
0          12.  DEC VAX-11 using UNIX (TM)                               12-1
               12.1.  System Dependent Information from Commands         12-1
               12.2.  Default Values for File Unit Numbers               12-1
               12.3.  Information Provided by the Environment            12-2
               12.4.  Interpretation of Option Letters                   12-2
               12.5.  Special Commands                                   12-2
               12.6.  Interface to UNIX (TM)                             12-2
               12.6.1.  Job Control Statements for UNIX (TM)             12-3
 .
 .
                                           3
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0              12.6.1.1.  Copying an Exchange Format Tape to a Disk Fil  12-3
               12.6.1.2.  Using the Simple Program                       12-3
               12.6.1.3.  Copying an Exchange Format Disk File to a Tap  12-4
               12.6.1.4.  Copying an Exchange Format Disk File to Anoth  12-4
               12.6.2.  Input/Output Interface                           12-4
               12.7.  Contents of the Simple Program                     12-5
               12.8.  Contents of the Comprehensive Program              12-5
               12.9.  Error Messages                                     12-5
0          13.  Data General MV/8000 using AOS/VS                        13-1
               13.1.  System Dependent Information from Commands         13-1
               13.2.  Default Values for File Unit Numbers               13-1
               13.3.  Information Provided by the Environment            13-2
               13.4.  Interpretation of Option Letters                   13-2
               13.5.  Special Commands                                   13-2
               13.6.  Interface to AOS/VS                                13-2
               13.6.1.  Job Control Statements for AOS/VS                13-3
               13.6.1.1.  Using the Simple Program                       13-3
               13.6.1.2.  Copying an Exchange Format Tape to a Disk Fil  13-3
               13.6.1.3.  Copying an Exchange Format Disk File to a Tap  13-3
               13.6.1.4.  Copying an Exchange Format Disk File to Anoth  13-4
               13.6.2.  Input/Output Interface                           13-4
               13.7.  Contents of the Simple Program                     13-4
               13.8.  Contents of the Comprehensive Program              13-5
               13.9.  Error Messages                                     13-5
0          14.  Sperry Univac (ex Varian) V-70 using VORTEX              14-1
               14.1.  System Dependent Information from Commands         14-1
               14.2.  Default Values for File Unit Numbers               14-1
               14.3.  Information Provided by the Environment            14-1
               14.4.  Interpretation of Option Letters                   14-2
               14.5.  Special Commands                                   14-2
               14.6.  Interface to VORTEX                                14-2
               14.6.1.  Job Control Language Statements for VORTEX       14-2
               14.6.2.  Input/Output Interface                           14-3
               14.6.3.  Restrictions                                     14-3
               14.7.  Contents of the Simple Program                     14-3
               14.8.  Contents of the Comprehensive Program              14-3
               14.9.  Error Messages                                     14-4
               14.10.  Informative Messages                              14-4
0          15.  References                                               15-1
0
0
0
 .
 .
                                           4
1
                                  Text Exchange System
 .
 .
                                         Index
0
           Block Data in the Comprehensive Program        2.4.            2-9
           Block Data in the Simple Program               2.4.            2-8
0          CDC 6000/7000 NOS Control Statements sample    8.6.            8-3
           CDC 6000/7000 SCOPE Control Statements sample  8.6.            8-4
           Character Packing in the Comprehensive Program 2.3.            2-5
           Character Unpacking in Both Exchange Programs  2.3.            2-5
           Conversion of Character Codes for Output       2.5.           2-13
0          Data General MV/8000 AOS/VS Job Control Samples13.6.          13-3
           DEC PDP-10 JCL sample                          9.6.            9-2
           DEC PDP-11 RSX-11M Control Statements sample   10.6.          10-2
           DEC VAX/UNIX (TM) Job Control Samples          12.6.          12-3
           DEC VAX/VMS Job Control Samples                11.6.          11-3
           Distribution Tape                              3.1.            3-1
0          Error Messages, CDC 6000/7000 versions         8.9.            8-5
           Error Messages, Data General MV/8000 using AOS/13.9.          13-5
           Error Messages, DEC PDP-10 versions            9.9.            9-4
           Error Messages, DEC PDP-11 versions            10.9.          10-3
           Error Messages, DEC VAX-11 using UNIX (TM) vers12.9.          12-5
           Error Messages, DEC VAX-11 using VMS versions  11.9.          11-5
           Error Messages, IBM System/360 versions        6.10.           6-3
           Error Messages, Simple Program                 4.3.            4-3
           Error Messages, Sperry Univac V-70 versions    14.9.          14-4
           Error Messages, Univac-1100 versions           7.10.           7-4
           Ex R.0.1 Simple read of EXCH tape, IBM 360/370 5.1.            5-1
           Ex R.0.2 Simple read of EXCH tape, CDC 6/7000  5.2.            5-1
           Ex R.0.3 Simple read of EXCH tape, UNIVAC 1100 5.3.            5-1
           Ex R.0.4 Simple read with include, IBM 360/370 5.4.            5-2
           EXCH Specification                             2.3.            2-3
           EXCHAH Specification                           2.5.           2-13
           EXCHBD Specification                           2.4.            2-9
           EXCHBX Specification                           2.4.            2-8
           EXCHCG Specification                           2.5.           2-15
           EXCHCX Specification                           2.5.           2-13
           EXCHFO Specification                           2.4.            2-9
           EXCHIM Specification                           2.4.           2-10
           EXCHOU Specification                           2.4.           2-11
           EXCHPA Specification                           2.3.            2-5
           EXCHRT Specification                           2.3.            2-6
           EXCHSL Specification                           2.4.           2-12
           EXCHTR Modification                            2.4.           2-12
           EXCHUN Specification                           2.3.            2-5
           EXCHWT Specification                           2.3.            2-7
           Extra Commands in the Comprehensive Program    2.5.           2-13
0.
 .
                                           1
1
                                  Text Exchange System
 .
 .
                                         Index
0          IBM System/360 JCL sample                      6.7.            6-2
           Informative Messages, Simple Program           4.3.            4-4
           Interface to the Comprehensive Program         2.3.            2-3
           Internal Representation of Characters          2.1.            2-1
0          Main Program Unit                              2.3.            2-2
0          Opening and Closing Native Format Files        2.4.            2-9
0          Processing of System Dependent Information     2.5.           2-14
0          Reading Exchange Tapes                         2.3.            2-6
           Reading Native Format Files                    2.4.           2-10
0          Segmentation of the Comprehensive Program      2.4.           2-12
           Sperry Univac V-70 VORTEX JCL sample           14.6.          14-2
           System Dependent Command Processing            2.5.           2-13
           System Dependent Information from Commands     2.2.            2-1
           System Dependent Use of Control Records        2.5.           2-15
0          Univac 1100 Executive Control sample           7.7.            7-2
0          Varian V-70 VORTEX JCL sample                  14.6.          14-2
0          Writing Exchange Tapes                         2.3.            2-7
           Writing Native Format Files                    2.4.           2-11
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                           2
1
