1
0.
 .
0
0
0
0
0                                 Text Exchange System
0                                 Program Descriptions
0
0                                     Section 366
                                        1846-110
0
0
0                                  September 22, 1981
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
 .
 .
                                  Program Descriptions
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 tape format and the  programs  of
           the  TES.   It is assumed that the reader is familiar with [1] and
           [2].
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          1-1
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          2.  Tape Format
0
           The tape format does not depend on the number  of  tracks  on  the
           tape.   Information  is  recorded  by  the tape exchange system in
           blocks containing a multiple of 180  characters,  each  containing
           eight  bits.   Blocks of this size exactly fill an integral number
           of computer words if the word size is 8, 12, 16, 24, 30,  32,  36,
           48  or 60 bits.  Character information is recorded using the ASCII
           code [3].  Numeric information is recorded as eight or sixteen bit
           unsigned  binary  integers.  Since numeric information may contain
           enough zero bits to cause a frame of  the  tape  to  contain  only
           zeros,  tapes  produced  by  the  exchange program must be written
           using odd parity.  (A frame of all zeros is used by tape transport
           hardware  to  mark the end of the block.)  Two kinds of blocks are
           written on the tape.  The first is a label giving some information
           about the tape.  The others contain text modules.
0
           2.1.  Tape Label Format
0
           The  first  block of each file of an exchange tape is a label that
           identifies the file and provides information about where and  when
           it was written.
           Characters   Content of field
            1-8         The word 'EXCHANGE' to verify that  the  block  is  a
                        label.
            9-10        A  16  bit  number  specifying  the  number  of  data
                        characters per block, called NDC below.
            11-12       A 16  bit  number  specifying  the  number  of  error
                        correction characters per block, called NEC below.
            13-18       The date the tape was written (yymmdd in ASCII).
            19-58       The title.
            59-64       The date the tape  was  created  from  native  format
                        information (yymmdd in ASCII).
            65-104      The site at which the tape was  created  from  native
                        format information.
            105-110     The date  the  last  insertion  or  update  was  made
                        (yymmdd in ASCII).
            111-150     The site where the last insertion or update was made.
            151-180     Not used.
0
0
0
 .
 .
                                          2-1
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          2.2.  Data Block Format
0
           To improve storage efficiency on tape and reduce processing  time,
           data  is stored in large blocks.  The block size is nominally 3600
           characters, but may easily  be  changed.   The  programs  use  the
           numbers NDC and NEC stored in the label to compute the block size.
           The block size should not be made  greater  than  3600  characters
           because  CDC  systems  using  SCOPE require local modifications to
           read blocks of more than 511 words.
0          Each block is divided into  three  segments.   The  first  segment
           contains  NEC  characters that may be used for error detection and
           correction information [4].  The portable parts  of  the  programs
           neither  examine  nor  change  this  segment.   The second segment
           contains  nine  characters  of  structure  information.   In   the
           description  below, character positions are relative to the end of
           the error correction segment.
           Characters   Content of field
            1-2         A 16 bit block sequence number.
            3           An ASCII L (76) if the block is the last block  of  a
                        file, or zero if the block is not the last block.
            4-5         A 16 bit number indicating  the  position  (including
                        the structure segment but excluding the error control
                        segment) of the first text module name record in  the
                        block  (see  below), or zero if no text modules begin
                        in the block.
            6-7         A  16 bit number giving the text module number of the
                        first complete record in the block.
            8-9         A  16  bit  number  indicating  the  position (as for
                        characters 4 and  5  above)  of  the  first  complete
                        record in the block.
           The  third  segment  contains  no more than NDC characters of text
           records and control records.
0
           2.3.  Text Record Format
0
           Redundant characters of text records are removed to conserve space
           on  tape.   The  format  of  text  records  allows these redundant
           characters  to  be  recovered.   Text  records  are  divided  into
           sequences of significant characters containing no sequences of two
           or more consecutive occurrences of the redundant  character.   The
           first character of a text record is an eight bit number indicating
           the number of such groups of data.  A record  that  contains  only
           redundant  characters  will  have  one  such  group  of data.  The
           precise  format  of  a  text  record  is  best  described   by   a
 .
 .
                                          2-2
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          hypothetical program to replace the removed characters.  We assume
           that 'INPUT' fetches  one  eight  bit  character  from  the  input
           stream,  and 'OUTPUT' stores one eight bit character in the output
           stream.
0          INPUT NG, the number of text groups
           FOR G = 1 to NG
             INPUT NR, the number of removed characters
             INPUT NS, the number of significant characters
             IF (NR > 0) THEN
               FOR R = 1 to NR
                 OUTPUT removed character
               END FOR
             END IF
             IF (NS > 0) THEN
               FOR S = 1 to NS
                 INPUT significant character
                 OUTPUT significant character
               END FOR
             END IF
           END FOR
0
0          2.4.  Control Record Format
0
           Control  records are distinguished from text records by having the
           group count described above equal zero or 255.  If the group count
           is  255  the record consists only of the group count character and
           indicates the end of a block.  If the  group  count  is  zero  the
           second  character  of  the  record  is  an upper case ASCII letter
           identifying the control record type.
           Letter       Control Record Type
             A          Author.
             B          Bibliographic reference.
             C          Comment.
             D          Data type.
             E          End of file.
             G          Groups of which the module is a member.
             I          Request to include text from alternate source.
             J          Character used  to  signal  end  of  text  or  update
                        instructions.
             K          Keywords.
             M          Machine type.
             O          Date and site where the text  module  was  originally
                        written.
             P          Text module name (program name).
 .
 .
                                          2-3
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0            R          Character removed to compress the text.
             S          Date and site where the text module was updated.
             Other      Text having user defined meaning.
           Control  record  type  E  contains  no other text.  Control record
           types J  and  R  contain  one  additional  character.   The  third
           character  of  control record types other than E, J, P and R is an
           eight bit number giving the number of characters of  text  in  the
           record.  The format of control record type P is shown below.
           Characters   Content of field
            1           Zero (indicating a control record).
            2           Upper case ASCII P (80).
            3-4         A 16 bit number indicating  the  position  (including
                        the   structure   segment  but  excluding  the  error
                        correction segment) of  the  next  text  module  name
                        record  that  begins in the same block, or zero if no
                        further text modules begin in the same block.
            5-6         A 16 bit text module number.
            7           An eight bit number giving the number  of  characters
                        of text of the name of the module.
            8-end       The name of the text module.
0
           2.5.  Text Module Format
0
           Text modules consist of text and related control records.  Control
           records associated with the text module, other than control record
           type  I,  precede  the module.  The module name record (type P) is
           always the first control record.  The exchange programs,  however,
           assume  that  any  control record other than type I or the control
           record identified by a group count of 255 defines  the  end  of  a
           module.
0
0
0
0
0
0
0
0
 .
 .
                                          2-4
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          3.  Program Description
0
0
           3.1.  Common Blocks Used by the Portable Subprograms
0
           Most of the communication  between  subprograms  of  the  exchange
           programs uses named COMMON blocks.
0
           3.1.1.  Named COMMON /EXCHIC/
0
           The  named COMMON block /EXCHIC/ is used for communication related
           to reading exchange tapes.   The  declarations  for  /EXCHIC/  are
           contained in the blocks of text identified by '-I EXCHIC/TYPE' and
           '-I EXCHIC/COMMON' in the text module identified on  the  exchange
           program distribution tape as DECLARATIONS.
0           INTEGER NDATAI,NERRCI,BLKSQI,LASTI,L1PRGI,N1RECI,L1RECI,NWCBI,
           1        NCCBI,CPCBI,CBLCKI(180),CCDBI,CWDBI,NCDBI,NCHMAX,NCHACT,
           2        ITYPEI,MODEI,REMVI,LABELI(180),INTREC(180)
            COMMON /EXCHIC/ NDATAI,NERRCI,BLKSQI,LASTI,L1PRGI,N1RECI,L1RECI,
           1       NWCBI,NCCBI,CPCBI,CBLCKI,CCDBI,CWDBI,NCDBI,NCHMAX,NCHACT,
           2       ITYPEI,MODEI,REMVI,LABELI,INTREC
0          The use of each variable is described below.
0          NDATAI = Maximum number of data characters per block.
           NERRCI = Number of error correction characters per block.
           BLKSQI = Sequence number of the last block read.
           LASTI  = ASCII L (76) if the last block read was the last block of
            a file.
           L1PRGI  =  Location  of  the  next  text module name record in the
            current block, or zero if no further text modules  begin  in  the
            current block.
           N1RECI = Text module number of the first complete  record  in  the
            current block.
           L1RECI = Location of the first  complete  record  in  the  current
            block.
           NWCBI = Number of Fortran type INTEGER  words  occupied  by  NCCBI
            characters.
           NCCBI = Number of characters to unpack at one time.
           CPCBI = Current position in CBLCKI.
           CBLCKI = Character block (unpacked characters).
           CCDBI = Current character position in the input tape buffer.
 .
 .
                                          3-1
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          CWDBI = Current word position in the input tape buffer.
           NCDBI  =  Number  of characters placed in the input tape buffer by
            the last read operation.
           NCHACT  =  Size  in  characters of the last record provided to the
            user.
           NCHMAX = Maximum size record that can be passed to the user.
           ITYPEI = Type of record passed to the  user:  zero  means  a  text
            record,  non-zero  is  the  upper case ASCII letter identifying a
            control record.
           MODEI  =  Zero  if  the  user  wants  characters removed from text
            records replaced, non-zero if the  user  wants  text  records  in
            compressed form.  (Control records are not compressed).
           REMVI =  Character  removed  to  compress  the  text,  and  to  be
            re-inserted  to  recover  the original text.  REMVI is changed to
            blank (32) while processing the module name record (type P).
           LABELI = Label read from the input tape.
           INTREC = A record read from the input tape.  Not all records  read
            from the input tape are stored in INTREC.
0
           3.1.2.  Named COMMON /EXCHOC/
0
           The named COMMON block /EXCHOC/ is used for communication  related
           to  writing  exchange  tapes.   The  declarations for /EXCHOC/ are
           contained in the blocks of text identified by '-I EXCHOC/TYPE' and
           '-I  EXCHOC/COMMON'  in the text module identified on the exchange
           program distribution tape as DECLARATIONS.
0           INTEGER BLKSQO,CBLCKO(180),CCDBO,CPCBO,CWDBO,ITYPEO,LASTO,LLPRGO,
           1        L1PRGO,L1RECO,MODEO,NCCBO,NCHOUT,NDATAO,NERRCO,NLRECO,
           2        NWCBO,N1RECO,OUTREC(180),OUTUPD,REMVO
            COMMON /EXCHOC/ BLKSQO,CBLCKO,CCDBO,CPCBO,CWDBO,ITYPEO,LASTO,
           1       LLPRGO,L1PRGO,L1RECO,MODEO,NCCBO,NCHOUT,NDATAO,NERRCO,
           2       NLRECO,NWCBO,N1RECO,OUTREC,OUTUPD,REMVO
0          The use of each variable is described below.
0          BLKSQO = Sequence number of the last block written.
           CBLCKO = Character block (unpacked characters).
           CCDBO = Current character position in the output tape buffer.
           CPCBO = Current position in CBLCKO.
           CWDBO = Current word position in the output tape buffer.
           ITYPEO = Type of record to be written on  the  output  tape:  zero
            means  a  text  record,  non-zero  is the upper case ASCII letter
            identifying a control record.
           LASTO  = ASCII L (76) if the block to be written is the last block
            of a file.
 .
 .
                                          3-2
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          LLPRGO  =  Location  of  the  last  text module name record in the
            current block, or zero if there are no previous text module  name
            records in the current block.
           L1PRGO = Location of the first module name record in  the  current
            block, or zero if no modules begin in the current block.
           L1RECO = Location of the first complete record in the block.
           MODEO  =  Zero  if  the  record  is  to  be compressed by having a
            specified character removed,  non-zero  if  the  compression  has
            already  been  performed.  In the latter case, a text record must
            be in the format described in section 2.3.
           NCCBO = Number of characters to pack at one time.
           NCHOUT = Number of characters in a record to  be  written  on  the
            output tape.
           NDATAO = Number of data characters per block.
           NERRCO = Number of error correction characters per block.
           NLRECO = Module number of the last record started in  the  current
            block.
           NWCBO = Number of Fortran type INTEGER  words  occupied  by  NCCBI
            characters.
           N1RECO = Module number of the first complete record that begins in
            the current block.
           OUTREC = A record to be written on the output tape.  A record that
            is not stored in OUTREC may also be written on the output tape.
           OUTUPD = Zero if the U modifier of  the  OUTAPE  command  was  not
            selected,  ASCII  U  (85) if the U modifier of the OUTAPE command
            was selected.
           REMVO  =  Character  to  remove  to  compress  the text.  REMVO is
            changed to blank (32) while processing  the  module  name  record
            (type P).
0
           3.1.3.  Named COMMON /EXCHPC/
0
           The named COMMON block /EXCHPC/ is used for communication  related
           to   processing  commands.   The  declarations  for  /EXCHPC/  are
           contained in blocks of text identified by  '-I  EXCHPC/TYPE',  '-I
           EXCHPC/COMMON/  and  '-I  EXCHPC/EQUIVALENCE'  in  the text module
           identified  on  the  exchange   program   distribution   tape   as
           DECLARATIONS.
0           INTEGER ACTION,CHAR1L,COMAND(180),COMD(4,40),EQUAL,HOLCMD(180),
           1        ICOMD,IDCUR,IDOPTN,IDNBRS(4),IDTEXT(40),IDTXTL,INDEX,
           2        INDEXS(26),INTOPN,LIMIT,LINEO,MARGIN,MODIFY,NCHCMD,
           3        N,NCOMDP,NCOMDT,NERRG,NERRS,NRWORK,NUMBER,OPTVAL(26),
           4        OUTOPN,PHASE,PRED(42,8),SIGNAL,SITE(40),TITLE(40),
           5        TODAY(6),TRANS,VERT
            INTEGER IDCOL1,IDCOL2,IDSTEP,IDSTRT
 .
 .
                                          3-3
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0           INTEGER OPTA,OPTC,OPTE,OPTI,OPTL,OPTS,OPTV
            COMMON /EXCHPC/ ACTION,CHAR1L,COMAND,COMD,EQUAL,HOLCMD,ICOMD,
           1       IDCUR,IDOPTN,IDNBRS,IDTEXT,IDTXTL,INDEX,INDEXS,INTOPN,
           2       LIMIT,LINEO,MARGIN,MODIFY,NCHCMD,NCOMDP,NCOMDT,NERRG,
           3       NERRS,NRWORK,NUMBER,OPTVAL,OUTOPN,PHASE,PRED,SIGNAL,SITE,
           4       TITLE,TODAY,TRANS,VERT
            EQUIVALENCE (IDNBRS(1),IDCOL1),(IDNBRS(2),IDCOL2)
            EQUIVALENCE (IDNBRS(3),IDSTEP),(IDNBRS(4),IDSTRT)
            EQUIVALENCE (OPTVAL(1),OPTA),(OPTVAL(3),OPTC),(OPTVAL(5),OPTE)
            EQUIVALENCE (OPTVAL(9),OPTI),(OPTVAL(12),OPTL),(OPTVAL(19),OPTS)
            EQUIVALENCE (OPTVAL(22),OPTV)
           The use of each variable is described below.
0          ACTION = Used for communication with the machine sensitive modules
            EXCHIM and EXCHOU.  Consult [2].
           CHAR1L  =  Indicates  the first character of a printed line.  Used
            between modules to determine  whether  a  page  eject  is  needed
            before  printing  the  index.   Used  while  printing  modules to
            determine whether to print an asterisk, plus sign, or minus  sign
            after the line sequence number.
           COMAND = A line of text  read  from  the  source  defined  by  the
            READER, INPUT FILE, TEXT or INCLUDE FILE command.  The characters
            of the line are stored in COMAND using one  character  per  word,
            right justified, zero filled.
           COMD = Commands recognized by EXCHC1.
           EQUAL  =  Position  in  COMAND  of  the  beginning  of  a  command
            parameter.  If there is no equal sign in  the  command  EQUAL  is
            zero.   If  there  is  an  equal  sign but no parameter EQUAL and
            NCHCMD are both the position of the  first  character  after  the
            equal  sign, which has been changed to a blank.  While processing
            system dependent information from commands EQUAL is the  position
            of  the  first  non-blank  after  the  first blank after the unit
            number, or is greater than NCHCMD if there is no system dependent
            information.   EQUAL  is  also  used  to  transmit  error  status
            information to EXCHC8.
           HOLCMD  =  Hollerith  equivalent  of  the  information  in  COMAND
            (Suitable for printing using FORMAT (120A1).)
           ICOMD  =  Command index.  If a command has been found by EXCHC1 in
            COMD ICOMD is the location of the command in COMD.  If a  control
            record  change  request  has  been  recognized by EXCHC1 ICOMD is
            zero.  ICOMD  is  also  used  to  control  communication  between
            EXCHC4,  EXCHC5  and  EXCHC6:  while processing a COPY command of
            the first form ICOMD is -1; while processing a  COPY  command  of
            the second form ICOMD is -2.
           IDCUR = Current value of  the  sequence  number  to  produce  when
            identifying  output  using  the  IDENT  command  with  the C or F
            modifiers.  IDCUR is changed to zero when processing of the  text
            of a module begins if IDOPTN is not equal C (67).
 .
 .
                                          3-4
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          IDOPTN = Modifier from the IDENT command.
           IDNBRS = Four numbers from the IDENT command.
           IDTEXT = Text from the IDENT command.
           IDTXTL = Number of characters stored in IDTEXT.
           INDEX = IABS(INDEX) is the sum of elements of INDEXS.  If INDEX  <
            zero the L modifier of the INDEX command was selected.
           INDEXS = A vector indicating  which  control  records  are  to  be
            printed  in the index.  An element having zero value means do not
            print a control record.  An element having value one means  print
            a control record.  INDEXS(1) is used for control record A, etc.
           INTOPN = Zero if INTAPE has not been opened,  one  if  INTAPE  has
            been opened.
           LIMIT = Number specified by the LIMIT command.
           LINEO  =  Line  number  of text module being produced by insert or
            update.
           MARGIN  =  The  column  number  of the last column to examine when
            interpreting commands.  This is given the value  180  in  EXCHBD,
            but  may  be  changed by the MARGIN command or by machine or site
            dependent  code.   In  particular,  the  IBM  System/360  version
            changes MARGIN to 72 in EXCH.
           MODIFY = Modifier character of the current comand.
           NCHCMD  = Number of characters in the current command, or -1 if an
            end of file was detected in a native format data source.
           NCOMDP  = Number of commands that may be processed by the portable
            parts of the program.
           NCOMDT = Total number of commands stored in COMD.  NCOMDT must not
            be less than NCOMDP.  Consult the specification of EXCHCX in [2].
           NERRG = Maximum error severity.
           NERRS  =  Maximum  error  severity  encountered   while   copying,
            inserting or updating the current text module.
           NRWORK = Between modules, or while examining the  control  records
            of a module during the processing of a COPY command of the second
            form, NRWORK is the number of control records stored on the  file
            defined by the WORK FILE command (or the appropriate default unit
            number).  While printing the index NRWORK is the ordinal position
            in the current text module of the control record being processed.
           NUMBER = A number  from  the  beginning  of  the  parameter  of  a
            command.   NUMBER  is  also  used  to  transmit the error message
            number to EXCHC8.
           OPTVAL  = A vector of option values.  An element having zero value
            indicates the option has not been selected.   An  element  having
            value  one  indicates the option has been selected.  OPTVAL(1) is
            for the A option, etc.
           OUTOPN = Zero if the output exchange tape has not been opened, one
            if it has been opened.
           PHASE  =  Processing  phase:   1  during initialization, 2 between
            modules, 4 while inserting a module, 8 while updating a module.
           PRED  =  Information  stored by PREDICATE commands.  PRED(1..42,I)
 .
 .
                                          3-5
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0           stores information for  logical  variable  A  if  I  is  1,  etc.
            PRED(1,*)-3  is the length of the search string, PRED(2,*) is the
            truth value computed by EXCHC4 while examining  control  records,
            PRED(3,*)  is  the  record  type  to which the predicate applies,
            PRED(4,*) is A (65) if the predicate  is  true  when  the  search
            string  is  found  anywhere  in a control record or X (88) if the
            predicate is true only when the search string  is  found  in  the
            specified   position,   PRED(5,*)  is  the  mask  character,  and
            PRED(6..42,*) is the search string.
           SIGNAL  = Character that indicates an update instruction (PHASE=8)
            or the end of text (PHASE=4 or  PHASE=8).   May  be  input  by  a
            SIGNAL  command or by the sequence -=* in a text module or update
            instruction sequence where - is the current value of SIGNAL and *
            is  the  new  value.   SIGNAL  is changed to - while processing a
            module name record (type P).
           SITE = String stored by the SITE command.
           TODAY = Date stored by the DATE command (yymmdd).
           TRANS  =  Indicates  to  EXCHTR  which  of  EXCHC1-EXCHC9 to call.
            TRANS=1 means call EXCHC1, etc.   TRANS=0  means  return  to  the
            machine sensitive interface subprogram EXCH.
           VERT = Zero if the A option was not selected or a  data  (type  D)
            control record having the first 4 characters equal 'LIST' was not
            found, one if the A option was  selected  and  a  data  (type  D)
            control  record  having  the  first 4 characters equal 'LIST' was
            found.  Used to control printing using  the  first  character  of
            text images for vertical format control.
0
           3.1.4.  Named COMMON /EXCHUC/
0
           The  named  COMMON  block  /EXCHUC/  contains  Fortran  file  unit
           numbers.  The declarations for /EXCHUC/ are contained in blocks of
           text identified by '-I EXCHUC/TYPE' and '-I EXCHUC/COMMON' in  the
           text  module  identified on the exchange program distribution tape
           as DECLARATIONS.
0           INTEGER INTAPE,OUTAPE,INFILE,OUFILE,PRINTR,READER,INTEXT,INALT,
           1        WORKF
            COMMON /EXCHUC/ INTAPE,OUTAPE,INFILE,OUFILE,PRINTR,READER,INTEXT,
           1       INALT,WORKF
0          The use of each variable is described below.
0          INTAPE = Unit number for the input exchange tape.
           OUTAPE = Unit number for the output exchange tape.
           INFILE = Unit number defined by the INPUT FILE command.
           OUFILE = Unit number defined by the OUTPUT FILE command.
 .
 .
                                          3-6
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          PRINTR  =  Unit  number for printed output, defined by the PRINTER
            command.
           READER  =  Unit  number  for  native  format input, defined by the
            READER command.
           INTEXT = Unit number defined by the TEXT command.
           INALT = Unit number defined by the INCLUDE FILE command.  INALT is
            negative  except  while processing a request to include text from
            the file defined by IABS(INALT).
           WORKF  =  Unit  number  of the work file, defined by the WORK FILE
            command.
0
           3.1.5.  Named COMMON /EXCHXC/
0
           The named COMMON block /EXCHXC/ contains a table to translate from
           ASCII character code to Hollerith code.  It may not be  needed  in
           some versions of the exchange programs.
0          INTEGER XLATE(128)
           COMMON /EXCHXC/ XLATE
0          XLATE  =  Table  to  translate  from ASCII to Hollerith.  XLATE is
            subscripted using 1 plus the ASCII code of the  character  to  be
            translated.   The  value  of the elements of XLATE is supplied by
            BLOCK DATA subprograms.
0
           3.2.  Common Blocks Used by Machine Sensitive Versions
0
0
           3.2.1.  Common Blocks Used by Univac-1100 Subprograms
0
0
           3.2.1.1.  Named COMMON /EXEC8/
0
           The  named  COMMON  block  /EXEC8/ is used by Univac-1100 specific
           subprograms of the  comprehensive  program  for  some  information
           relative to native format input and output.
0          INTEGER AFDFLG,WORKS(474,5)
           COMMON /EXEC8/ AFDFLG,WORKS
0.
 .
                                          3-7
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          AFDFLG = Zero if Fieldata character code is to be used for output,
            one if quarter word ASCII code is to be used for output.
           WORKS = work areas used for SDF input and output.  WORKS(1..474,1)
            is for input from the READER file.  WORKS(1..474,2) is for  input
            from  the INPUT file.  WORKS(1..474,3) is for input from the TEXT
            file.  WORKS(1..474,4)  is  for  input  from  the  INCLUDE  file.
            WORKS(1..474,5)  is  for the OUTPUT file.  The detailed format of
            WORKS(1..474,*) is defined in the modules EORSR and EORSW.
0
           3.2.1.2.  Named COMMON /EXEC8A/
0
           The named COMMON block /EXEC8A/ contains some information used for
           native format  input  and  output  and  for  reading  and  writing
           exchange format disk files.
0          INTEGER FILES(2,7),ELTS(2,7),VERS(2,7),PFS(12,2)
           COMMON /EXEC8A/ FILES,ELTS,VERS,PFS
0          FILES  =  File  names derived from unit numbers.  FILES(1..2,1) is
            for  the  READER.   FILES(1..2,2)  is   for   the   INPUT   file.
            FILES(1..2,3)  is  for  the  TEXT file.  FILES(1..2,4) is for the
            INCLUDE  file.    FILES(1..2,5)   is   for   the   OUTPUT   file.
            FILES(1..2,6) is for INTAPE.  FILES(1..2,7) is for OUTAPE.
           ELTS =  Element  names  from  system  dependent  information  from
            commands.   Columns  of ELTS are used as for FILES.  There are no
            commands in the simple program, so ELTS(1,6) is set  to  fieldata
            blanks in the main program, indicating that exchange format input
            does not come from a disk file OMNIBUS element.
           VERS  =  Version  names  from  system  dependent  information from
            commands.  Columns of VERS are used as for FILES.
           PFS  =  Program file search packets (See section 11.3.1.1 of [5]).
            PFS(1..12,1) is used when INTAPE refers to a  disk  file  OMNIBUS
            element.   PFS(1..12,2) is used when OUTAPE refers to a disk file
            OMNIBUS element.  While reading an OMNIBUS element, PFS(11,1)  is
            the  current  sector address, and PFS(10,1) is the sector address
            of the beginning  of  the  OMNIBUS  element.   While  writing  an
            omnibus  element,  PFS(10,2)  is  the current sector address, and
            PFS(11,2) is the sector address of the beginning of  the  OMNIBUS
            element.
0
           3.2.2.  Common Block Used by CDC 6000/7000 Subprograms
0
           The  named  COMMON  block  /CDCMDE/  contains   system   dependent
           information from commands.
 .
 .
                                          3-8
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          INTEGER CDCMDE
           COMMON /CDCMDE/ CDCMDE
0          CDCMDE is equal 1 when using 6BIT character conversion, and 2 when
           using  12/6  bit  character  conversion.  (See section 8.5 of [2])
           CDCMDE is set to 1 in the main program.
0
           3.2.3.  Common Block Used by DEC PDP-10 Subprograms
0
           The  named  COMMON  block  /EXCP10/  contains   system   dependent
           information from commands.
0          LOGICAL TABS
           DOUBLE PRECISION FNAMES(3)
           COMMON /EXCP10/ TABS,FNAMES
0          TABS = .TRUE. if ASCII  HT  characters  are  data  characters,  or
            .FALSE.  if ASCII HT characters are tabulation requests.  TABS is
            set by EXCH and EXCHCX, and examined by EXCHIM.
           FNAMES = File names derived from system dependent information from
            commands.  FNAMES(1) contains information from  the  most  recent
            READER,  INPUT  FILE,  TEXT, INCLUDE FILE or OUTPUT file command.
            FNAMES(2)  contains  information  from  the  most  recent  INTAPE
            command.   FNAMES(3)  contains  information  from the most recent
            OUTAPE command.
0
           3.2.4.  Common Block Used by DEC PDP-11 Subprograms
0
           The   named   COMMON  block  /EXCRSX/  contains  system  dependent
           information from commands.
0          LOGICAL TABS
           BYTE FNAMES(40,3)
           COMMON /EXCRSX/ TABS,FNAMES
0          TABS  =  .TRUE.  if  ASCII  HT  characters are data characters, or
            .FALSE.  if  ASCII  HT  characters  are   horizontal   tabulation
            requests.
           FNAMES = File names derived from system dependent information from
            commands.   FNAMES(1..40,1)  contains  information  from the most
            recent READER, INPUT FILE, TEXT,  INCLUDE  FILE  or  OUTPUT  FILE
            command.   FNAMES(1..40,2)  contains  information  from  the most
            recent INTAPE command.  FNAMES(1..40,3) contains information from
            the most recent OUTAPE command.
 .
 .
                                          3-9
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          3.2.5.  Common Block used by the DEC VAX/VMS Subprograms.
0
0
           3.2.5.1.  Named COMMON /EXCVAX/
0
           The named COMMON block /EXCVAX/ contains system dependent
           information from commands.
0          CHARACTER TABS
           CHARACTER*40 FNAMES(3)
           COMMON /EXCVAX/ TABS,FNAMES
0          TABS = 'Y' if ASCII HT characters are data characters, or  'N'  if
            ASCII  HT characters are horizontal tabulation requests.  TABS is
            set equal to 'Y' by a TABS=D or TABS=Y command, and is set  equal
            to  'N' by a TABS=T or TABS=N command.  The initial value is 'Y'.
           FNAMES = File names derived from system dependent information from
            commands.   FNAMES(1)  contains  information from the most recent
            READER, INPUT FILE, TEXT, INCLUDE FILE, or OUTPUT  FILE  command.
            FNAMES(2)  contains  information  from  the  most  recent  INTAPE
            command.  FNAMES(3) contains information  from  the  most  recent
            OUTAPE command.
0
           3.2.6.  Common Block used by Sperry V-70 Subprograms
0
           The   named   COMMON  block  /FNAMES/  contains  system  dependent
           information from commands.
0          INTEGER FNAMES(4,3)
           COMMON /FNAMES/ FNAMES
0          FNAMES(1..3,*)  =  File  names,  FNAMES(4,*)  =  Protection  keys.
            FNAMES(1..4,1)  contains information from the most recent READER,
            INPUT  FILE,  TEXT,  INCLUDE  FILE  or   OUTPUT   FILE   command.
            FNAMES(1..4,2)  contains  information from the most recent INTAPE
            command.   FNAMES(1..4,3)  contains  information  from  the  most
            recent OUTAPE command.
0
0
0
 .
 .
                                          3-10
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          3.3.  Program Structure
0
           This  section  describes  the  general  program  structures.   The
           detailed  structure of intermodule references and common block use
           depends on the machine sensitive modules.
0          Both exchange programs  use  a  common  main  program  unit.   The
           responsibilities  of  the  main program unit are described in [2].
           The main program calls a subprogram EXCH.
0
           3.3.1.  Structure of the Simple Program
0
           In the simple program, the subprogram EXCH is the main worker.  It
           is  identified  on  the  program distribution tape as EXCHSP.  The
           remainder of the portable parts of the  simple  program  are  also
           modules  of  the  comprehensive  program,  and  are  described  in
           sections 3.4 and 3.5, and [2].  The subprograms  that  are  called
           directly by EXCH in the simple program are EXCHAH, EXCHFO, EXCHGR,
           EXCHRH and EXCHRT.
0
           3.3.2.  Structure of the Comprehensive Program
0
           In the comprehensive program, the  subprogram  EXCH  is  simply  a
           machine  sensitive interface to the remainder of the program.  The
           responsibilities of EXCH are described in [2].  The  comprehensive
           program is designed to be executable in a small memory.  The major
           functions of the program are controlled by a command decoder.   If
           a  conventional  program  structure were used, the command decoder
           would call each of the subsidiary worker subprograms directly,  as
           needed.   But  the  command decoder is large, and not needed while
           subsidiary workers  are  performing  their  tasks.   By  using  an
           unorthodox  method  for  communication between the command decoder
           and the subsidiary workers, the subsidiary workers may share  main
           memory with the command decoder.
0          When  the  command  decoder  completes  analysis of a command, the
           necessary sequence of  execution  of  the  subsidiary  workers  is
           known.   The  first  step  in  this  sequence is remembered by the
           variable TRANS in the  named  COMMON  block  /EXCHPC/.   When  the
           interface  subprogram  EXCH enters the subprogram EXCHTR, TRANS is
           equal to 1, meaning that the command  decoder  is  to  be  called.
           When  the  command decoder returns to EXCHTR, TRANS has some other
           value.  If TRANS is zero,  EXCHTR  is  to  return.   If  TRANS  is
 .
 .
                                          3-11
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          non-zero, EXCHTR is to call EXCHCj, where j is the value of TRANS.
0          All information necessary for processing the commands is stored in
           named COMMON blocks.  This allows the subsidiary workers  and  the
           command  decoder  to  occupy  the  same  memory space at different
           times.  As the work of the subsidiary workers proceeds,  they  may
           pass  control  from  one to another by changing the value of TRANS
           and returning to EXCHTR.  When the task is complete, the value  of
           TRANS  is changed to 1 and the command decoder is re-entered.  The
           general responsibilities  of  each  subsidiary  worker  are  shown
           below.   The subsidiary workers are described in greater detail in
           section 3.4.
0          Subprogram   Responsibilities
             EXCHC1     Command decoder.
             EXCHC2     Process several simple commands.
             EXCHC3     Open INTAPE and OUTAPE.
             EXCHC4     Supervise SKIP and COPY commands.
             EXCHC5     Create or copy control records.
             EXCHC6     Copy text of modules.
             EXCHC7     Insert or update text.
             EXCHC8     Print error messages.
             EXCHC9     Process the QUIT command.
0          The  services of other subprograms are needed during processing by
           the above nine subprograms.  Some of the service  subprograms  are
           referenced  by  only  one  of the worker subprograms, and some are
           referenced by several workers.  When memory space  is  restricted,
           and  the  program  is therefore segmented, the service subprograms
           that are referenced by only one worker  are  placed  in  the  same
           segment  as  the  worker,  and  the  service  subprograms that are
           referenced by several workers are placed in the resident  segment.
           The  general  responsibilities of the portable service subprograms
           are described below.  The machine  sensitive  service  subprograms
           are described in [2].
0          Subprogram   Responsibilities
             EXCHGB     Get a block of data from an exchange tape.
             EXCHGR     Get a single record of data from an exchange tape.
             EXCHLX     Evaluate  the  logical  expression on a copy command.
                        Referenced only by EXCHC4.
             EXCHNP     Skip to the next module name record.
             EXCHPB     Put a block of data on an exchange tape.
             EXCHPR     Put a single record of data on an exchange tape.
             EXCHRH     Read the label from  an  exchange  tape.   Referenced
                        only by EXCHC3.
             EXCHSC     Scan text to perform compression.
             EXCHTP     Process text records for native format output.
 .
 .
                                          3-12
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0            EXCHTW     Write text records in native format and on printer.
             EXCHWH     Write a label onto an exchange tape.  Referenced only
                        by EXCHC3.
0
0          3.4.  Worker Subprograms
0
0
           3.4.1.  EXCHC1
0
           EXCHC1  performs  most  examination and decoding of commands.  The
           major functions of EXCHC1 are shown below.
           1.  Fetch input using EXCHIM.  Determine whether an  end  of  file
               was sensed in a machine dependent way.
           2.  Identify  requests  to  change   control   records,   transfer
               processing to EXCHC3 via EXCHTR.
           3.  Identify and process comment commands (Asterisk in column  1).
           4.  Find the command word.  Find the modifier.  Find the beginning
               of the parameter.
           5.  If the parameter is omitted, decide whether that is allowed.
           6.  Make sure the command is allowed during the current processing
               phase.
           7.  Perform preliminary  processing  of  the  parameter,  such  as
               converting  a number from a character string representation to
               internal integer representation.
           8.  Process  the  command.  Some commands are processed in EXCHC1.
               Call EXCHCX to perform machine dependent  processing  of  some
               commands.   Transfer  control  to another worker via EXCHTR if
               necessary.
0
           3.4.2.  EXCHC2
0
           EXCHC2  processes IDENTIFY OUTPUT, INDEX, OPTION, PREDICATE, SITE,
           and TITLE commands.  Processing of these  commands  involves  some
           format verification, and storing information in COMMON blocks.
0
           3.4.3.  EXCHC3
0
           EXCHC3  makes  sure  the  input  exchange  tape is open (the label
           processed) before allowing processing of  COPY,  SKIP,  or  UPDATE
 .
 .
                                          3-13
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          commands,  or  requests  to  change control records.  If the input
           exchange tape is defined when a NAME  command  is  processed,  the
           tape  is  opened.   If the output tape is defined, it is opened (a
           label written) if not already open before processing of COPY, NAME
           or  UPDATE  commands  proceeds.   The  information in the label is
           printed at the time a tape is opened.  Control is  transferred  to
           EXCHC4 via EXCHTR to continue processing of COPY or SKIP commands,
           or requests to change control records.  Control is transferred  to
           EXCHC5  via  EXCHTR  to  continue  processing  of  NAME and UPDATE
           commands.
0
           3.4.4.  EXCHC4
0
           EXCHC4 processes requests to  change  control  records,  the  SKIP
           command,   positions   the  input  exchange  tape  for  processing
           requested by a COPY command of  the  first  form,  and  determines
           which  modules are to be processed by a COPY command of the second
           form.  SKIP commands are processed by  calling  EXCHNP  until  the
           desired module has been skipped.
0          The  parameter  of  the  COPY  command is examined and transformed
           before processing continues.  After the format  of  the  parameter
           has  been  verified,  and  the information transformed to internal
           form, the value of ICOMD is changed to -1 for a  COPY  command  of
           the  first  form,  or to -2 for a COPY command of the second form.
           For a COPY command of the first form, the input exchange  tape  is
           positioned  before  the  control  records of the next module to be
           copied, and control is transferred to EXCHC5 via EXCHTR.
0          For a COPY command of the second  form,  the  control  records  of
           modules are examined and the truth of predicates determined.  When
           all control records have been examined, or all  active  predicates
           are true, the logical expression on the COPY command is evaluated.
           If the value of the expression and the command  modifier  indicate
           that  the module is to be copied, control is transferred to EXCHC5
           via  EXCHTR.   Otherwise,  the  next  module  is  examined.   This
           continues until the end of the input exchange tape is encountered,
           or the module number specified  by  the  LIMIT  command  has  been
           processed.   While  the  control  records  of  a  module are being
           examined, they are stored on the file defined by the WORK  command
           or  the  associated  default value.  The number of control records
           stored on the work file is stored in the variable  NRWORK  in  the
           named  COMMON  block  /EXCHPC/.  After the module has been copied,
           control returns to EXCHC4 from EXCHC6 via EXCHTR.   The  value  of
           ICOMD  determines  whether  the parameter is to be examined (ICOMD
           positive), or  a  COPY  command  is  already  in  progress  (ICOMD
 .
 .
                                          3-14
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          negative).
0
           3.4.5.  EXCHC5
0
           EXCHC5  is responsible for copying control records associated with
           modules to be copied as determined by EXCHC4, for copying  control
           records  when  an  UPDATE command changes the program operation to
           the fourth (update) phase, and for creating control  records  from
           information  contained  in  commands during the third (insert) and
           fourth phases of program  execution.   When  control  records  are
           being  copied,  any  control  records  on the work file are copied
           before control records on the input exchange tape are copied.   If
           a  NAME command is submitted when there are control records on the
           work file, the associated module is copied before the insert phase
           is  entered.   After  the control records associated with a module
           have been copied, control is transferred to EXCHC6 via  EXCHTR  to
           copy the text of a module selected by a COPY command, or to EXCHC7
           via EXCHTR to insert or update text during  the  third  of  fourth
           phases of program execution.
0
           3.4.6.  EXCHC6
0
           EXCHC6  copies  text of modules selected by COPY commands.  If the
           text of the module is not to be printed, not to be written on  the
           native  format output file, and an index is not to be printed, the
           boundaries between lines of text need not be recognized.  In  this
           case,  if the position of characters in computer words is the same
           for the input and output exchange tapes, the text  of  the  module
           may  remain  in  the internal representation of the host computer.
           This  method  of  copying  the  text,  called  a  block  copy,  is
           significantly  faster  than  copying  the  text one character at a
           time.  After the text is copied, control is transferred to  EXCHC4
           via  EXCHTR  if  ICOMD is not equal -3.  If ICOMD is equal -3, the
           last module requested by a COPY command of the  second  form  with
           the  I or X modifier has been copied, so control is transferred to
           EXCHC1 via EXCHTR.
0
           3.4.7.  EXCHC7
0
           EXCHC7 is responsible  for  inserting  text  of  new  modules  and
           updating  text  of existing modules.  If a request to include text
           from the file defined by the INCLUDE FILE command  is  encountered
 .
 .
                                          3-15
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          in  the  text  to  be inserted (during either the insert or update
           phase), a special control record (type I) is created.   After  the
           text is processed, control is transferred to EXCHC1 via EXCHTR.
0
           3.4.8.  EXCHC8
0
           EXCHC8 is responsible for printing most error messages.  The error
           message to be printed is determined by the value of  the  variable
           NUMBER  in  the  named COMMON block /EXCHPC/.  Some error messages
           contain numeric information.  Most such numeric information is the
           information  normally  stored  in variables in COMMON blocks.  But
           the  variable  that  indicates  the  status  of  an   input/output
           operation  is  a  local  variable.   The value of this variable is
           transfered to  the  variable  EQUAL  in  the  named  COMMON  block
           /EXCHPC/  before  EXCHC8  is entered.  After the error message has
           been printed, control is  transferred  to  EXCHC1  or  EXCHC9  via
           EXCHTR, depending on the message number.
0
           3.4.9.  EXCHC9
0
           EXCHC9 processes the QUIT command, QUIT commands implied by end of
           file marks sensed in machine dependent  ways,  and  QUIT  commands
           implied  by  the  occurrence  of catastrophic errors.  If the QUIT
           command is sensed in the file defined by the INPUT  FILE  command,
           the  file  is  closed (with rewind if the R modifier is selected),
           and control is transferred to EXCHC1  via  EXCHTR.   If  the  QUIT
           command  is encountered in the file defined by the READER command,
           all open files are  closed  and  control  is  transferred  to  the
           machine dependent interface subprogram EXCH via EXCHTR.
0
           3.5.  Service Subprograms
0
           The  responsibilities  of  the service subprograms EXCHAH, EXCHCG,
           EXCHCX, EXCHFO, EXCHIM, EXCHOU, EXCHPA,  EXCHRT,  EXCHSL,  EXCHUN,
           and  EXCHWT  are  described  in  [2].  There is some redundancy of
           responsibility of the  subprograms  EXCHCX,  EXCHFO,  EXCHIM,  and
           EXCHOU.   These subprograms are sufficiently simple, however, that
           minor machine dependent deviations  from  the  usual  division  of
           responsibility are immediately apparent.
0
0.
 .
                                          3-16
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          3.5.1.  EXCHGB
0
           EXCHGB  is responsible for fetching a block of data from the input
           exchange tape by calling EXCHRT.  When a  block  is  fetched,  the
           nine  characters of structural information in the beginning of the
           block are extracted and examined.  The block  sequence  number  is
           checked, and the variables L1PRGI, L1RECI, and N1RECI in the named
           COMMON block /EXCHIC/ are set.
0
           3.5.2.  EXCHGR
0
           EXCHGR is responsible for fetching a single record from the  input
           exchange  tape.   The  subprograms EXCHGB and EXCHUN are called if
           necessary.  If the record is a  control  record,  some  processing
           depending  on  the  control  record type is performed before it is
           passed to the user.  If the record is a text record, the  variable
           MODEI  in  the  named COMMON block /EXCHIC/ determines whether the
           record is returned to the caller in  compressed  form  or  in  the
           original form.
0
           3.5.3.  EXCHLX
0
           EXCHLX  evaluates  the logical expression on a COPY command of the
           second form.  The logical expression is first converted  to  early
           operator   reverse   Polish   notation  using  a  simple  operator
           precedence parser.  The Polish  representation  is  then  used  to
           evaluate   the   expression.   During  the  conversion  to  Polish
           notation, and during the evaluation of the expression,  the  array
           COMAND  in  the  named COMMON block /EXCHPC/ is used for temporary
           storage.  This does  not  normally  overlap  the  command  storage
           because  commands  are  short, and the scratch space starts at the
           last element of the array and expands into earlier elements.
0
           3.5.4.  EXCHNP
0
           EXCHNP is responsible for  positioning  the  input  exchange  tape
           before  the  next  module name record.  The variable L1PRGI in the
           named COMMON block /EXCHIC/ is used.  If it is zero, a  new  block
           is  fetched  by  calling EXCHGB.  If it is not zero, the character
           position from which to fetch the next character is changed to  the
           value  of L1PRGI.  The module name record must later be fetched by
 .
 .
                                          3-17
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          calling EXCHGR.
0
           3.5.5.  EXCHPB
0
           EXCHPB is used to put a block of data on the output exchange tape.
           The  nine characters of structural information are appended before
           the block is written on the output tape.  The block is written  by
           calling EXCHWT.
0
           3.5.6.  EXCHPR
0
           EXCHPR is used to put a single record on the output exchange tape.
           If the record is a control record, some  processing  dependent  on
           the  control  record  type  is performed.  If the record is a text
           record, the variable MODEO in  the  named  COMMON  block  /EXCHOC/
           indicates  whether the record is compressed or in its normal form.
           If the record is  not  compressed,  EXCHSC  is  called  to  locate
           sequences of redundant occurrences of the character to be removed.
           Data   are   converted   to   the   internal   machine   sensitive
           representation  as  necessary  by calling EXCHPA.  When a block is
           filled, EXCHPB is called.
0
           3.5.7.  EXCHRH
0
           EXCHRH reads the first block  from  the  input  exchange  tape  by
           calling  EXCHRT,  and makes sure it is a label.  If it is a label,
           the variables NDATAI and NERRCI in the named COMMON block /EXCHIC/
           are set to values specified in the label.
0
           3.5.8.  EXCHSC
0
           EXCHSC  scans  text  to  be written on the output exchange tape to
           detect sequences of redundant occurrences of the character  to  be
           removed  to  compress the text.  EXCHSC uses only calling sequence
           variables, and may  therefore  be  useful  in  other  applications
           without change.
0
0
 .
 .
                                          3-18
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          3.5.9.  EXCHTP
0
           EXCHTP  processes  text  before it is written on the native format
           output file or printed.   The  tasks  of  EXCHTP  are  to  replace
           requests  to  include  text from the file specified by the INCLUDE
           FILE command by the identified text, and to insert  identification
           requested by the IDENTIFY OUTPUT command.
0
           3.5.10.  EXCHTW
0
           EXCHTW decides whether a text image is to be written on the native
           format output file, and if so calls EXCHOU.  Then the  text  image
           is printed if the appropriate listing option is selected.
0
           3.5.11.  EXCHWH
0
           EXCHWH  writes  a  label  on  the  output exchange tape by calling
           EXCHWT.
0
0
0
0
0
0
0
0
0
0
0
0
0.
 .
                                          3-19
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          4.  Suggesting Changes to the TES
0
           Several  extensions  have  been  proposed  to  the  TES.   Changes
           affecting   the   use   of  the  program  are  discussed  in  [1].
           Suggestions for changes to the TES should be reported to:
0              W. V. Snyder
               Mail Stop 125-128
               Jet Propulsion Laboratory
               Pasadena, CA 91103
0              Telephone 213/354-6271, or FTS 792-6271.
0          * Split the common block  EXCHPC  into  several  pieces,  so  that
             common variables are accessible only in subprograms where access
             is necessary.
0          * Provide an internal option to produce native format  output  and
             fetch  native  format input using reverse communication with the
             machine specific main program.  This would  allow  the  exchange
             program to be used as a subroutine of another program.
0          * Require  the  machine  sensitive  main  program  to  inform  the
             portable subprograms of the amount of space  allocated  for  the
             input  tape buffer.  EXCHRH could then insure that data from the
             input exchange tape is not placed outside the allocated space by
             examining  this  number and the numbers NDATAI, NERRCI and NWCBI
             after reading a label.
0
0
0
0
0
0
0
0
0
0.
 .
                                          4-1
1
                                  Text Exchange System
 .
 .
                                  Program Descriptions
0          5.  References
0
           1.  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.
           2.  W.  V.  Snyder  and  R.  J.  Hanson,  "Text  Exchange  System,
               Installation  Instructions and Description of System Dependent
               Variants," Jet Propulsion Laboratory internal document  number
               1846-109.
           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, 1977.
           5.  "Sperry Univac 1100 Executive  System  Programmer  Reference,"
               Sperry Univac document number UP-4144, Volume 3.
           6.  "VAX/VMS System Services Reference Manual," Digital  Equipment
               Corporation   document  number  AA-D018B-TE,  March  1980,  pp
               142-143.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                          5-1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0
           1.  Abstract                                                   1-1
0          2.  Tape Format                                                2-1
               2.1.  Tape Label Format                                    2-1
               2.2.  Data Block Format                                    2-2
               2.3.  Text Record Format                                   2-2
               2.4.  Control Record Format                                2-3
               2.5.  Text Module Format                                   2-4
0          3.  Program Description                                        3-1
               3.1.  Common Blocks Used by the Portable Subprograms       3-1
               3.1.1.  Named COMMON /EXCHIC/                              3-1
               3.1.2.  Named COMMON /EXCHOC/                              3-2
               3.1.3.  Named COMMON /EXCHPC/                              3-3
               3.1.4.  Named COMMON /EXCHUC/                              3-6
               3.1.5.  Named COMMON /EXCHXC/                              3-7
               3.2.  Common Blocks Used by Machine Sensitive Versions     3-7
               3.2.1.  Common Blocks Used by Univac-1100 Subprograms      3-7
               3.2.1.1.  Named COMMON /EXEC8/                             3-7
               3.2.1.2.  Named COMMON /EXEC8A/                            3-8
               3.2.2.  Common Block Used by CDC 6000/7000 Subprograms     3-8
               3.2.3.  Common Block Used by DEC PDP-10 Subprograms        3-9
               3.2.4.  Common Block Used by DEC PDP-11 Subprograms        3-9
               3.2.5.  Common Block used by the DEC VAX/VMS Subprograms  3-10
               3.2.5.1.  Named COMMON /EXCVAX/                           3-10
               3.2.6.  Common Block used by Sperry V-70 Subprograms      3-10
               3.3.  Program Structure                                   3-11
               3.3.1.  Structure of the Simple Program                   3-11
               3.3.2.  Structure of the Comprehensive Program            3-11
               3.4.  Worker Subprograms                                  3-13
               3.4.1.  EXCHC1                                            3-13
               3.4.2.  EXCHC2                                            3-13
               3.4.3.  EXCHC3                                            3-13
               3.4.4.  EXCHC4                                            3-14
               3.4.5.  EXCHC5                                            3-15
               3.4.6.  EXCHC6                                            3-15
               3.4.7.  EXCHC7                                            3-15
               3.4.8.  EXCHC8                                            3-16
               3.4.9.  EXCHC9                                            3-16
               3.5.  Service Subprograms                                 3-16
               3.5.1.  EXCHGB                                            3-17
               3.5.2.  EXCHGR                                            3-17
               3.5.3.  EXCHLX                                            3-17
               3.5.4.  EXCHNP                                            3-17
               3.5.5.  EXCHPB                                            3-18
               3.5.6.  EXCHPR                                            3-18
               3.5.7.  EXCHRH                                            3-18
 .
 .
                                           1
1
                                  Text Exchange System
 .
 .
                                   Table of contents
0              3.5.8.  EXCHSC                                            3-18
               3.5.9.  EXCHTP                                            3-19
               3.5.10.  EXCHTW                                           3-19
               3.5.11.  EXCHWH                                           3-19
0          4.  Suggesting Changes to the TES                              4-1
0          5.  References                                                 5-1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 .
 .
                                           2
1
