John Forkosh Associates ®
A r c s C o m m   D e s i g n   D o c u m e n t
Copyright © 1986-2001, John Forkosh Associates, Inc.
All rights reserved.

Click for:   homepage,   resume




   -----------------------------------------------------------------------
                         A R C S c o m m / P h o e n i x
	    (Automated ARCS-to-Phoenix Customer File Update Facility)

			   Detail Design Specification

			Revision 1.00	  27 January 1986
   -----------------------------------------------------------------------


			     Document ID: JFA-86-017
   Copyright (c) 1986, John Forkosh Associates, Inc.  All rights reserved.


               Submitted to		     	     Submitted by             
               ------------		     	     ------------             
   Citicorp Int'l Communications, Inc.	     John Forkosh Associates, Inc.
       111 Wall Street, 17th Floor	       285 Stegman Parkway #309  
	    New York, NY 10043		         Jersey City, NJ 07305   
					             (201) 860-9677      

				       ---

     ARCScomm/Phoenix Detail Design				   Page 2
     Table of Contents

			 T A B L E  O F  C O N T E N T S
			 -------------------------------
	I. Introduction
	   1  Identification .........................................	3
	   2  Purpose of Document ....................................	3
	   3  Applicable Documents ...................................	3
	   4  Implementation Scope for Release 1.00 ..................	4
	   5  Future Implementations .................................	4

       II. System Overview
	   1  Major Components and Subsystems ........................	5
	   2  High-Level Structure Chart .............................	5

      III. DCL Shell / User Interface
	   1  Structure Chart ........................................	6
	   2  Function Descriptions ..................................	7

       IV. ARCSupdt: Driver and Application Modules
	   1  Structure Chart ........................................ 12
	   2  Function Descriptions .................................. 13

	V. ARCScomm: DECnet or Magtape Interface to ARCS File
	   (consisting of ARCSclnt and ARCSsrvr subsystems)
	   1  Structure Chart ........................................ 20
	   2  Function Descriptions .................................. 21

       VI. ARCSphnx: Interface to Phoenix Customer File
	   (consisting of PHNXclnt and a DBSA interface provided by CICI)
	   1  Function Descriptions .................................. 24

      VII. Screen and Report Formats
	   1  DCL Screens ............................................ 35
	   2  Validation Screens ..................................... 39
	   3  Audit Trail Report Format .............................. 41

     VIII. Data Dictionary
	   1  VMS Logicals ........................................... 43
	   2  Internal ARCSupdt Data Elements and Structures ......... 47
	   3  Relevant Phoenix DBSA Data Elements and Structures ..... 54
	   4  ARCScomm Data and Message Formats ...................... 56

     Appendices
	   A  Migration and Installation Procedures .................. 59
	   B  Source Code ............................................ 79

     ARCScomm/Phoenix Detail Design				   Page 3
     Section I: Introduction



				 I. Introduction
				 ---------------


	I.1   Identification

		o  Title:    ARCScomm/Phoenix - Automated ARCS-to-Phoenix
			     Customer File Update Facility, Release 1.00

		o  Mnemonic: ARCScomm/Phoenix-1.00

		o  Document ID: JFA-86-017

		o  Revision History:
		   01/23/86  J.Forkosh	    Initial Release.


	I.2   Purpose of Document

	      This document contains all design information necessary for
	      the coding/implementation of ARCScomm/Phoenix Release 1.00.
	      Included are:

		o  High-level structure charts for the system as a whole,
		   and for the subsystems in more detail.

		o  Function descriptions for each module (including the
		   ARCS-to-Phoenix interface being built by CICI).

		o  Screen and report layouts for the DCL shell user
		   interface and update verification screens, and for the
		   audit trail update report.

		o  Data dictionary for the major data elements and
		   structures, and message formats for ARCScomm-to-ARCS
		   sever/client communication.


	I.3   Applicable Documents

		o  Proposal to Implement ARCScomm/Phoenix, 13 Sept 1985.

		o  Phoenix Useit Design Specification (full title and
		   publication date unknown), CICI

		o  Phoenix Functional Specification Issue A, 5 June 1985,
		   CICI (Chapter 7 and Appendix A)

		o  Phoenix Implementation Specification User Interface
		   Document, 11 Dec 1985, CICI (Sections I and III)
  
     ARCScomm/Phoenix Detail Design				   Page 4
     Section I: Introduction



	I.4   Implementation Scope for Release 1.00

	      The scope of Release 1.00 is detailed in JFA's Proposal to
	      Implement ARCScomm/Phoenix, Sections 3, 4, 6 and 7.  To help
	      focus the reader, the major functional features are
	      summarized in bullet form below:

		o  Updates: The primary functional component reconciles
		   ARCS and Phoenix data by comparing customer records on
		   both machines.  Failure to reconcile will either cause
		   an updated Phoenix record to be rewritten, or cause a
		   new customer to be added.

		o  DECnet or Magtape: Updates can be executed either
		   remotely from the ARCS machine (VODKA) across a DECnet
		   link, or directly on Phoenix by first copying the ARCS
		   database from magtape.

		o  Validation: Updates can either execute automatically
		   without user intervention, or each potential update can
		   be displayed for user validation.

		o  Partial Updates: If ARCS does not contain all required
		   Phoenix customer fields, then updates will proceed
		   properly, but only reconcile those fields common to
		   both files.

		o  Audit Trail: A formatted report of all executed updates
		   will be produced.


	I.5   Future Implementations

	      Several CitiSwitches may eventually be accompanied by
	      value-added Phoenix slaves, each maintaining a local
	      customer file with its own unique subset of the ARCS master
	      routing file.  To support the different functional
	      requirements of several Phoenix machines, the ARCScomm
	      ARCS/Phoenix subsystem (see Section II.1 and Section V) can
	      be upgraded to recognize each machine and modify its dialog
	      accordingly.
 
     ARCScomm/Phoenix Detail Design				   Page 5
     Section II: System Overview



			       II. System Overview
			       -------------------


       II.1   Major Components and Subsystems

	      ARCScomm/Phoenix consists of four (4) major functional
	      components that are broken out into separate sections of
	      this document to facilitate a top-down view of the system.
	      These four subsystems comprise:

		o  DCL Shell / User Interface.	The user will login to an
		   account (e.g., Username=ARCSUPDT, Password=ARCSUPDT)
		   whose "LOGIN.COM" file will establish a captive session
		   and prompt the user for all necessary information
		   (e.g., DECnet or magtape update) and then run ARCSupdt.

		o  ARCSupdt: Driver and Application Modules.  Drives the
		   reconciliation/update process by retrieving all
		   recently-updated ARCS records, comparing them with
		   Phoenix customer records, prompting the user for
		   validation, etc.

		o  ARCScomm: DECnet (or Magtape) Interface to ARCS File.
		   Consists of a server process residing on the ARCS
		   machine and a client process on Phoenix that allow
		   records from the ARCS file to be requested and
		   retrieved.

		o  ARCSphnx: Interface to Phoenix Customer File.  Provides
		   a gateway to the Phoenix TMX DBSA for Phoenix customer
		   file I/O.


       II.2   High-Level Structure Chart
						 PHOENIX machine (FTNDEV)
				  +-------------------------------------+
				  |			  +-----------+ |
       ARCS machine (VODKA)	  |+---------+ +--------+ |Application| |
      +--------------------+	  ||DCL Shell|-|ARCSupdt|-|  Modules* | |
      |      +----------+  |DECnet|+---------+ +---+-+--+ +-----------+ |
      |      | ARCSsrvr |==+---/  |  +----------+  | |	+----------+	|
      |      +----------+  |  /---+==| ARCSclnt |--+ +--| PHNXclnt |	|
      |  +---------+ |	   |	  |  +-------+--+	+--+-+-----+	|
      |  | Layout# |-+	   |	  |	     | +---------+ | | +------+ |
      |  +---------+ |	   |	  |	     +-| Layout# |-+ +-| DBSA | |
      +--------------+-----+	  |	       +---------+     +---|--+ |
		     |		  +--------------------------------+----+
	     ------------    *e.g., reconciliation routine.	   |
	     ROUTE-MASTER    #Layout refers to file and      -----------
	     and CITY-TBL     record format tables that       CUST-FILE
	     ------------     describe database records      -----------
				and internal messages.

     ARCScomm/Phoenix Detail Design				   Page 6
     Section III: DCL Shell / User Interface



			 III. DCL Shell / User Interface
			 -------------------------------


      III.1   Structure Charts *

     a: on PHOENIX and ARCS  b: on PHOENIX only    c: on ARCS and PHOENIX
     (for tape transfers)    (to run update)	   (as DECnet target)

       USERNAME: ARCSPHNX    USERNAME: ARCSUPDT    USERNAME: ARCSSRVR
       ---------+--------    ---------+--------    ---------+--------
		|		      | 		    |
		|		      | 		    |
	+-------+------+      +-------+------+	    +-------+------+
	|  LOGphnx.COM |      |  LOGupdt.COM |	    |  LOGsrvr.COM |
	+-------+------+      +-------+------+	    +-------+------+
		|		      | 		    |
		|		      | 		    |
	+-------+------+      +-------+------+	    +-------+------+
	| ARCSupdt.COM |      | ARCSupdt.COM |	    | ARCSsrvr.COM |
	+--------------+      +-------+------+	    +-------+------+
				      | 		    |
				      | 		    |
			      +-------+------+	    +-------+------+
			      | ARCSupdt.EXE |	    | ARCSsrvr.EXE |
			      +--------------+	    +--------------+


     *	 Note that the DCL procedures for the ARCScomm/Phoenix system
	 consist of three separate paths (actually five, if you count
	 ARCSPHNX and ARCSSRVR paths twice since they each reside on both
	 ARCS and PHOENIX machines).  Which path you take depends on the
	 USERNAME under which you login.  A brief explanation of the
	 purpose for each path is as follows -

      a: Operators use Account ARCSPHNX to copy the ARCS database via
	 magtape to the PHOENIX machine.  First they login as ARCSPHNX on
	 ARCS and create a magtape.  Then they login again as ARCSPHNX,
	 but on PHOENIX, and copy the tape to disk.

      b: The Phoenix Manager uses Account ARCSUPDT to perform updates.
	 This should usually be the most frequently used account.

      c: Account ARCSSRVR is never used by a person.  The ARCSupdt program
	 (running on PHOENIX) uses this account to communicate across
	 DECnet with the ARCSsrvr program (running on ARCS).

     ARCScomm/Phoenix Detail Design				   Page 7
     Section III: DCL Shell / User Interface



      III.2   Function Descriptions

	      The DCL Shell / User Interface consists of four command
	      files:

		o  LOGUPDT.COM is the login command procedure invoked by
		   Account ARCSUPDT (i.e., USERNAME: ARCSUPDT).  It
		   immediately runs the ARCSUPDT.COM procedure, passing it
		   parameter P1=DBSA which identifies the user as a DBSA
		   administrator allowed to run the update procedure.

		o  LOGPHNX.COM is invoked by Account ARCSPHNX.	It also
		   runs ARCSUPDT.COM, passing it P1=ARCS or P1=PHNX
		   depending on machine.  In both cases the user is
		   identified as an operator who will either backup or
		   restore the ARCS database.  In the ARCS case, the
		   operator is allowed to backup, in the PHNX case to
		   restore.

		o  LOGSRVR.COM is invoked by Account ARCSSRVR, and simply
		   invokes ARCSSRVR.COM which then simply runs
		   ARCSSRVR.EXE.  This procedure is required by DECnet
		   transparent task-to-task communication.  No person
		   should ever login as Account ARCSSRVR.  This account is
		   intended as the DECnet target of the client task
		   running on Phoenix.

		o  ARCSUPDT.COM is the actual DCL shell user interface,
		   run by the login command procedures LOGUPDT.COM and
		   LOGPHNX.COM above.  It displays one of three menus
		   depending on the parameter passed in P1, and then
		   guides the user through the corresponding sequence of
		   functionality.  P1=DBSA identifies the Phoenix DBSA
		   administrator who runs the actual update program.
		   P1=ARCS or PHNX identifies an operator who runs magtape
		   backup or restore, respectively, of the ARCS database.

	      The Function Description Sheets comprising the remainder of
	      this section define the "calling sequences" of these command
	      procedures.  They are not as explicitly relevant for command
	      procedures as corresponding documentation for the "C" and
	      Fortran programs, but are provided for completeness.

     ARCScomm/Phoenix Detail Design				   Page 8
     Section III: DCL Shell / User Interface



		   PROCEDURE DESCRIPTION

     NAME:	   LOGUPDT

     PURPOSE:	   This is the login command procedure (lgicmd=LOGUPDT)
		   invoked by Account ARCSUPDT.  It runs the
		   ARCScomm/Phoenix DCL shell user interface ARCSUPDT.COM
		   and logs out upon return.  ARCSUPDT is passed the
		   parameter P1=DBSA indicating that the Phoenix DBSA
		   Administrator main menu and corresponding functionality
		   should be executed.

     CALL:	   No calling sequence required.  Invoked by VMS when the
		   user logs in.

     ARGUMENTS:    - none

     RETURNS:	   - none

     NOTES:
		   This procedure resides on the Phoenix machine only.

     SOURCE:	   LOGUPDT.COM

     ARCScomm/Phoenix Detail Design				   Page 9
     Section III: DCL Shell / User Interface



		   PROCEDURE DESCRIPTION

     NAME:	   LOGPHNX

     PURPOSE:	   This is the login command procedure (lgicmd=LOGPHNX)
		   invoked by Account ARCSPHNX.  It runs the
		   ARCScomm/Phoenix DCL shell user interface ARCSUPDT.COM
		   and logs out upon return.  ARCSUPDT is passed the
		   parameter P1=ARCS on the ARCS machine or P1=PHNX on the
		   Phoenix machine, indicating that the operator main menu
		   and corresponding functionality should be executed.
		   This consists of magtape backup of the ARCS database on
		   ARCS and restore on PHOENIX.

     CALL:	   No calling sequence required.  Invoked by VMS when the
		   user logs in.

     ARGUMENTS:    - none

     RETURNS:	   - none

     NOTES:
		   This procedure resides on both ARCS and Phoenix
		   machines.  ARCSUPDT is invoked with the literal "ARCS"
		   on the ARCS machine and "PHNX" on the Phoenix machine.

     SOURCE:	   LOGPHNX.COM

     ARCScomm/Phoenix Detail Design				   Page 10
     Section III: DCL Shell / User Interface



		   PROCEDURE DESCRIPTION

     NAME:	   LOGSRVR

     PURPOSE:	   This is the login command procedure (lgicmd=LOGSRVR)
		   invoked by Account ARCSSRVR.  It runs the Fortran
		   server program ARCSSRVR.EXE.

     CALL:	   No calling sequence required.  Invoked by VMS when the
		   user logs in.

     ARGUMENTS:    - none

     RETURNS:	   - none

     NOTES:
		   This procedure resides on both ARCS and Phoenix
		   machines.  Which version is invoked by ARCSUPDT.EXE
		   depends on how the logical TASK is defined.	The
		   general form is:

	      $ DEFINE TASK "node""ARCSSRVR password""::""TASK=ARCSSRVR"""

		   where 'node' refers to the DECnet node name for either
		   ARCS or PHOENIX.

     SOURCE:	   LOGSRVR.COM

     ARCScomm/Phoenix Detail Design				   Page 11
     Section III: DCL Shell / User Interface



		   PROCEDURE DESCRIPTION

     NAME:	   ARCSUPDT

     PURPOSE:	   This is the DCL shell user interface for
		   ARCScomm/Phoenix, invoked by the login command
		   procedures LOGUPDT.COM and LOGPHNX.COM described
		   above.  It establishes a user-friendly, menu-driven
		   captive session that guides the user through
		   appropriate functionality (i.e., updating for DBSA
		   administrator, tape backup/restore for operator).

     CALL:	   $ @ARCSUPDT "type-of-user"

     ARGUMENTS:
		   type-of-user (I)	    Either "DBSA" for performing
					    updates, or "ARCS" or "PHNX"
					    for tape backup/restore,
					    respectively.  Any other value
					    causes ARCSUPDT to exit
					    immediately.

     RETURNS:	   - none

     NOTES:
		   This procedure resides on both ARCS and Phoenix
		   machines.  Only the "DBSA" and "PHNX" options are
		   invoked on the Phoenix machine, and only "ARCS" on
		   ARCS.  In this case one large procedure with options
		   was considered preferable to three smaller procedures
		   for several reasons:
		     o	much of the functionality (and code) is common to
			all options,
		     o	various logicals must be defined consistently
			regardless of option,
		     o	a seamless interface is easier to maintain with
			only a single entry point.

     SOURCE:	   ARCSUPDT.COM

     ARCScomm/Phoenix Detail Design				   Page 12
     Section IV: ARCSupdt



		  IV. ARCSupdt: Driver and Application Modules
		  --------------------------------------------


       IV.1   Structure Chart

				   +--------+
				   |ARCSupdt|
				   +---+----+
	    * (see Note) *	       |
	    +------------+-------------+-------------+-------------+
	    |		 |	       |	     |		   |
	+---+----+   +---+----+   +----+----+	+----+----+   +----+---+
	|ARCSclnt|   |PHNXclnt|   |ARCSproof|	|ARCSvalid|   |ARCSrpt |
	+--+-----+   +---+----+   +---------+	+---------+   +--------+
	   |		 |
	DEC|/|net	 TMX Gateway
	     |			   |
	+----+---+	      +----+-----------------------------------+
	|ARCSsrvr|------+     | GATEWAY-INITIALIZE-PROCESS	       |
	+--------+	|     | 	-BEGIN-TRANSACTION-SESSION     |
	    |		|     | 	 -WRITE-TO-GENERIC-LOG	       |
      +------------+	|     | 	  -COMMIT-TRANSACTION-SESSION  |
      |ARCScomm-msg|	|     | (nine	   -CANCEL-TRANSACTION-SESSION |
      +------------+	|     |   entry     -SHUTDOWN-PROCESS	       |
	    |		|     |    points)   -READ-CUSTOMER	       |
      +------------+	|     | 	      -WRITE-INITIAL-CUSTOMER  |
      |READcity-tbl|-+	|     | 	       -UPDATE-CUSTOMER        |
      +------------+ |	|     +----+-----------------------------------+
		     |	|	   |
	      --------	---------  ---------
	      CITY-TBL	ROUTE-MST  CUST-FILE
	      --------	---------  ---------


     *Note:   The ARCSclnt/ARCSsrvr subsystem is described in more detail
	      in Section V, and the PHNXclnt/TMX-Gateway in Section VI.
	      Function descriptions for ARCSclnt and PHNXclnt are included
	      in this section.	Function descriptions "below" them are in
	      Sections V and VI, respectively.	But all the functions are
	      shown on this chart to give you an overall feel for
	      connections between the various components.

     ARCScomm/Phoenix Detail Design				   Page 13
     Section IV: ARCSupdt



       IV.2   Function Descriptions

	      The Function Description Sheets comprising this section
	      define the ARCSupdt main driver and the application routines
	      that it calls.  These are ARCSclnt, PHNXclnt, ARCSproof,
	      ARCSvalid and ARCSrpt as indicated on the structure chart
	      above.  Note that ARCSclnt is also discussed in Section V on
	      the ARCS/Phoenix interface, and that PHNXclnt is also
	      discussed in Section VI on the Phoenix/TMX/Cust-File
	      interface.

     ARCScomm/Phoenix Detail Design				   Page 14
     Section IV: ARCSupdt



		   PROGRAM DESCRIPTION

     NAME:	   ARCSUPDT

     PURPOSE:	   Main routine for the ARCScomm/Phoenix Automated
		   ARCS-to-Phoenix Update Facility.  It drives the
		   reconciliation/update process by doing the following:
		   1)	retrieving all recently-updated ARCS records by
			calling ARCSclnt,
		   2)	retrieving the corresponding Phoenix cust-file
			record (if there is one) by calling PHNXclnt,
		   3)	reconciling the two records by calling ARCSproof,
		   4)	requesting user validation (if required) by
			calling ARCSvalid,
		   5)	rewriting (or writing an initial record) by
			another call to PHNXclnt,
		   6)	maintaining an audit trail report by calling
			ARCSrpt.
		   Various additional housekeeping activities are also
		   performed, but the above six steps outline the major
		   functional components required for update processing.

     CALL:	   $ arcsupdt "date-of-last-update" "flow-control"
		   (Note: $arcsupdt := $device:[]arcsupdt.exe must be
		   installed as a foreign command to allow passing
		   command-line arguments.)

     ARGUMENTS:
		   date-of-last-update (I)  six chars in the form YYMMDD
					    indicating the last update
					    date (i.e., the dup field from
					    the last ARCS record
					    processed, but in the YYMMDD
					    form rather than MMDDYY as
					    stored)

		   flow-control (I)	    two chars, either YY, NN, YN
					    or NY indicating
					    validation/navigation control.

     RETURNS:	   - none

     NOTES:
		   The foreign command and command-line arguments are set
		   up by the ARCSupdt.COM DCL shell in response to menu
		   replies by the user.  Date-of-last-update is maintained
		   in an RMS file ARCSUPDT.DUP.  Flow-control normally
		   defaults to NN.

     SOURCE:	   ARCSUPDT.C

     ARCScomm/Phoenix Detail Design				   Page 15
     Section IV: ARCSupdt



		   FUNCTION DESCRIPTION

     NAME:	   ARCSCLNT

     PURPOSE:	   Issues requests across DECnet to the ARCSSRVR server
		   task running on the ARCS machine (VODKA).  Each request
		   retrieves a record from the ROUTE.MST master routing
		   file (city name comes from CITY.TBL), and passes it
		   back to ARCSUPDT for further processing.

     CALL:	   arcsclnt ( request, reply, nbytes )

     ARGUMENTS:
		   request (I)		    addr of char string containing
					    either a 6-char string in the
					    form YYMMDD for dup key to be
					    retrieved, or the 4-char
					    literal NEXT (note: may also
					    be OPEN or CLOSE to open/close
					    the DECnet link).

		   reply (O)		    addr of char string returning
					    image of retrieved record
					    (note that ARCSUPDT unions
					    this char string with a
					    structure that defines the
					    record format).

		   nbytes (O)		    addr of int returning number
					    of bytes in reply (you may
					    check nbytes on return to try
					    to verify that no unnoticed
					    change in message format has
					    occurred).

     RETURNS:	   - int
		   RMS$-NORMAL		    Operation successful,
		   RMS$-QUO		    Couldn't open/close DECnet
					    link,
		   RMS$-FTM		    Couldn't write request,
		   RMS$-NET		    Couldn't read reply.

     NOTES:
		   To OPEN the DECnet link, the logical TASK must be
		   defined as follows prior to calling ARCSclnt:
	      $ DEFINE TASK "node""ARCSSRVR password""::""TASK=ARCSSRVR"""
		   where node is the DECnet node name of the ARCS machine
		   (usually VODKA).

     SOURCE:	   ARCSCLNT.C

     ARCScomm/Phoenix Detail Design				   Page 16
     Section IV: ARCSupdt



		   FUNCTION DESCRIPTION

     NAME:	   PHNXCLNT

     PURPOSE:	   Issues requets for CUST-FILE I/O through TMX to the
		   Phoenix DBSA.

     CALL:	   phnxclnt ( request, parg, pdata )

     ARGUMENTS:
		   request (I)		    addr of char string containing
					    a mnemonic for the DBSA
					    operation to be performed (see
					    table below).

		   parg (I/O)		    addr of char string containing
					    argument appropriate for
					    request (see table below).

		   pdata (I/O)		    addr of process data struct
					    (see pdata.h) containing
					    cust-data, etc, used for
					    communicating with DBSA.

     RETURNS:	   - int
		   to be determined

     NOTES:
		   Requests to the DBSA mediated by PHNXclnt include the
		   following:
		   request (I)	  parg (I/O*)	 operation description
		   -----------	  -----------	 ---------------------
		   (1) INIT	  process name	 Initialize Process
		   (2) BEGIN	  < unused >	 Begin Transaction
		   (3) WRTLOG #   applic. msg.	 Write to Generic Log
		   (4) COMMIT	  < unused >	 Commit Transaction
		   (5) CANCEL	  < unused >	 Cancel Transaction
		   (6) SHUTDN	  shutdown msg*  Shutdown Process
		   (7) RDCUST #   route code	 Read Customer
		   (8) WRCUST #   route code	 Write Initial Customer
		   (9) UPCUST #   route code	 Update Customer

		   # required BEGIN and COMMIT are done within Phnxclnt,
		   * denotes an output field

     SOURCE:	   PHNXCLNT.C

     ARCScomm/Phoenix Detail Design				   Page 17
     Section IV: ARCSupdt



		   FUNCTION DESCRIPTION

     NAME:	   ARCSPROOF

     PURPOSE:	   Reconciles a Phoenix customer record with an ARCS
		   message.

     CALL:	   arcsproof ( opcode, arcsmsg, pdata, prfflds )

     ARGUMENTS:
		   opcode (I)		    addr of char string containing
					    "COMP"    to compare only,
					    "COPY"    to compare and move
						      updated fields from
						      acrsmsg to pdata,
					    "INIT"    to move all fields
						      (no compare).

		   arcsmsg (I)		    addr of char string containing
					    message returned by ARCSsrvr.

		   pdata (I/O)		    addr of pdata struct
					    containing static and dynamic
					    customer data to be proofed,
					    and returning updated data
					    when opcode=COPY or INIT.

		   prfflds (O)		    addr of int vector returning
					    sequence numbers (see
					    ARCSCOMM.H, e.g., 1=GCN, etc)
					    of fields not proofing.

     RETURNS:	   - int		    number of fields not proofing
					    (number of ints in prfflds),
					    zero means no update required.

     NOTES:
		   arcsmsg fields containing the PHNX-FILLER character '?'
		   in all bytes indicate that ROUTE-MST does not maintain
		   them.  These fields are not proofed by ARCSproof -
		   i.e., they are neither reported in prfflds nor updated
		   in pdata.

		   The "C" library function strncmp is used to compare
		   fields.  Strncmp treats a NULL as a string terminator,
		   so no field to be proofed may contain NULLs.

     SOURCE:	   ARCSPROOF.C

     ARCScomm/Phoenix Detail Design				   Page 18
     Section IV: ARCSupdt



		   FUNCTION DESCRIPTION

     NAME:	   ARCSVALID

     PURPOSE:	   Displays a validation screen containing all
		   non-proofing fields, and prompts the user for
		   permission to perform the update.

     CALL:	   arcsvalid ( arcsmsg, pdata, nprf, prfflds, reply )

     ARGUMENTS:
		   arcsmsg (I)		    addr of char string containing
					    message returned by ARCSsrvr.

		   pdata (I)		    addr of pdata struct
					    containing static and dynamic
					    customer data that presumably
					    didn't proof upon a previous
					    call to ARCSproof.

		   nprf (I)		    number of fields that didn't
					    proof.

		   prfflds (I)		    addr of int vector containing
					    sequence numbers (see
					    ARCSCOMM.H, e.g., 1=GCN, etc)
					    of fields that didn't proof.

		   reply (O)		    addr of char string returning
					    user command:
					    "OK" ok, perform this update,
					    "NG" no good, don't update,
					    "BY" goodbye, abort job
						 keeping all updates
						 already performed (but
						 not the current one),
					    "GO" go, continue updating
						 without any more
						 validation.

     RETURNS:	   - none

     SOURCE:	   ARCSVALID.C

     ARCScomm/Phoenix Detail Design				   Page 19
     Section IV: ARCSupdt



		   FUNCTION DESCRIPTION

     NAME:	   ARCSRPT

     PURPOSE:	   Writes the audit trail update report.  Each call adds
		   another updated record to the end of the report.

     CALL:	   arcsrpt ( rptptr, arcsmsg, pdata, nprf, prfflds )

     ARGUMENTS:
		   rptptr (I)		    addr of FILE struct to the
					    report file, as returned by
					    fopen().

		   arcsmsg (I)		    addr of char string containing
					    message returned by ARCSsrvr.

		   pdata (I)		    addr of pdata struct
					    containing static and dynamic
					    customer data that presumably
					    didn't proof upon a previous
					    call to ARCSproof.

		   nprf (I)		    number of fields that didn't
					    proof.

		   prfflds (I)		    addr of int vector containing
					    sequence numbers (see
					    ARCSCOMM.H, e.g., 1=GCN, etc)
					    of fields that didn't proof.

     RETURNS:	   - none

     SOURCE:	   ARCSRPT.C

     ARCScomm/Phoenix Detail Design				   Page 20
     Section V: ARCScomm



	     V. ARCScomm: DECnet or Magtape Interface to ARCS Files
	     ------------------------------------------------------


	V.1   Structure Chart

     +----------+
     | ARCSupdt |---+
     +----------+   |
		    |		  "dup key" or "NEXT"
		    |		 +---------------------------+
		    |		 |			     |
	      +-----+----+ DECnet|  +-------------+	     |
	      | ARCSclnt |----/--+--| LOGsrvr.COM |	     |
	      +-----+----+    "OPEN"+------+------+          |
		    |			   |		     |
		    |		    +------+------+    +-----+----+
		    |		    | ARCSsrvr.COM|----| ARCSsrvr |-----+
		    |		    +-------------+    +-----+----+	|
	  /---------+--------\				     |		|
	  | Record / Message |			     +--------------+	|
	  |    formats in    +-----------------------| ARCScomm-msg |	|
	  |    ARCSCOMM.H    |			     +--------------+	|
	  \------------------/				     |		|
						     +--------------+	|
						 +---| READcity-tbl |	|
						 |   +--------------+	|
						 |			|
						----------     -----------
						 CITY-TBL	ROUTE-MST
						----------     -----------


	 Note:	   The target node of the DECnet connection established by
		   the "OPEN" command to ARCSclnt is determined by the
		   TASK logical.  This logical must be defined before
		   running ARCSupdt by a DCL statement of the form:

	      $ DEFINE TASK "node""ARCSSRVR password""::""TASK=ARCSSRVR"""

		   When 'node' is VODKA, then ARCSupdt will connect to the
		   ARCS machine and updates will be driven by the ARCS
		   online database.  When 'node' is FTNDEV, updates will
		   be driven by a copy of the database residing on the
		   Phoenix machine (presumably copied there via magtape
		   operations).

     ARCScomm/Phoenix Detail Design				   Page 21
     Section V: ARCScomm



	V.2   Function Descriptions

	      Tne Function Description Sheets comprising this section
	      define the interface between ARCSupdt (residing on the
	      Phoenix machine STAR1) and the ARCS master routing file
	      ROUTE.MST (residing either on the ARCS machine VODKA, or
	      copied by magtape to Phoenix and residing on STAR1).

	      The ARCScomm interface also defines an internal format for
	      transferring ARCS records to Phoenix, which is closely
	      related to but independent of both ARCS and Phoenix file
	      formats.	This permits local ARCS changes to be transparent
	      to the Phoenix update procedure, and vice versa.

	      The principal feature of ARCScomm's implementation is the
	      use of transparent task-to-task DECnet communication between
	      ARCSclnt on Phoenix and ARCSsrvr on ARCS.  Specific syntax
	      is important when using these DECnet facilities.	Therefore,
	      the function descriptions are augmented with precise syntax
	      where appropriate.

     ARCScomm/Phoenix Detail Design				   Page 22
     Section V: ARCScomm



		   FUNCTION DESCRIPTION

     NAME:	   ARCSCLNT

     PURPOSE:	   Issues requests across DECnet to the ARCSSRVR server
		   task running on the ARCS machine (VODKA).  Each request
		   retrieves a record from the ROUTE.MST master routing
		   file (city name comes from CITY.TBL), and passes it
		   back to ARCSUPDT for further processing.

     CALL:	   arcsclnt ( request, reply, nbytes )

     ARGUMENTS:
		   request (I)		    addr of char string containing
					    either a 6-char string in the
					    form YYMMDD for dup key to be
					    retrieved, or the 4-char
					    literal NEXT (note: may also
					    be OPEN or CLOSE to open/close
					    the DECnet link).

		   reply (O)		    addr of char string returning
					    image of retrieved record
					    (note that ARCSUPDT unions
					    this char string with a
					    structure that defines the
					    record format).

		   nbytes (O)		    addr of int returning number
					    of bytes in reply (you may
					    check nbytes on return to try
					    to verify that no unnoticed
					    change in message format has
					    occurred).

     RETURNS:	   - int
		   RMS$-NORMAL		    Operation successful,
		   RMS$-QUO		    Couldn't open/close DECnet
					    link,
		   RMS$-FTM		    Couldn't write request,
		   RMS$-NET		    Couldn't read reply.

     NOTES:
		   To OPEN the DECnet link, the logical TASK must be
		   defined as follows prior to calling ARCSclnt:
	      $ DEFINE TASK "node""ARCSSRVR password""::""TASK=ARCSSRVR"""
		   where node is the DECnet node name of the ARCS machine
		   (usually VODKA).

     SOURCE:	   ARCSCLNT.C

     ARCScomm/Phoenix Detail Design				   Page 23
     Section V: ARCScomm



		   PROGRAM DESCRIPTION

     NAME:	   ARCSSRVR

     PURPOSE:	   Reads requests from Phoenix client task via transparent
		   task-to-task DECnet facilities, and returns the
		   requested record.

     CALL:	   To read request:
			read  ( file-name='SYS$NET' ) request
		   To write reply:
			write ( file-name='SYS$NET' ) reply

     ARGUMENTS:
		   request (I)		    addr of char string containing
					    either a 6-char string in the
					    form YYMMDD for year - month -
					    day of last update, or the
					    4-char literal NEXT.

		   reply (O)		    addr of char string containing
					    retrieved ARCS record, in the
					    format described fully in
					    Section VIII.4.

     RETURNS:	   - none

     NOTES:
		   Before ARCSSRVR reads from 'SYS$NET', the Phoenix
		   client task must write a request to 'TASK', where the
		   logical TASK has been defined (on Phoenix) as follows:
	      $ DEFINE TASK "node""ARCSSRVR password""::""TASK=ARCSSRVR"""

		   To complete the link, SYS$LOGIN for account ARCSSRVR
		   (on nodes VODKA and FTNDEV) must contain the command
		   file ARCSSRVR.COM which runs ARCSSRVR.EXE.

     SOURCE:	   ARCSSRVR.FOR
		   (Note that this routine is written in Fortran for two
		   reasons.  First, ARCS is written entirely in Fortran,
		   and it is anticipated that the ARCS group will provide
		   ongoing maintenance for ARCSSRVR.  Second, the Fortran
		   include file ROUTEMST.INC contains the ARCS record
		   layout which ARCSSRVR will use so changes are
		   automatically incorporated.)

     ARCScomm/Phoenix Detail Design				   Page 24
     Section VI: ARCSphnx



		VI. ARCSphnx: Interface to Phoenix Customer File
		------------------------------------------------


	V.1   Function Descriptions

	      The Function Description Sheets comprising this section
	      define the interface (gateway) permitting ARCSupdt, running
	      directly under VMS, to transparently issue the TMX calls
	      necessary to communicate with the DBSA, and thereby perform
	      I/O to the customer file.

	      The first Function Description Sheet describes PHNXCLNT.C,
	      which issues calls to the gateway functions provided by
	      CICI/Phoenix.  The remaining Function Description Sheets
	      describe the gateway functions themselves.

     ARCScomm/Phoenix Detail Design				   Page 25
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   PHNXCLNT

     PURPOSE:	   Issues requets for CUST-FILE I/O through TMX to the
		   Phoenix DBSA.

     CALL:	   phnxclnt ( request, parg, pdata )

     ARGUMENTS:
		   request (I)		    addr of char string containing
					    a mnemonic for the DBSA
					    operation to be performed (see
					    table below).

		   parg (I/O)		    addr of char string containing
					    argument appropriate for
					    request (see table below).

		   pdata (I/O)		    addr of process data struct
					    (see pdata.h) containing
					    cust-data, etc, used for
					    communicating with DBSA.

     RETURNS:	   - int
		   to be determined

     NOTES:
		   Requests to the DBSA mediated by PHNXclnt include the
		   following:
		   request (I)	  parg (I/O*)	 operation description
		   -----------	  -----------	 ---------------------
		   (1) INIT	  process name	 Initialize Process
		   (2) BEGIN	  < unused >	 Begin Transaction
		   (3) WRTLOG #   applic. msg.	 Write to Generic Log
		   (4) COMMIT	  < unused >	 Commit Transaction
		   (5) CANCEL	  < unused >	 Cancel Transaction
		   (6) SHUTDN	  shutdown msg*  Shutdown Process
		   (7) RDCUST #   route code	 Read Customer
		   (8) WRCUST #   route code	 Write Initial Customer
		   (9) UPCUST #   route code	 Update Customer

		   # required BEGIN and COMMIT are done within Phnxclnt,
		   * denotes an output field

     SOURCE:	   PHNXCLNT.C

     ARCScomm/Phoenix Detail Design				   Page 26
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-INITIALIZE-PROCESS

     PURPOSE:	   Initializes the control structure pdata, and
		   establishes a gateway between the calling process and
		   the Phoenix/TMX Database administrator (DBSA).

     CALL:	   GATEWAY-INITIALIZE-PROCESS
		   ( vms-input-string, pdata, status )

     ARGUMENTS:
		   vms-input-string (I)     addr of char string containing
					    a logical process name by
					    which the DBSA refers to the
					    calling process.

		   pdata (O)		    addr of PDATA control struct,
					    initialized during this call
					    and passed to all other
					    gateway routines.

		   status (O)		    addr of int returning TRUE if
					    initialization is successful,
					    or FALSE otherwise (in which
					    case caller should abend).

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 27
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-BEGIN-TRANSACTION-SESSION

     PURPOSE:	   Defines the beginning boundary of a TMX transaction
		   during which all database I/O will remain
		   memory-resident until the transaction is committed by a
		   call to GATEWAY-COMMIT-TRANSACTION-SESSION.

     CALL:	   GATEWAY-BEGIN-TRANSACTION-SESSION
		   ( pdata, pdata )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct
					    identifying the process
					    requesting the transaction.

		   pdata (O)		    addr of PDATA control struct
					    modified during this call to
					    carry transaction parameters
					    assigned.

     RETURNS:	   - none

     NOTE:	   The two arguments are identical, and refer to the same
		   address (of the same PDATA structure).  This calling
		   sequence retains consistency with the DBSA.

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 28
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-WRITE-TO-GENERIC-LOG

     PURPOSE:	   Logs a message from the calling function.

     CALL:	   GATEWAY-WRITE-TO-GENERIC-LOG
		   ( pdata, applic-msg, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   applic-msg (I)	    addr of char string containing
					    message to be written to log.

		   pdata (O)		    addr of PDATA control struct.

		   status (O)		    addr of int returning TRUE if
					    call was successful, or FALSE
					    otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 29
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-COMMIT-TRANSACTION-SESSION

     PURPOSE:	   Defines the ending boundary of a TMX transaction
		   previously begun by a call to
		   GATEWAY-BEGIN-TRANSACTION-SESSION.

     CALL:	   GATEWAY-COMMIT-TRANSACTION-SESSION
		   ( pdata, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   pdata (O)		    addr of PDATA control struct.

		   status (O)		    addr of int returning TRUE if
					    the transaction is
					    successfully committed, or
					    FALSE otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 30
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-CANCEL-TRANSACTION-SESSION

     PURPOSE:	   Cancel the TMX transaction (performing no physical
		   database updates) previously begun by a call to
		   GATEWAY-BEGIN-TRANSACTION-SESSION.

     CALL:	   GATEWAY-CANCEL-TRANSACTION-SESSION
		   ( pdata, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   pdata (O)		    addr of PDATA control struct.

		   status (O)		    addr of int returning TRUE if
					    the transaction is
					    successfully canceled, or
					    FALSE otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 31
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-SHUTDOWN-PROCESS

     PURPOSE:	   Shuts down the gateway between the calling process and
		   the DBSA previously established by a call to
		   GATEWAY-INITIALIZE-PROCESS.

     CALL:	   GATEWAY-SHUTDOWN-PROCESS
		   ( pdata, vms-output-string, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct,
					    initialized by previous call
					    to GATEWAY-INITIALIZE-PROCESS.

		   vms-output-string (O)    addr of char string returning
					    shutdown message.

		   status (O)		    addr of int returning TRUE if
					    shutdown is successful, or
					    FALSE otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 32
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-READ-CUSTOMER

     PURPOSE:	   Retrieves a record from CUST-FILE, given the GCN
		   routing code for the desired customer.

     CALL:	   GATEWAY-READ-CUSTOMER
		   ( pdata, cust-key, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   cust-key (I) 	    addr of char string containing
					    21 chars consisting of the
					    literal 'A' followed by the
					    5-char route code and then
					    padded with blank.

		   pdata (O)		    addr of PDATA control struct
					    (containing the retrieved
					    record).

		   status (O)		    addr of int returning TRUE if
					    call was successful, or FALSE
					    otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 33
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-WRITE-INITIAL-CUSTOMER

     PURPOSE:	   Writes a new CUST-FILE record for a customer not
		   already on the database.  Note that cust-key is not in
		   the calling sequence because it has already been placed
		   in pdata by a previous call to GATEWAY-READ-CUSTOMER.
		   Also, the new customer data must be placed in
		   pdata->static-cust-data and pdata->dynamic-cust-data
		   before calling GATEWAY-UPDATE-CUSTOMER.

     CALL:	   GATEWAY-WRITE-INITIAL-CUSTOMER
		   ( pdata, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   pdata (O)		    addr of PDATA control struct.

		   status (O)		    addr of int returning TRUE if
					    the new record is successfully
					    written, or FALSE otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 34
     Section VI: ARCSphnx



		   FUNCTION DESCRIPTION

     NAME:	   GATEWAY-UPDATE-CUSTOMER

     PURPOSE:	   Updates a CUST-FILE record for a customer already on
		   the database.  Note that cust-key is not in the calling
		   sequence because it has already been placed in pdata by
		   a previous call to GATEWAY-READ-CUSTOMER.  Also, the
		   customer data must be placed in pdata->static-cust-data
		   and pdata->dynamic-cust-data before calling
		   GATEWAY-UPDATE-CUSTOMER.

     CALL:	   GATEWAY-UPDATE-CUSTOMER
		   ( pdata, pdata, status )

     ARGUMENTS:
		   pdata (I)		    addr of PDATA control struct.

		   pdata (O)		    addr of PDATA control struct.

		   status (O)		    addr of int returning TRUE if
					    the record is successfully
					    updated, or FALSE otherwise.

     RETURNS:	   - none

     SOURCE:	   see Phoenix

     ARCScomm/Phoenix Detail Design				   Page 35
     Section VII: Screen and Report Formats



			 VII. Screen and Report Formats
			 ------------------------------


      VII.1   DCL Screens

	      There are three main menu screens.  Only one is displayed,
	      depending onto which account (and on which machine) the user
	      logs on.	Username:ARCSUPDT displays the Update Main Menu,
	      while Username:ARCSPHNX displays the Tape Backup Main Menu
	      on the ARCS machine, or the Tape Restore Main Menu on the
	      PHOENIX machine.

	      Each main menu may be followed by one or more additional
	      screens, depending on whether the user makes any mistakes,
	      whether all necessary files (or tapes) are present (or
	      mounted), etc.  These possibilities are schematically
	      detailed on the diagrams below.  And the pages following
	      contain the formats for each screen.


	  +-----------+ 	    +-----------+	  +-----------+
     +--->|  UPDATE   |<-+	 +->|  BACKUP	|<-+   +->|  RESTORE  |<-+
     |	  | Main Menu |  |	 |  | Main Menu |  |   |  | Main Menu |  |
     |	  +-----------+  |	 |  +-----------+  |   |  +-----------+  |
     |		|     NO |	 |	  |	NO |   |	|     NO |
     |   < input ok? >---+	 | < input ok? >---+   | < input ok? >---+
     |		|	 |	 |	  |	   |   |	|	 |
     |	       / \	 +---+	 |  +-----------+  |   |  +-----------+  |
     |	report	   update    |	 |  |  BACKUP	|  |   |  |  RESTORE  |  |
     |	   /	     \	     |	 |  | verify msg|  |   |  | verify msg|  |
     |	   |	     |	     |	 |  +-----------+  |   |  +-----------+  |
     | /-------\< got file? >|	 |	  |	NO |   |	|     NO |
     +-| print |    / \      |	 |  < confirm? >---+   |  < confirm? >---+
     | \-------/  YES  NO    |	 |	  |	       |	|
     |		 /	 \   |	 |    /-------\        |    /-------\
     | /-------\ | +-----------+ +----| backup|        +----|restore|
     +-| update|-+ |  UPDATE   |      \-------/ 	    \-------/
       \-------/   |  warning  |
		   +-----------+

				  +--------+		  /-------\
	 Note: This represents a  | screen |  and this a  |process|
				  +--------+		  \-------/

     ARCScomm/Phoenix Detail Design				   Page 36
     Section VII: Screen and Report Formats



			ARCScomm/Phoenix UPDATE Main Menu
     +-------------------------------------------------------------------+
     |\       1 	2	  3	    4	      5 	6	 |
     | \ 5678901234567890123456789012345678901234567890123456789012345678|
     |	+----------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|	       ARCSCOMM/PHOENIX MAIN UPDATE MENU
     |03| ---------------------------------------------------------------
     |04|
     |05| DATABASE UPDATES			REPORTS
     |06| ----------------			-------
     |07| UA - UPDATE USING DECNET TO READ	UR - PRINT UPDATE REPORT
     |08|      ARCS DATABASE DIRECTLY
     |09| UP - UPDATE USING PHOENIX COPY OF
     |10|      ARCS DATABASE
     |11|
     |12| CONTROL
     |13| -------
     |14| LO - LOGOFF (RETURN TO PHOENIX SYSTEM CONTROL)
     |15|
     |16|
     |17|
     |18|
     |19|
     |20| < message or error, defaults to blanks >
     |21| COMMAND: xx
     +-------------------------------------------------------------------+

		     ARCScomm/Phoenix UPDATE Warning Screen
     +-------------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|		     ARCSCOMM/PHOENIX UPDATE
     |03| ---------------------------------------------------------------
     |04|
     |05| **************************************************************
     |06| * DATE-OF-LAST-UPDATE NOT AVAILABLE.	CANNOT PERFORM UPDATE. *
     |07| * ---------------------------------------------------------- *
     |08| *		  GET HELP FROM SYSTEM MANAGER		       *
     |09| **************************************************************
     |10|
     |11| PRESS < RETURN > FOR MAIN MENU: x
     |12|
     |13|
     |14|
     |15|
     |16|
     |17|
     |18|
     |19|
     |20|
     |21|
     |	+----------------------------------------------------------------+
     | / 5678901234567890123456789012345678901234567890123456789012345678|
     |/       1 	2	  3	    4	      5 	6	 |
     +-------------------------------------------------------------------+

     ARCScomm/Phoenix Detail Design				   Page 37
     Section VII: Screen and Report Formats



			ARCScomm/Phoenix BACKUP Main Menu
     +-------------------------------------------------------------------+
     |\       1 	2	  3	    4	      5 	6	 |
     | \ 5678901234567890123456789012345678901234567890123456789012345678|
     |	+----------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|	       ARCSCOMM/PHOENIX MAIN BACKUP MENU
     |03| ---------------------------------------------------------------
     |04|
     |05| BACKUP TAPE
     |06| -----------
     |07| BT - CREATE A BACKUP TAPE CONTAINING ARCS DATABASE
     |08|
     |09| CONTROL
     |10| -------
     |11| LO - LOGOFF
     |12|
     |13|
     |14|
     |15|
     |16|
     |17|
     |18|
     |19|
     |20| < message or error, defaults to blanks >
     |21| COMMAND: x
     +-------------------------------------------------------------------+

		      ARCScomm/Phoenix BACKUP Verify Screen
     +-------------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|		     ARCSCOMM/PHOENIX BACKUP
     |03| ---------------------------------------------------------------
     |04|
     |05| ***************************************************************
     |06| * TO PROCEED YOU MUST HAVE A MAGNETIC TAPE ON WHICH TO BACKUP *
     |07| * ----------------------------------------------------------- *
     |08| *			 THE ARCS DATABASE			*
     |09| ***************************************************************
     |10|
     |11| < error message, defaults to blanks >
     |12| DO YOU WANT TO PROCEED (ENTER Y OR N): x
     |13|
     |14|
     |15|
     |16|
     |17|
     |18|
     |19|
     |20|
     |21|
     |	+----------------------------------------------------------------+
     | / 5678901234567890123456789012345678901234567890123456789012345678|
     |/       1 	2	  3	    4	      5 	6	 |
     +-------------------------------------------------------------------+

     ARCScomm/Phoenix Detail Design				   Page 38
     Section VII: Screen and Report Formats



		       ARCScomm/Phoenix RESTORE Main Menu
     +-------------------------------------------------------------------+
     |\       1 	2	  3	    4	      5 	6	 |
     | \ 5678901234567890123456789012345678901234567890123456789012345678|
     |	+----------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|	       ARCSCOMM/PHOENIX MAIN RESTORE MENU
     |03| ---------------------------------------------------------------
     |04|
     |05| LOAD TAPE
     |06| ---------
     |07| LT - LOAD TAPE CONTAINING ARCS DATABASE
     |08|
     |09| CONTROL
     |10| -------
     |11| LO - LOGOFF
     |12|
     |13|
     |14|
     |15|
     |16|
     |17|
     |18|
     |19|
     |20| < message or error, defaults to blanks >
     |21| COMMAND: x
     +-------------------------------------------------------------------+

		     ARCScomm/Phoenix RESTORE Verify Screen
     +-------------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|		     ARCSCOMM/PHOENIX RESTORE
     |03| ---------------------------------------------------------------
     |04|
     |05| ***********************************************************
     |06| * TO PROCEED YOU MUST HAVE A MAGNETIC TAPE CONTAINING THE *
     |07| * ------------------------------------------------------- *
     |08| *			   ARCS DATABASE		    *
     |09| ***********************************************************
     |10|
     |11| < error message, defaults to blanks >
     |12| DO YOU WANT TO PROCEED (ENTER Y OR N): x
     |13|
     |14|
     |15|
     |16|
     |17|
     |18|
     |19|
     |20|
     |21|
     |	+----------------------------------------------------------------+
     | / 5678901234567890123456789012345678901234567890123456789012345678|
     |/       1 	2	  3	    4	      5 	6	 |
     +-------------------------------------------------------------------+

     ARCScomm/Phoenix Detail Design				   Page 39
     Section VII: Screen and Report Formats



      VII.2   Validation Screens

	      Validation requirements as originally specified in JFA's
	      proposal (see Section I.3) have since been deleted by CICI.
	      Nevertheless, a prototype validation subsystem was already
	      in place so the existing functionality is documented here.
	      This may provide a useful point of departure in case
	      validation requirements are needed some time in the future.

	      Note that to demonstrate validation you must run ARCSupdt
	      with a second command-line argument of the form
		   $ arcsupdt "YYMMDD" "Y"
	      where YYMMDD is the date of last update and Y (for YES)
	      indicates you want validation.  None of the DCL procedures
	      provide a menu option that toggles this switch (as per
	      CICI's request), so this "manual" intervention is necessary
	      to access the validation screen.

     ARCScomm/Phoenix Detail Design				   Page 40
     Section VII: Screen and Report Formats



		    ARCScomm/Phoenix UPDATE Validation Screen

     +-------------------------------------------------------------------+
     |\       1 	2	  3	    4	      5 	6	 |
     | \ 5678901234567890123456789012345678901234567890123456789012345678|
     |	+----------------------------------------------------------------+
     |01| TERMINAL: < term id >			     23-Jan-1986 15:00:00
     |02|	       ARCSCOMM/PHOENIX UPDATE VALIDATION
     |03| ---------------------------------------------------------------
     |04|		       --- COMMANDS ---
     |05| OK - PERFORM THIS UPDATE	 BY - ABORT JOB (NO MORE UPDATES)
     |06| NG - DON'T PERFORM THIS UPDATE GO - CONTINUE WITHOUT VALIDATING
     |07| UP - DISPLAY PREVIOUS PAGE	 DN - DISPLAY NEXT PAGE
     |08| ---------------------------------------------------------------
     |09| ROUTE CODE: xxxxx  COUNTRY: xxx  NAME: xxxxxxxxxxxxxxxxxxxxxxxx
     |10|
     |11| FIELD NAME	   ARCS VALUE		 PHOENIX VALUE
     |12| ----------	   ----------		 -------------
     |13| Route Code	   USANY		 ---NEW CUSTOMER---
     |14| City Code	   NYC
     |15| City Name	   BIG APPLE
     |16| Country Code	   USA
     |17| Institution	   CITICORP INTERNATIO
     |18| BankWire Cod
     |19|
     |20| < message or error, defaults to blanks >
     |21| COMMAND: xx
     |	+----------------------------------------------------------------+
     | / 5678901234567890123456789012345678901234567890123456789012345678|
     |/       1 	2	  3	    4	      5 	6	 |
     +-------------------------------------------------------------------+

     Note:    The field names and values are made up for sample purposes
	      to give you a better feel for the layout than xxx's.  For a
	      real validation, only fields whose ARCS and Phoenix values
	      disagree are displayed.  For a new customer, all fields are
	      displayed as shown above.

     ARCScomm/Phoenix Detail Design				   Page 41
     Section VII: Screen and Report Formats



      VII.3   Audit Trail Report Format

	      The Audit Trail Report format is similar to the validation
	      screen above, except, of course, that there are no prompts
	      or commands, and also that paging is done automatically.

	      Paging is done every 60 lines, with as many complete
	      customers on a page as will fit.	That is, if a customer
	      won't fit on the current page then a new page is started
	      before the 60-line mandatory page break.

     ARCScomm/Phoenix Detail Design				   Page 42
     Section VII: Screen and Report Formats



		   ARCScomm/Phoenix AUDIT TRAIL REPORT Format

     +-------------------------------------------------------------------+
     |\       1 	2	  3	    4	      5 	6	 |
     | \ 5678901234567890123456789012345678901234567890123456789012345678|
     |	+----------------------------------------------------------------+
     |01|		  ARCSCOMM/PHOENIX UPDATE REPORT
     |02| ---------------------------------------------------------------
     |03|
     |04|
     |05|
     |06| ROUTE CODE: xxxxx  COUNTRY: xxx  NAME: xxxxxxxxxxxxxxxxxxxxxxxx
     |07| ---------------------------------------------------------------
     |08| FIELD NAME	   ARCS VALUE		 PHOENIX VALUE
     |09| ----------	   ----------		 -------------
     |10| Route Code	   USANY		 ---NEW CUSTOMER---
     |11| City Code	   NYC
     |12| City Name	   BIG APPLE
     |13| Country Code	   USA
     |14| Institution	   CITICORP INTERNATIO
     |15| BankWire Cod
     |..|     . 	       .
     |..|     . 	       .
     |..|     . 	       .
     |31| Override Route   USANY
     |32| ---------------------------------------------------------------
     |33|
     |34|
     |35| ROUTE CODE: xxxxx  COUNTRY: xxx  NAME: xxxxxxxxxxxxxxxxxxxxxxxx
     |36| ---------------------------------------------------------------
     |37| FIELD NAME	   ARCS VALUE		 PHOENIX VALUE
     |38| ----------	   ----------		 -------------
     |39| AnswerBack 1	   new answerback	 old answerback
     |40| System Route	   new route		 old route
     |41| ---------------------------------------------------------------
     |42|
     |..|     . 	       .
     |..|     . 	       .
     |..|     . 	       .
     |60|
     |61|			 -- Page xx --
     |	+----------------------------------------------------------------+
     | / 5678901234567890123456789012345678901234567890123456789012345678|
     |/       1 	2	  3	    4	      5 	6	 |
     +-------------------------------------------------------------------+

     Note:    The field names and values are made up for sample purposes
	      to give you a better feel for the layout than xxx's.

     ARCScomm/Phoenix Detail Design				   Page 43
     Section VIII: Data Dictionary



			      VIII. Data Dictionary
			      ---------------------


     VIII.1   VMS Logicals

	      Various VMS logicals are required for ARCScomm/Phoenix to
	      operate.	These are mostly maintained by the DCL Shell
	      according to user replies to menu prompts, as described in
	      Section III.  Several, mostly on the ARCS machine, are
	      assumed to be maintained by the system manager.

	      The following Data Element Definition sheets describe all
	      the VMS logicals required by ARCSupdt.  Note that VMS
	      symbols which are local to the DCL Shell are not considered
	      in this section.	Only symbols whose scope is global (i.e.,
	      symbols used in subsystems that didn't define them) are
	      documented here.

     ARCScomm/Phoenix Detail Design				   Page 44
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   CITY-TBL

     SYNONYMS:	   none

     PURPOSE:	   VMS logical that specifies the path to ARCS file
		   CITY.TBL.

     WHERE DEFINED:By system manager on the ARCS machine,
		   by ARCSUPDT.COM on the PHOENIX machine.

     WHERE USED:   ARCSSRVR.FOR

     FORMAT:	   not applicable

     DERIVATION:   $ DEFINE CITY-TBL "path to CITY.TBL file"

     VALUES & MEANINGS:
     "DUA1:[ARCS.DEVELOP.DATA]"                       default path on ARCS

     NOTES:	   This logical must reside on both ARCS and PHOENIX
		   machines so that ARCSsrvr can open the CITY.TBL file
		   regardless of whether or not DECnet is being used.  The
		   ARCS system manager is responsible for maintaining
		   CITY-TBL on the ARCS machine.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 45
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   ROUTE-MST

     SYNONYMS:	   none

     PURPOSE:	   VMS logical that specifies the path to ARCS file
		   ROUTE.MST.

     WHERE DEFINED:By system manager on the ARCS machine,
		   by ARCSUPDT.COM on the PHOENIX machine.

     WHERE USED:   ARCSSRVR.FOR

     FORMAT:	   not applicable

     DERIVATION:   $ DEFINE ROUTE-MST "path to ROUTE.MST file"

     VALUES & MEANINGS:
     "DUA1:[ARCS.DEVELOP.DATA]"                       default path on ARCS

     NOTES:	   This logical must reside on both ARCS and PHOENIX
		   machines so that ARCSsrvr can open the ROUTE.MST file
		   regardless of whether or not DECnet is being used.  The
		   ARCS system manager is responsible for maintaining
		   ROUTE-MST on the ARCS machine.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 46
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   TASK

     SYNONYMS:	   none

     PURPOSE:	   VMS logical that specifies the node, logon, and path to
		   the ARCSSRVR.COM file that runs ARCSsrvr.

     WHERE DEFINED:ARCSUPDT.COM

     WHERE USED:   ARCSCLNT.C

     FORMAT:	   not applicable

     DERIVATION:   $ DEFINE TASK "node, logon, and path to ARCSSRVR.COM"

     VALUES & MEANINGS:
     "VODKA""ARCSSRVR password""::""TASK=ARCSSRVR"""  default path to ARCS
     "FTNDEV""ARCSSRVR password""::""TASK=ARCSSRVR""" default Phoenix path

     NOTES:	   This logical

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 47
     Section VIII: Data Dictionary



     VIII.2   Internal ARCSupdt Data Elements and Structures

	      The various "C" and Fortran functions that comprise
	      ARCScomm/Phoenix contain declarations for several hundred
	      variables.  Not all of them are documented here.	Only those
	      that contribute to the high-level functionality (i.e., those
	      that would need to be mentioned in pseudocode) are
	      discussed.

	      Also, some of the most important data structures are not
	      discussed here, but discussed in Sections VIII.3 and VIII.4
	      instead.

     ARCScomm/Phoenix Detail Design				   Page 48
     Section VIII: Data Dictionary



		   DATA STRUCTURE DEFINITION

     NAME:	   arcsphnx-flds

     PURPOSE:	   Define the mapping of fields from the ARCS arcscomm-buf
		   onto the Phoenix static-cust-data.  (See ARCSCOMM.H)

     struct   { 			    /* ------------------------ */
	 char	   fld-name[16];	    /* Label to format reports	*/
	 int	   fld-len;		    /* #bytes in the field	*/
	 int	   arcs-offset; 	    /* #bytes preceding fld ... */
	 int	   phnx-offset; 	    /* ditto, -number = dynamic */
	 char	   phnx-mask[32];	    /* prefix in cust-file	*/
	 }				    /* ------------------------ */
	 arcsphnx-flds[] =			 /* Fld Description	*/
	 {					 /* ------------------- */
	 "Route Code",    5,   0, 124, "",       /*   1  See fld-name   */
	 "City Code",     3,   5,  98, "",       /*   2      at left of */
	 "City Name",    26,   8,  72, "",       /*   3      each row   */
	 "Country Code",  3,  34, 101, "",       /*   4                 */
	 "Institution",  72,  37,   0, "",       /*   5                 */
	 "BankWire Code", 4, 109, 124, "",       /*   6                 */
	 "Telex 1",      13, 113, 142, "",       /*   7                 */
	 "AnswerBack 1", 20, 126, 156, "",       /*   8                 */
	 "Telex 2",      13, 146, 178, "",       /*   9                 */
	 "AnswerBack 2", 20, 159, 192, "",       /*  10                 */
	 "Telex 3",      13, 179, 214, "",       /*  11                 */
	 "AnswerBack 3", 20, 192, 228, "",       /*  12                 */
	 "Bank ID",      19, 212, 104, "C",      /*  13                 */
	 "ABA Number",    9, 231, 256, "",       /*  14                 */
	 "DDA Number",    8, 240, 248, "",       /*  15                 */
	 "MARTI Code",    4,-248,   0, "",       /*  16                 */
	 "SENDS Flag",    1, 252, 330, "",       /*  17                 */
	 "Last Update",   6,-253,   0, "",       /*  18                 */
	 "Operator ID",   2,-259,   0, "",       /*  19                 */
	 "System Route",  5, 261, 270, "",       /*  20                 */
	 "Master Route",  5, 266, 290, "",       /*  21                 */
	 "Override Route",5, 271, 310, "",       /*  22                 */
	 "End-of-Table", -1,  -1,  -1, ""        /* ------------------- */
	 };

     NOTES:	   Each line (row) above consists of four columns which
		   define one of the fields updated by ARCScomm/Phoenix.
		   The first column contains a literal stub that is used
		   to label the field on reports.  The second column is
		   the length of the field.  The third is the offset from
		   the beginning of the ARCS arcscomm-buf to the first
		   byte of the field, and the fourth is the offset from
		   Phoenix static-cust-data to the first byte of the
		   field.  The extra fifth column is an optional prefix
		   which must appear on the Phoenix field, but is not
		   passed in the ARCS buffer arcscomm-buf.

     ARCScomm/Phoenix Detail Design				   Page 49
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   clnt-reply

     SYNONYMS:	   phx-reply

     PURPOSE:	   ARCS ROUTE-MST buffer returned by ARCSclnt, containing
		   an ARCS record in response to the request issued.

     WHERE DEFINED:ARCSUPDT.C

     WHERE USED:   ARCSUPDT.C
		   ARCSCLNT.C
		   ARCSPROOF.C
		   ARCSVALID.C
		   ARCSRPT.C

     FORMAT:	   AN512 (declared char[512])

     DERIVATION:   Read from ROUTE-MST file.

     VALUES & MEANINGS:
		   see arcscomm-buf in Section VIII.4

     NOTES:	   The synonym phx-reply is unioned with clnt-reply.
		   Whereas clnt-reply is a character buffer as indicated
		   above, phx-reply is an arcscomm-buf structure allowing
		   each field to be individually referenced by name.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 50
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   cust-key

     SYNONYMS:	   none

     PURPOSE:	   Retrieval key passed to GATEWAY-READ-CUSTOMER.

     WHERE DEFINED:PHNXCLNT.C

     WHERE USED:   PHNXCLNT.C
		   GATEWAY-READ-CUSTOMER

     FORMAT:	   AN21 (declared char[32])

     DERIVATION:   "A" || "route-code" || blanks (i.e., the literal "A"
		   followed by the 5-char route-coded padded with blanks)

     VALUES & MEANINGS:

     NOTES:	   The DBSA requires a 21-character retrieval key which is
		   constructed by PHNXclnt from the 5-char route code
		   input.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 51
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   dup

     SYNONYMS:	   none

     PURPOSE:	   Date-of-last-update input.  Key value used to request
		   first ARCS record (subsequent records are requested
		   sequentially).

     WHERE DEFINED:ARCSUPDT.C

     WHERE USED:   ARCSUPDT.C

     FORMAT:	   AN6 (declared char[64])

     DERIVATION:   first command-line arg, i.e., dup = *argv[1]

     VALUES & MEANINGS:
		   "YYMMDD"                 Year-Month-Day of last update.

     NOTES:	   ARCSupdt insists that a command-line arg is present;
		   otherwise, it exits.  However, no format checking is
		   performed.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 52
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   dup-key

     SYNONYMS:	   none

     PURPOSE:	   Date-of-last-update output.	Key value extracted from
		   retrieved ARCS record.

     WHERE DEFINED:ARCSUPDT.C

     WHERE USED:   ARCSUPDT.C

     FORMAT:	   AN6 (declared char[64])

     DERIVATION:   Copied from ARCS buffer returned by ARCSclnt.

     VALUES & MEANINGS:
		   "YYMMDD"                 Year-Month-Day of last update.

     NOTES:	   dup-key is written to the date-of-last-update file
		   which keeps a running record of the last ARCS record
		   updated on Phoenix.	This file is read by the DCL
		   Shell, and the last dup placed on the command line.
		   Thus each time ARCSupdt runs, it picks up where it
		   previously left off.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 53
     Section VIII: Data Dictionary



		   DATA ELEMENT DEFINITION

     NAME:	   gcn-key

     SYNONYMS:	   none

     PURPOSE:	   Route code field from ARCS record retrieved by
		   ARCSclnt.

     WHERE DEFINED:ARCSUPDT.C

     WHERE USED:   ARCSUPDT.C
		   PHNXCLNT.C

     FORMAT:	   AN5 (declared char[64])

     DERIVATION:   Copied from ARCS buffer returned by ARCSclnt.

     VALUES & MEANINGS:
		   Five-character route code

     NOTES:	   The sole purpose of gcn-key is to be passed to
		   PHNXclnt.  It is the key used by PHNXclnt to retrieve
		   the cust-file record that corresponds to the ARCS
		   record retrieved from ROUTE-MST.

     DATE:	   01/27/86

     Revision:	   1.00

     ARCScomm/Phoenix Detail Design				   Page 54
     Section VIII: Data Dictionary



     VIII.3   Relevant Phoenix DBSA Data Elements and Structures

	      Data is transferred between ARCScomm/Phoenix and the DBSA
	      through the pdata structure, which is defined by the DBSA.
	      Within pdata is another structure, static-cust-data, which
	      contains virtually all the fields that ARCScomm/Phoenix
	      reconciles and updates.  (Note: the dynamic-cust-data
	      structure within pdata may possibly contain one or two
	      relevant fields.)  In addition, pdata contains various
	      miscellaneous data elements (e.g., DBSA return statuses)
	      that are relevant to ARCScomm/Phoenix.

	      The file pdata.h is maintained by Phoenix and #include-ed in
	      ARCScomm/Phoenix to define pdata.  Thus, definitive
	      information about pdata is in the Phoenix Design
	      Specification (see Section I.3).	The pdata information here
	      is only intended to provide general design considerations
	      suitable for a high-level understanding of ARCScomm/Phoenix.

     ARCScomm/Phoenix Detail Design				   Page 55
     Section VIII: Data Dictionary



		   STRUCTURE DESCRIPTION

     NAME:	   static-cust-data

     PURPOSE:	   Contains customer data corresponding to the ARCS
		   ROUTE-MST record.

				       /*----------------------------*/
     struct   static-cust-def	       /*L E N G T H		 POS */
	 {			       /*----------------------------*/
	 unsigned char	dbs-corr-name  [SZ-CORR-NAME];	     /*   0 */
	 unsigned char	dbs-city-name  [SZ-CITY-NAME];	     /*  72 */
	 unsigned char	dbs-city-code  [SZ-CITY-CODE];	     /*  98 */
	 unsigned char	dbs-st-country [SZ-ST-COUNTRY];      /* 101 */
	 unsigned char	dbs-cable-addr [SZ-CABLE-ADDR];      /* 104 */
	 unsigned char	dbs-gcn-addr   [SZ-GCN-ADDR];	     /* 124 */
	 unsigned char	dbs-in-route   [SZ-IN-ROUTE];	     /* 129 */
	 unsigned char	dbs-call-sign  [SZ-CALL-SIGN];	     /* 134 */
	 unsigned char	dbs-dial-access-type1
				       [SZ-DIAL-ACCESS-TYPE];/* 140 */
	 unsigned char	dbs-telex-num1 [SZ-TELEX-NUM];	     /* 141 */
	 unsigned char	dbs-ansbk-num1 [SZ-ANSBK-NUM];	     /* 155 */
	 unsigned char	dbs-dial-access-type2
				       [SZ-DIAL-ACCESS-TYPE];/* 176 */
	 unsigned char	dbs-telex-num2 [SZ-TELEX-NUM];	     /* 177 */
	 unsigned char	dbs-ansbk-num2 [SZ-ANSBK-NUM];	     /* 191 */
	 unsigned char	dbs-dial-access-type3
				       [SZ-DIAL-ACCESS-TYPE];/* 212 */
	 unsigned char	dbs-telex-num3 [SZ-TELEX-NUM];	     /* 213 */
	 unsigned char	dbs-ansbk-num3 [SZ-ANSBK-NUM];	     /* 227 */
	 unsigned char	dbs-dda-num    [SZ-DDA-NUM];	     /* 248 */
	 unsigned char	dbs-aba-num    [SZ-ABA-NUM];	     /* 256 */
	 unsigned char	dbs-currency-code[SZ-CURRENCY-CODE]; /* 265 */
	 unsigned char	dbs-verify-msgs[SZ-VERIFY-MSGS];     /* 268 */
	 unsigned char	dbs-marti-yn   [SZ-MARTI-YN];	     /* 269 */
	 unsigned char	dbs-twd-alg-in [SZ-TWD-ALG-IN];      /* 270 */
	 unsigned char	dbs-twd-alg-im [SZ-TWD-ALG-IM];      /* 290 */
	 unsigned char	dbs-twd-alg-ot [SZ-TWD-ALG-OT];      /* 310 */
	 unsigned char	dbs-for-dom-flag[SZ-FOR-DOM-FLAG];   /* 330 */
	 unsigned char	dbs-misc-flags [SZ-MISC-FLAGS];      /* 331 */
	 unsigned char	dbs-comment-c  [SZ-COMMENT-C]; /*-----* 334 */
	 };			       /* Static Cust Rec Size= 414 */
				       /*---------------------------*/

     ARCScomm/Phoenix Detail Design				   Page 56
     Section VIII: Data Dictionary



     VIII.4   ARCScomm Data and Message Formats

	      Communication between the ARCS and PHOENIX machines (i.e.,
	      VODKA and FTNDEV) is by transparent task-to-task
	      communication over DECnet.  The ultimate result is that
	      PHOENIX requests all ARCS records that have been updated
	      since the last time the program was run.	These requests are
	      issued by a client task, ARCSclnt, running under ARCSupdt on
	      PHOENIX, and they are responded to by a server task,
	      ARCSsrvr, running on ARCS.

	      In this section the protocol and message formats of
	      client/server communication are described.  Before this
	      communication begins, ARCSclnt issues an RMS open for the
	      logical TASK defined as
	 $ define TASK "VODKA""ARCSSRVR password""::""TASK=ARCSSRVR"""
	      which establishes the DECnet link (see Section III).  And
	      after receiving an EOF from the server (see below), ARCSclnt
	      issues an RMS close for TASK.

     ARCScomm/Phoenix Detail Design				   Page 57
     Section VIII: Data Dictionary



		   MESSAGE PROTOCOL DEFINITION

     PURPOSE:	   To allow ARCSclnt to issue requests for customer
		   records, and to interpret the replies from ARCSsrvr.

     DESCRIPTION:  Dialog is initiated by ARCSclnt.  Each request may
		   either be a six character dup-key in the form "YYMMDD"
		   (see Section VIII.1) or the four character literal
		   "NEXT".  If given a dup-key, then ARCSsrvr returns the
		   first (i.e., earliest) customer record with dup equal
		   to or greater than that key.  If given "NEXT", then the
		   next sequential customer record (keyed by dup) is
		   returned.

		   Each customer record is returned in the arcs-msg format
		   described on the next page.	If a request is beyond the
		   end-of-file, then "***END***" is returned.  For any
		   other error "***ERR***" is returned.

     EXAMPLES:
		   Normal			      Error
	 ---------------------------	    --------------------------
	 Client 	Server		    Client	   Server
	 request	reply		    request	   reply
	 ---------------------------	    --------------------------

	 +---------+			    +---------+
	 | dup-key |			    | dup-key |
	 +---------+	+----------+	    +---------+    +----------+
			| arcs-msg |			   | arcs-msg |
	 +---------+	+----------+	    +---------+    +----------+
	 |  "NEXT" |                        |  "NEXT" |
	 +---------+	+----------+	    +---------+    +----------+
			| arcs-msg |			   | arcs-msg |
	 +---------+	+----------+	    +---------+    +----------+
	 |  "NEXT" |                        | garbage |
	 +---------+	+----------+	    +---------+    +-----------+
			| arcs-msg |			   |"***ERR***"|
	      . 	+----------+	    +---------+    +-----------+
	      . 			    |  "NEXT" |
	      . 	     .		    +---------+    +-----------+
	      . 	     .				   |"***ERR***"|
	      . 	     .		    +---------+    +-----------+
			     .		    | dup-key |
	 +---------+	     .		    +---------+    +----------+
	 |  "NEXT" |                                       | arcs-msg |
	 +---------+	+-----------+		 .	   +----------+
			|"***END***"|            .
			+-----------+		 .		.

     NOTES:	   The first request must be a dup-key (not "NEXT").
		   After that, however, any sequence of dup-keys and
		   "NEXT"s is legal (another dup-key after several "NEXT"s
		   will simply reposition the file).  Normal processing
		   issues just one dup-key followed by "NEXT"s until
		   end-of-file.

     ARCScomm/Phoenix Detail Design				   Page 58
     Section VIII: Data Dictionary



		   MESSAGE FORMAT DESCRIPTION

     NAME:	   arcscomm-buf

     SYNONYMS:	   arcs-msg

     PURPOSE:	   Describes the customer record fields returned by
		   ARCSsrvr in response to an ARCSclnt request.

     Composition:
					    /* ------------------------ */
	      struct	arcscomm-buf	    /* Fld Description		*/
		   {			    /* ------------------------ */
		   char      gcn[ 5];	    /*	 1 GCN Route Code	*/
		   char      cty[ 3];	    /*	 2 City Code		*/
		   char      ctn[26];	    /*	 3 City Name		*/
		   char      cny[ 3];	    /*	 4 Country Code 	*/
		   char      nm1[72];	    /*	 5 Institution Name	*/
		   char      bkw[ 4];	    /*	 6 Bankwire Code	*/
		   char      tn1[13];	    /*	 7 1st Telex Number	*/
		   char      ta1[20];	    /*	 8 1st Telex Answerback */
		   char      tn2[13];	    /*	 9 2nd Telex Number	*/
		   char      ta2[20];	    /*	10 2nd Telex Answerback */
		   char      tn3[13];	    /*	11 3rd Telex Number	*/
		   char      ta3[20];	    /*	12 3rd Telex Answerback */
		   char      bid[19];	    /*	13 Bank/Correspondent ID*/
		   char      aba[ 9];	    /*	14 ABA Number		*/
		   char      dda[ 8];	    /*	15 DDA Number		*/
		   char      mbc[ 4];	    /*	16 Marti Bank Code	*/
		   char      tfs[ 1];	    /*	17 Test Flag - SENDS	*/
		   char      dup[ 6];	    /*	18 Date of Last Update	*/
		   char      opr[ 2];	    /*	19 Operator ID ("99")   */
		   char      sgm[ 5];	    /*	20 System Msgs Route Cd */
		   char      mci[ 5];	    /*	21 Master Cust Route Cd */
		   char      ovr[ 5];	    /*	22 Override    Route Cd */
		   };			    /* ------------------------ */

     ARCScomm/Phoenix Detail Design				   Page 59
     Appendix A: Migration and Installation Procedures



		Appendix A: Migration and Installation Procedures
		-------------------------------------------------


	 A live implementation of Phoenix is not expected until several
	 months following system testing of ARCScomm/Phoenix.  Since
	 integration testing and user acceptance of ARCScomm/Phoenix must
	 be scheduled after Phoenix is live, they will have to be
	 postponed.  In this appendix the issues involved in migrating to
	 the FTNDEV environment for integration testing, etc. are
	 discussed.

	 The discussion refers explicitly to the source code listings in
	 Appendix B.  Each program is individually discussed.  The
	 listings are line-numbered, and #123 refers to line 123.
	 Programs are discussed in alphabetical order by file name, which
	 is also how the listings are arranged.

     ARCScomm/Phoenix Detail Design				   Page 60
     Appendix A: Migration and Installation Procedures



      1. ARCSPHNX.TOC
      ---------------


	 This file (the only one not in alphabetical order) simply
	 contains a table of contents naming all the files that comprise
	 the ARCScomm/Phoenix system.  It should obviously be updated as
	 needed, but that is not expected to occur simply as a result of
	 migration (i.e., programs will change, but no new ones will be
	 added).

     ARCScomm/Phoenix Detail Design				   Page 61
     Appendix A: Migration and Installation Procedures



      2. ARCSCLNT.C
      -------------


	 This routine is probably the least likely ever to be affected by
	 anything.  It simply issues requests to the server process
	 running on ARCS and passes replies back to its caller, ARCSupdt.

	 Section VIII.4 describes the message protocol implemented by
	 arcsclnt.  The actual message format is totally irrelevant to
	 this routine because it simply deals with a character buffer.
	 Thus, arcsclnt can only be affected by a change in protocol.  And
	 that protocol is totally internal to the program and totally
	 independent of the functionality it supports.

	 Note that the protocol is ultimately intended to change when
	 several Phoenix slaves are serviced simultaneously (see Section
	 I.5), and each one needs separate message formats and fields.
	 Then the protocol will need to become more complex, but the
	 calling programs will be shielded from those changes.

     ARCScomm/Phoenix Detail Design				   Page 62
     Appendix A: Migration and Installation Procedures



      3. ARCSCOMM.H
      -------------


	 This include file defines two structures, arcscomm-buf and
	 arcsphnx-flds, and several symbols, almost all of which are
	 subject to change depending on a)whether or not Phoenix is
	 implemented as presently specified, and b)whether or not ARCS is
	 enhanced for Phoenix support as presently planned.

	 Line #'s  Discussion
	 --------  ----------
	  39- 40:  The one certain change is on lines #39 and #40.  One
		   planned ARCS enhancement is to make dup (date of last
		   update) a keyed field, which is necessary for keyed
		   retrieval.  Right now, for testing, the first 25 bytes
		   of the institution name field are used.  DUPPOS on #39
		   refers to the number of bytes preceding the dup field
		   in the arcscomm-buf structure defined on #53.  Note
		   that DUPPOS is now defined as 37, so it points to the
		   institution name field.  DUPPLEN should also be changed
		   to 6 since the real dup field is six bytes wide.

	  41- 42:  GCNPOS and GCNLEN are on #41 and #42.  These two
		   symbols point to the route code field in arcscomm-buf,
		   and presumably will remain the same.  But if anything
		   happens to affect arcscomm-buf, these symbols may also
		   be affected.

	  86-118:  The arcsphnx-flds table starting on #86 is particularly
		   sensitive to any changes in ARCS or Phoenix.  This
		   table drives the functionality of arcsproof, arcsvalid,
		   and arcsrpt.  They all need to be able to retrieve
		   individual fields from ARCS's arcscomm-buf structure
		   and the corresponding fields from static-cust-data (or
		   dynamic-cust-data) in Phoenix's pdata structure.  This
		   table defines the length of every field and its
		   position in both structures.  Programs that need this
		   information just loop through the table and do their
		   work one field at a time.  Some ways in which the
		   arcsphnx-flds table may be affected are described
		   below.

	  Column   Discussion
	 -------   ----------
	    1	   The first column of arcsphnx-flds is just a stub that
		   arcsvalid and arcsrpt use to label the fields, and
		   should only need change for cosmetic purposes.
	    2	   The second column is the field length, the same for
		   both ARCS and Phoenix, and changes if and only if both
		   arcscomm-buf and pdata change simultaneously.

     ARCScomm/Phoenix Detail Design				   Page 63
     Appendix A: Migration and Installation Procedures



	    3	   The third column is the offset from the beginning of
		   arcscomm-buf to the first byte of the field.  There are
		   several negative values here which are interpreted as
		   dummy fields.  The minus signs should be removed when
		   either a)ARCS implements the fields or b)Phoenix wants
		   them reconciled.  Note that dup is a dummy field.  It
		   can stay that way.  The DUPPOS symbol will still get it
		   for keyed retrieval, but the negative value here simply
		   ignores reconciling it with Phoenix.
	    4	   The fourth column is offset to the field in pdata's
		   static-cust-data.  A negative value is interpreted as
		   offset in dynamic-cust-data (zero is forced to
		   static-cust-data).
	    5	   The fifth column, usually null, is a prefix that must
		   appear on the Phoenix field but is absent in the ARCS
		   record (it's just an idiosyncracy between the two
		   systems).  You may need to put "T" there for the three
		   answerbacks, but that remains to be resolved.  As
		   currently defined and implemented, the length of the
		   Phoenix field is the length of the ARCS field plus the
		   length of the prefix.

	 Line #'s  Discussion
	 --------  ----------
	  82- 84:  Finally, the three symbols defined on #82 - #84 help
		   implement a last-minute change of scope.  The SENDS
		   flag may be either "I" or "D" for International or
		   Domestic.  In the "D"omestic case, the Phoenix route
		   code is the ARCS bankwire code.  Program arcsproof,
		   lines #78 - #100, uses these (line #82 - #84) symbols
		   to drive the special processing required.  Note in
		   arcsproof a)that bankwire code is only used both when
		   SENDS = "D" and when bankwire code is non-blank, and
		   b)that SENDS = "N" is also checked for (and treated as
		   "I") because N's appear to be sprinkled around.

		   Additional special processing to handle this new SENDS
		   flag situation may eventually be required.  Note in
		   arcsupdt, that line #219 issues a request for the
		   Phoenix record with the same route code as the ARCS
		   record already retrieved.  The route code requested is
		   always the ARCS route code, never the bankwire code.
		   This assumption may be correct, but the entire
		   situation requires additional research.  Any additional
		   coding should be straightforward once the correct
		   algorithm is unambiguously specified.

     ARCScomm/Phoenix Detail Design				   Page 64
     Appendix A: Migration and Installation Procedures



      4. ARCSLINK.COM
      ---------------


	 This file is simply a convenience to link arcsupdt.obj and the
	 other required obj's into an exe.  Migrating from VODKA (where it
	 was developed) to FTNDEV is also a migration from VMS 3.7 to 4.2,
	 and this will affect the link.

	 Create a file named RTLSHARE.OPT containing the single line of
	 text:
	      sys$share:vaxcrtl.exe/share
	 and then change line #2 to read:
	      $ link arcsupdt,...,vmsmsg,rtlshare.opt/opt
	 where ... refers to everything already on the line (i.e., just
	 add rtlshare.opt/opt to the link).

	 Incidentally, if you're compiling under 3.7 (without rtlshare)
	 and using your own account, note that even the current link
	 requires:
	      $ define lnk$library sys$library:crtlib

	 Also note that there's no COM file to link the Fortran server
	 task, arcssrvr.for. Just say
	      $ link arcssrvr
	 since the required subroutines all reside in the same source file
	 (and therefore in the same obj).

     ARCScomm/Phoenix Detail Design				   Page 65
     Appendix A: Migration and Installation Procedures



      5. ARCSPROOF.C
      --------------


	 Since this routine is table-driven by the arcsphnx-flds table in
	 ARCSCOMM.H discussed above, no changes should (in principle) be
	 necessary.

	 Line #'s  Discussion
	 --------  ----------
	  78-100:  Of course, the route code "kludge" on lines #78 - #100
		   (discussed in detail under ARCSCOMM.H) violates the
		   table-driven principle.  Therefore, this routine is
		   susceptible to nasty bits of impenetrable code creeping
		   in.

		   For instance, note the variable skipprf declared on
		   #56, defined in the kludge, and used on #106 to avoid
		   proofing the irrelevant route code.	This entire area
		   of functionality may need modification after Phoenix is
		   implemented and the requirements are better understood.

     ARCScomm/Phoenix Detail Design				   Page 66
     Appendix A: Migration and Installation Procedures



      6. ARCSRPT.C
      ------------


	 No changes, except for possible cosmetic reformatting since
	 Citibank hasn't officially accepted the report.

     ARCScomm/Phoenix Detail Design				   Page 67
     Appendix A: Migration and Installation Procedures



      7. ARCSSRVR.COM
      ---------------


	 This two-line file is run by the login command file of account
	 ARCSSRVR, and has the important job of running the server task
	 whenever the Phoenix client, arcsphnx, logs in over DECnet.

	 Obviously, the path to arcssrvr.exe must be specified correctly
	 for the machine hosting the server.  This is a trivial but
	 important change - especially since it won't be obvious what's
	 happening if you forget.

     ARCScomm/Phoenix Detail Design				   Page 68
     Appendix A: Migration and Installation Procedures



      8. ARCSSRVR.FOR
      ---------------


	 One change is necessary, and a second is possible.

	 Line #'s  Discussion
	 --------  ----------
	      35:  On line #35, simply change the value of KEY-ID to the
		   keyid of the dup field (after the dup field is keyed).
		   Right now, KEY-ID = 5 retrieves institution name field
		   keys for testing purposes.  This change is the server
		   side of the corresponding change (on the client side)
		   to the defined symbols DUPPOS and DUPLEN discussed in
		   ARCSCOMM.H above.  Make sure to do both changes
		   together.

	 180-190:  Lines #180 - #190 are supposed to trap dummy ARCS
		   records.  You must replace lines #183 and #184 with
		   real logic to toggle the logical DUMMY-REC to .TRUE. if
		   the record in arcscomm-buf is a dummy.  Criteria for
		   this determination were unavailable when the code was
		   written.

     ARCScomm/Phoenix Detail Design				   Page 69
     Appendix A: Migration and Installation Procedures



      9. ARCSUPDT.C
      -------------


	 This is the main program of ARCScomm/Phoenix.	Due to the
	 layering of the application, it appears reasonably free of code
	 affected by migration to FTNDEV.

	 Line #'s  Discussion
	 --------  ----------
	 215-216:  Recall the discussion of the SENDS flag under
		   ARCSCOMM.H above.  Lines #215 and #216 make a local
		   copy of the route code called gcn-key.  This is passed
		   to phnxclnt on #219 to retrieve the Phoenix record
		   corresponding to the ARCS record supplied by arcsclnt
		   (i.e., a recently-updated record).  The logic
		   determining gcn-key may require modification to select
		   between bankwire code and route code, depending on
		   SENDS.  This simply involves examining reply.clnt-reply
		   (the arcscomm-buf) for "I" or "D" in SENDS, and then
		   strncpy-ing the appropriate bytes to gcn-key.

	      44:  You will also probably want to adjust the value of
		   MSGLEVEL defined in #44 to reduce the detailed progress
		   reporting sent to the terminal.  Don't remove the
		   printf's since they're strategically placed to aid
		   debugging if necessary; just set MSGLEVEL to 0 and all
		   printing will toggle off.

	 Also of interest for debugging and program verification are the
	 switches on the command line.	Once arcsupdt.exe is installed as
	 a foreign command (e.g., $ arcsupdt :== $phnx:[]arcsupdt.exe),
	 then the command line is:
	      $ arcsupdt "dup" "flow-control"
	 where dup is the first key retrieved from ARCS, and flow-control
	 is a two-character combination from NN, YN, NY, YY.  The first
	 character toggles validation, the second navigation.  Validation
	 was originally a functional requirement that has since been
	 abandoned by CICI.  But toggling validation on may still be
	 useful for debugging purposes.

	 Navigation was never functionally requested.  It was implemented
	 entirely as a program verification tool, and works as follows.
	 Once toggled on, navigation pauses after processing each ARCS
	 record and prompts the terminal operator for the next retrieval
	 key (beware: it's case sensitive so use uppercase because that's
	 how ARCS keys are usually stored).  Thus, instead of
	 automatically issuing "NEXT"s to arcsclnt, navigation
	 single-steps through the update process, and allows any sequence
	 of retrievals the operator wants.  In combination with a large
	 MSGLEVEL value, this can help to readily zero in on a bug.

     ARCScomm/Phoenix Detail Design				   Page 70
     Appendix A: Migration and Installation Procedures



	 Also, the navigation prompt allows several special commands:
	 next, bye, and dump.  The "next" command simply gets the next
	 sequential record.  (Note that < CR > at the navigation prompt is
	 also interpreted as "next".)  The "bye" command obviously exits
	 the program.  The "dump" command produces a validation-like
	 screen (it calls arcsvalid with a special arg) showing every
	 field of both records.  After exiting the dump screen you get
	 another navigation prompt.

     ARCScomm/Phoenix Detail Design				   Page 71
     Appendix A: Migration and Installation Procedures



     10. ARCSUPDT.COM
     ----------------


	 This is the DCL command procedure.  It displays various menus to
	 the user and then executes ARCSUPDT.EXE passing it the
	 appropriate command-line arguments.  To determine the dup
	 argument, it reads the file ARCSUPDT.DUP whose last line contains
	 the last record updated.  ARCSUPDT.COM also does tape backup and
	 restore, and prints the ARCSUPDT.RPT file (containing the audit
	 trail report), all without using ARCSUPDT.EXE or any other
	 program.

	 This procedure may be affected both by migration considerations
	 and also by the fact that CICI wants it to be a seamless
	 interface with the rest of Phoenix.  Since the Phoenix interface
	 is not completely defined, functional changes to this procedure
	 are almost inevitable.

	 In addition, various migration changes are needed.  Some are
	 because two versions of arcsupdt.com are needed: one on ARCS and
	 one on Phoenix.  The difference in environments needs to be
	 reflected in differences within the command files (e.g., the
	 files ROUTE.MST and CITY.TBL are kept on both machines, but
	 probably in differently named directories).

	 Line #'s  Discussion
	 --------  ----------
	  38- 39   Set tape-flag="TRUE" when the procedure goes live and
		   someone is available to actually perform tape mounts.
		   Similarly, set prt-cmd to the string appropriate to the
		   machine on which the procedure resides.  On each
		   machine, prt-cmd must print a file wherever you want
		   it.
	  42- 44   These symbols point to the directories containing
		   ROUTE.MST and CITY.TBL on ARCS and Phoenix,
		   respectively.  The arcs symbol should remain as is, but
		   the phnx symbol will need to be determined.	Also, the
		   home symbol should be prefixed by phnx: instead of
		   cca$dev: on the Phoenix version.
	 290-298:  You can remove the write sys$outputs's "Now in
		   directory" statements, which are only there to verify
		   what's happening for debugging.  The mount statement
		   needs to address the correct device (it's probably not
		   msa0).  Also, the backup statement has neither been
		   carefully thought out nor tested because there was no
		   chance to actually mount a tape and test it.  The
		   saveset name and switches deserve more careful
		   consideration.
	 342-350:  The same comments apply for the backup operation here
		   as applied for the load operation above.

     ARCScomm/Phoenix Detail Design				   Page 72
     Appendix A: Migration and Installation Procedures



     11. ARCSVALID.C
     ---------------


	 This routine displays the validation screen and conducts a user
	 dialog, ultimately passing the validation command back to the
	 calling program, ARCSupdt.  CICI has decided not to use this
	 functionality, so there is no contractual need to maintain
	 arcsvalid.

	 However, as mentioned in the arcsupdt.c discussion, this routine
	 is used for program verification and debugging in various
	 contexts.  Since maintenance should be trivial anyway, it is
	 probably worth any small effort required.

	 Program functionality is entirely supported by the arcsphnx-flds
	 table in arcscomm.h, so only cosmetic changes should ever
	 directly affect the code itself.

     ARCScomm/Phoenix Detail Design				   Page 73
     Appendix A: Migration and Installation Procedures



     12. PDATA.H
     -----------


	 This file must eventually be replaced by an include file,
	 supplied by Phoenix, that describes the actual pdata structure.
	 Since the structure is addressed by offsets specified in
	 arcsphnx-flds (see arcscomm.h discussion), the field names within
	 static-cust-data and dynamic-cust-data are irrelevant.

	 Line #'s  Discussion
	 --------  ----------
	  22- 29:  The error codes are referenced by name within phnxclnt
		   (see below), so all the symbols on these lines must be
		   defined for compilation.

     ARCScomm/Phoenix Detail Design				   Page 74
     Appendix A: Migration and Installation Procedures



     13. PHNXCLNT.C
     --------------


	 This routine is the ARCScomm/Phoenix interface to Phoenix's
	 cust-file.

	 Line #'s  Discussion
	 --------  ----------
	  54- 62:  These symbols name the gateway routines supplied by
		   Phoenix.  Right now they're all stubbed out (except for
		   RDCUST which calls a test routine).	Integration
		   testing (and production runs) requires that real calls
		   be issued to the real routines, whose names have yet to
		   be determined.
	 116-184:  The various error returns from the gateway (prefixed by
		   DBSI- and defined in pdata.h) are used throughout here
		   to specify a success or failure status.  The exact
		   meaning (and therefore the proper use) of these returns
		   has not been unambiguously defined, so the logic needs
		   to be re-examined before going live.
	 191-229:  These dummy routines can be left in place (in case
		   they're ever needed for additional offline testing).
		   Howver, the symbols on lines #54 - #62 should not call
		   them once the system is live.

     ARCScomm/Phoenix Detail Design				   Page 75
     Appendix A: Migration and Installation Procedures



     14. PHNXMST.INC
     ---------------


	 This file is include-ed by arcssrvr.for to define the message
	 returned to arcsclnt in response to requests for an ARCS record.
	 The message format is specified by the two-column table
	 PHX-LAYOUT, whose symbols are defined in ROUTEMST.INC as follows:

	  Column   Discussion
	 -------   ----------
	    1	   This is the offset from the beginning of an ARCS record
		   to the first byte of the desired field.  -1 indicates a
		   dummy field to be filled by PHX-FILLER characters,
		   currently defined as '?'.  -3 is a special switch
		   (i.e., a kludge) that indicates the CITY-NAME field
		   which must be read from CITY-TBL.  -99 is another
		   special switch that fills the field with "99".
	    2	   This is the length of the corresponding field.  Some of
		   them are hard-coded because definition of the field is
		   an ARCS enhancement to be implemented later.  When it
		   is defined, the hard-coded number may be replaced by
		   the symbol in ROUTEMST.INC.

	 The message is constructed by successively concatanating fields
	 specified in PHX-LAYOUT.

     ARCScomm/Phoenix Detail Design				   Page 76
     Appendix A: Migration and Installation Procedures



     15. PHNXSTAT.H
     --------------


	 The symbols defined here are used by phnxclnt and arcsupdt.c.
	 The Phoenix gateway returns a variety of DBSI- error codes (see
	 pdata.h), but many fewer conditions actually need to be
	 identified for our purposes.  Therefore, phnxclnt looks at the
	 DBSI- code and returns a corresponding code from the symbols
	 defined here.

     ARCScomm/Phoenix Detail Design				   Page 77
     Appendix A: Migration and Installation Procedures



     16. ROUTEMST.INC
     ----------------


	 This include file defines the layout of an ARCS record.  The code
	 is maintained by ARCS.  Whenever ROUTEMST.INC changes,
	 arcssrvr.for must be re-compiled and -linked.	Note that no
	 changes to arcsphnx-flds should, in principle, be necessary
	 becuase the PHX-LAYOUT table will still construct exactly the
	 same message.	But if a field length changes, then that change
	 cannot be made transparently.	In this case arcsphnx-flds must be
	 changed correspondingly, and arcsupdt re-compiled and -linked.
	 Moreover, the Phoenix system must be aware of this change also,
	 since cust-file records will presumably be affected.

     ARCScomm/Phoenix Detail Design				   Page 78
     Appendix A: Migration and Installation Procedures



     17. VMSMSG.C
     ------------


	 This small routine just issues a $getmsg in case a VMS error
	 occurs.  It should never require maintenance of any kind (save a
	 future release of VMS that obsoletes it).

     ARCScomm/Phoenix Detail Design				   Page 79
     Appendix B: Source Code



			     Appendix B: Source Code
			     -----------------------


	      It was decided by CICI to omit the development of structured
	      english pseudocode for this design document.  This appendix
	      therefore contains the actual "C", Fortran, and DCL source
	      code developed for ARCScomm/Phoenix.  Modules are presented
	      in alphabetical order by module name.

	      Since the purpose of this appendix is to replace pseudocode
	      specifications, the source code listings herein should not
	      be considered absolutely up-to-date.  To fulfill their
	      purpose they need only be updated when a revision affects
	      the "high-level" logic of the system.  That is, when a
	      revision would affect pseudocode if there were pseudocode.

	      Therefore, do not refer to these listings when changing the
	      system.  CICI should separately maintain up-to-date listings
	      for reference and archival purposes.

     ARCScomm/Phoenix Detail Design				  Page B1
     Appendix B: Source Code - 1) ARCSUPDT.WAT


	 File #    File Name	  Page Description
	 ------    ---------	  ---- -----------
	     1)    ARCSUPDT.WAT   1    This file - table of contents.
	     2)    ARCSCLNT.C	  2    DECnet partner of ARCSSRVR.FOR that
				       issues requests for ARCS records.
	     3)    ARCSCOMM.H	  5    Tables that map the arcssrvr
				       message onto cust-file records.
	     4)    ARCSLINK.COM   8    Links ARCSupdt to create exe.
	     5)    ARCSPROOF.C	  9    Reconciles ARCS records and
				       cust-file records.
	     6)    ARCSRPT.C	  12   Writes audit trail report.
	     7)    ARCSSRVR.COM   16   Runs arcssrvr.exe after login to
				       Username: ARCSSRVR.
	     8)    ARCSSRVR.FOR   17   DECnet partner of ARCSCLNT.C that
				       services requests for ARCS records.
	     9)    ARCSUPDT.C	  23   Main program that drives update.
	    10)    ARCSUPDT.COM   30   DCL shell to execute arcsupdt.exe.
	    11)    ARCSVALID.C	  37   User validation screen and dialog.
	    12)    PDATA.H	  41   Defines Phoenix cust-file record
				       and gateway error returns.
	    13)    PHNXCLNT.C	  44   Issues calls to Phoenix gateway.
	    14)    PHNXMST.INC	  49   Defines message format to
				       arcssrvr.for.
	    15)    PHNXSTAT.H	  51   Defines phnxclnt error returns.
	    16)    ROUTEMST.INC   52   Defines ROUTE.MST record layout.
	    17)    VMSMSG.C	  57   Returns VMS error descriptions.

	  ARCScomm/Phoenix Detail Design                                              Page B2
	  Appendix B: Source Code - 2) ARCSCLNT.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	ARCSclnt
	    4:	 *
	    5:	 * Purpose:	Issues request for ARCS record to ARCSSRVR server task
	    6:	 *		running on VODKA, using transparent task-to-task communication.
	    7:	 *
	    8:	 * Call:	arcsclnt ( request, reply, nbytes )
	    9:	 *
	   10:	 * Arguments:
	   11:	 *		request (I)	addr of char string containing either key of
	   12:	 *				record to be retrieved, or NEXT for sequential
	   13:	 *				retrieval of next record.  Note: request = OPEN
	   14:	 *				or CLOSE to open/close DECnet link, and a null
	   15:	 *				request defaults to NEXT for your convenience.
	   16:	 *		reply (O)	addr of char string containing retrieved record
	   17:	 *				(if RMS$_NORMAL returned).  Note that caller
	   18:	 *				unions this string with struct of rec format.
	   19:	 *		nbytes (O)	addr of int returning number of bytes in reply
	   20:	 *				(note: check nbytes on return to make sure that
	   21:	 *				no unauthorized change in ARCSSRVR message
	   22:	 *				format has occurred).
	   23:	 *
	   24:	 * Returns:	- int
	   25:	 *		RMS$_NORMAL	for successful retrieval of requested record
	   26:	 *		RMS$_QUO	couldn't open or close file
	   27:	 *		RMS$_FTM	couldn't write request
	   28:	 *		RMS$_NET	couldn't read reply
	   29:	 *
	   30:	 * Note:	To establish the DECnet link:
	   31:	 *		$define task "vodka""arcscomm phoenix""::""task=arcssrvr"""
	   32:	 *
	   33:	 * Source:	ARCSCLNT.C
	   34:	 *
	   35:	 * --------------------------------------------------------------------------
	   36:	 * Revision History:
	   37:	 *
	   38:	 * 12/18/85	J.Forkosh	Installation.
	   39:	 *
	   40:	 ****************************************************************************/
	   41:	
	   42:	#include stdio
	   43:	#include rms
	   44:	/* ---------------------------------------------------------------------------
	   45:	   Global Variables
	   46:	--------------------------------------------------------------------------- */
	   47:	globalref int	msglevel;			/* debugging message level */
	   48:	
	   49:	arcsclnt ( request, reply, nbytes )
	   50:	char	*request;
	   51:	char	*reply;
	   52:	int	*nbytes;
	   53:	{
	   54:	
	   55:	/* ---------------------------------------------------------------------------

	  ARCScomm/Phoenix Detail Design                                              Page B3
	  Appendix B: Source Code - 2) ARCSCLNT.C


	   56:	   Allocations and Declarations
	   57:	--------------------------------------------------------------------------- */
	   58:	static int	task_file;			/* TASK file descriptor */
	   59:	char		task_request[128];		/* local copy of request */
	   60:	int		reply_len;			/* #chars returned by server */
	   61:	
	   62:	/* ---------------------------------------------------------------------------
	   63:	   Initialization
	   64:	--------------------------------------------------------------------------- */
	   65:	if ( msglevel > 99 )				/* level of debugging output */
	   66:		printf ("\nARCSclnt> request= %.32s", request );
	   67:	*nbytes = 0;					/* default no reply */
	   68:	
	   69:	/* ---------------------------------------------------------------------------
	   70:	   Open/Close the task file when *request = OPEN/CLOSE, respectively.
	   71:	--------------------------------------------------------------------------- */
	   72:	if ( !strcmp(request,"OPEN") )			/* OPEN requested */
	   73:		{
	   74:		if ((task_file = open("TASK",0002,0777,"mrs=512","shr=upi")) == -1)
	   75:			{
	   76:			if ( msglevel > 0 )
	   77:				printf("\nARCSclnt> Can't open() TASK file.");
	   78:			return ( RMS$_QUO );		/* can't open TASK */
	   79:			}
	   80:		return ( RMS$_NORMAL );			/* successfully opened */
	   81:		}
	   82:	
	   83:	if ( !strcmp(request,"CLOSE") )			/* CLOSE requested */
	   84:		{
	   85:		close ( task_file );
	   86:		return ( RMS$_NORMAL );			/* ignore error returns */
	   87:		}
	   88:	
	   89:	/* ---------------------------------------------------------------------------
	   90:	   Issue request, read reply.
	   91:	--------------------------------------------------------------------------- */
	   92:	strcpy ( task_request, request );		/* local copy of request */
	   93:	if ( strlen(task_request) == 0 )		/* null request = NEXT */
	   94:		strcpy(task_request,"NEXT");
	   95:	
	   96:	if ( write(task_file,task_request,strlen(task_request)) == -1 )
	   97:		{
	   98:		if ( msglevel > 1 )
	   99:			printf("\nARCSclnt> Can't write() request.");
	  100:		return ( RMS$_FTM );
	  101:		}
	  102:	
	  103:	if ( (reply_len=read(task_file,reply,512)) == -1 )
	  104:		{
	  105:		if ( msglevel > 1 )
	  106:			printf("\nARCSclnt> Can't read() reply");
	  107:		return ( RMS$_NET );
	  108:		}
	  109:	
	  110:	/* ---------------------------------------------------------------------------
	  111:	   Return reply to caller

	  ARCScomm/Phoenix Detail Design                                              Page B4
	  Appendix B: Source Code - 2) ARCSCLNT.C


	  112:	--------------------------------------------------------------------------- */
	  113:	*nbytes = reply_len;				/* # bytes returned in reply */
	  114:	return ( RMS$_NORMAL );
	  115:	}

	  ARCScomm/Phoenix Detail Design                                              Page B5
	  Appendix B: Source Code - 3) ARCSCOMM.H


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Structures:	arcscomm_buf
	    4:	 *		arcsphnx_flds
	    5:	 *
	    6:	 * Purpose:	arcscomm_buf describes the message format used by ARCSsrvr
	    7:	 *		to send Route_Mst records across DECnet, and arcsphnx_flds
	    8:	 *		gives the positional correspondence of these fields in the
	    9:	 *		Phoenix static and dynamic customer data structures:
	   10:	 *
	   11:	 * Notes:	In principle, arcscomm_buf ought to EXACTLY CORRESPOND to the
	   12:	 *		include file PHNXMST.INC compiled with the DECnet partner task
	   13:	 *		ARCSsrvr.  But we actually use the offset table, so this struct
	   14:	 *		is for informational purposes only.
	   15:	 *
	   16:	 *		arcsphnx_flds contains the ARCS and Phoenix offsets and lengths
	   17:	 *		of equivalent fields on the two systems: it actually drives the
	   18:	 *		reconciliation and update process, and must always be in synch
	   19:	 *		with PHNXMST.INC.
	   20:	 *
	   21:	 *		Note slight Kludges where a negative Phoenix offset is used
	   22:	 *		to indicate dynamic cust data.  And a negative ARCS offset
	   23:	 *		indicates a dummy arg (e.g., usually used to denote a field
	   24:	 *		passed by ARCSsrvr but not stored by Phoenix in cust-file).
	   25:	 *
	   26:	 * Source:	ARCSCOMM.H
	   27:	 *
	   28:	 * --------------------------------------------------------------------------
	   29:	 * Revision History:
	   30:	 *
	   31:	 * 12/30/85	J.Forkosh	Installation.
	   32:	 *
	   33:	 ****************************************************************************/
	   34:	
	   35:	/* ---------------------------------------------------------------------------
	   36:	   Position and length of keys in ARCSsrvr message (points to inst for test,
	   37:	   so DUPPOS and DUPLEN must point to dup field when system goes live.)
	   38:	--------------------------------------------------------------------------- */
	   39:	#define	DUPPOS 37
	   40:	#define	DUPLEN 25
	   41:	#define	GCNPOS 0
	   42:	#define	GCNLEN 5
	   43:	
	   44:	/* ---------------------------------------------------------------------------
	   45:	   Fields not defined on ARCS are packed with ARCS_FILLER in the Xmitted msg.
	   46:	--------------------------------------------------------------------------- */
	   47:	#define ARCS_FILLER '?'
	   48:	
	   49:	/* ---------------------------------------------------------------------------
	   50:	   ARCSsrvr replies are formatted as follows...
	   51:	--------------------------------------------------------------------------- */
	   52:							/* ------------------------ */
	   53:	struct	arcscomm_buf				/* Fld Description          */
	   54:		{					/* ------------------------ */
	   55:		char		gcn[ 5];		/*   1 GCN Route Code       */

	  ARCScomm/Phoenix Detail Design                                              Page B6
	  Appendix B: Source Code - 3) ARCSCOMM.H


	   56:		char		cty[ 3];		/*   2 City Code            */
	   57:		char		ctn[26];		/*   3 City Name            */
	   58:		char		cny[ 3];		/*   4 Country Code         */
	   59:		char		nm1[72];		/*   5 Institution Name     */
	   60:		char		bkw[ 4];		/*   6 Bankwire Code        */
	   61:		char		tn1[13];		/*   7 1st Telex Number     */
	   62:		char		ta1[20];		/*   8 1st Telex Answerback */
	   63:		char		tn2[13];		/*   9 2nd Telex Number     */
	   64:		char		ta2[20];		/*  10 2nd Telex Answerback */
	   65:		char		tn3[13];		/*  11 3rd Telex Number     */
	   66:		char		ta3[20];		/*  12 3rd Telex Answerback */
	   67:		char		bid[19];		/*  13 Bank/Correspondent ID*/
	   68:		char		aba[ 9];		/*  14 ABA Number           */
	   69:		char		dda[ 8];		/*  15 DDA Number           */
	   70:		char		mbc[ 4];		/*  16 Marti Bank Code      */
	   71:		char		tfs[ 1];		/*  17 Test Flag - SENDS    */
	   72:		char		dup[ 6];		/*  18 Date of Last Update  */
	   73:		char		opr[ 2];		/*  19 Operator ID ("99")   */
	   74:		char		sgm[ 5];		/*  20 System Msgs Route Cd */
	   75:		char		mci[ 5];		/*  21 Master Cust Route Cd */
	   76:		char		ovr[ 5];		/*  22 Override    Route Cd */
	   77:		};					/* ------------------------ */
	   78:	
	   79:	/* ---------------------------------------------------------------------------
	   80:	   This shows how ARCSsrvr msgs map onto Phoenix customer-data records...
	   81:	--------------------------------------------------------------------------- */
	   82:	#define	DOMESTIC_FLD	17
	   83:	#define	DOMROUTE_FLD	6
	   84:	#define	FORROUTE_FLD	1
	   85:	
	   86:	struct	{					/* ------------------------ */
	   87:		char		fld_name[16];		/* Used to format reports   */
	   88:		int		fld_len;		/* #bytes - same for both   */
	   89:		int		arcs_offset;		/* #bytes preceding fld     */
	   90:		int		phnx_offset;		/* + = static, - = dynamic  */
	   91:		char		phnx_mask[32];		/* cust-file field template */
	   92:		}					/* ------------------------ */
	   93:		arcsphnx_flds[] =			/* Fld Description          */
	   94:		{					/* ------------------------ */
	   95:		"Route Code",	 5,   0, 124, "",	/*   1 Same as above        */
	   96:		"City Code",	 3,   5,  98, "",	/*   2                      */
	   97:		"City Name",	26,   8,  72, "",	/*   3                      */
	   98:		"Country Code",	 3,  34, 101, "",	/*   4                      */
	   99:		"Institution",	72,  37,   0, "",	/*   5                      */
	  100:		"BankWire Code", 4, 109, 124, "",	/*   6                      */
	  101:		"Telex 1",	13, 113, 142, "",	/*   7                      */
	  102:		"AnswerBack 1",	20, 126, 156, "",	/*   8                      */
	  103:		"Telex 2",	13, 146, 178, "",	/*   9                      */
	  104:		"AnswerBack 2",	20, 159, 192, "",	/*  10                      */
	  105:		"Telex 3",	13, 179, 214, "",	/*  11                      */
	  106:		"AnswerBack 3",	20, 192, 228, "",	/*  12                      */
	  107:		"Bank ID",	19, 212, 104, "C",	/*  13                      */
	  108:		"ABA Number",	 9, 231, 256, "",	/*  14                      */
	  109:		"DDA Number",	 8, 240, 248, "",	/*  15                      */
	  110:		"MARTI Code",	 4,-248,   0, "",	/*  16                      */
	  111:		"SENDS Flag",	 1, 252, 330, "",	/*  17                      */

	  ARCScomm/Phoenix Detail Design                                              Page B7
	  Appendix B: Source Code - 3) ARCSCOMM.H


	  112:		"Last Update",	 6,-253,   0, "",	/*  18                      */
	  113:		"Operator ID",	 2,-259,   0, "",	/*  19                      */
	  114:		"System Route",	 5, 261, 270, "",	/*  20                      */
	  115:		"Master Route",	 5, 266, 290, "",	/*  21                      */
	  116:		"Override Route",5, 271, 310, "",	/*  22                      */
	  117:		"End-of-Table",	-1,  -1,  -1, ""	/* ------------------------ */
	  118:		};
	  119:	
	  120:	/* ============================ End-of-File =============================== */

	  ARCScomm/Phoenix Detail Design                                              Page B8
	  Appendix B: Source Code - 4) ARCSLINK.COM


	    1:	$ set on
	    2:	$ link arcsupdt,arcsclnt,phnxclnt,arcsproof,arcsvalid,arcsrpt,vmsmsg
	    3:	$ set noon

	  ARCScomm/Phoenix Detail Design                                              Page B9
	  Appendix B: Source Code - 5) ARCSPROOF.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	ARCSproof
	    4:	 *
	    5:	 * Purpose:	Reconciles a Phoenix customer record with an ARCS message.
	    6:	 *
	    7:	 * Call:	arcsproof ( opcode, arcsmsg, pdata, prfflds )
	    8:	 *
	    9:	 * Arguments:
	   10:	 *		opcode (I)	addr of char string containing "COMP" for
	   11:	 *				compare only, "COPY" for compare and move
	   12:	 *				updated fields from arcsmsg to pdata, or
	   13:	 *				"INIT" to move all fields (no compare).
	   14:	 *		arcsmsg (I)	addr of char string containing ARCS message.
	   15:	 *		pdata (I)	addr of process data struct containing
	   16:	 *				static and dynamic cust-data to be
	   17:	 *				reconciled.
	   18:	 *		prfflds (O)	addr of int vector returning the sequence
	   19:	 *				number (1=gcn,etc) of fields not agreeing.
	   20:	 *
	   21:	 * Returns:	- int		number of fields not agreeing, zero means
	   22:	 *				no update required.
	   23:	 *
	   24:	 * Note:	strncmp() is used to compare fields, so they'd better all
	   25:	 *		be ascii chars (i.e., a NULL will stop strncmp prematurely).
	   26:	 *
	   27:	 * Source:	ARCSPROOF.C
	   28:	 *
	   29:	 * --------------------------------------------------------------------------
	   30:	 * Revision History:
	   31:	 *
	   32:	 * 01/03/86	J.Forkosh	Installation.
	   33:	 *
	   34:	 ****************************************************************************/
	   35:	
	   36:	#include stdio
	   37:	#include "arcscomm.h"
	   38:	#include "pdata.h"
	   39:	/* ---------------------------------------------------------------------------
	   40:	   Global Variables
	   41:	--------------------------------------------------------------------------- */
	   42:	globalref int	msglevel;			/* debugging message level */
	   43:	
	   44:	arcsproof ( opcode, arcsmsg, pdata, prfflds )
	   45:	char	*opcode;
	   46:	char	*arcsmsg;
	   47:	struct	process_data *pdata;
	   48:	int	*prfflds;
	   49:	{
	   50:	
	   51:	/* ---------------------------------------------------------------------------
	   52:	   Allocations and Declarations
	   53:	--------------------------------------------------------------------------- */
	   54:	int	nprf;					/* # fields not agreeing */
	   55:	int	iprf;					/* sequence # of field */

	  ARCScomm/Phoenix Detail Design                                              Page B10
	  Appendix B: Source Code - 5) ARCSPROOF.C


	   56:	int	skipprf;				/* I/D field to be skipped */
	   57:	int	nbytes;					/* fld_len */
	   58:	int	arcsoff;				/* arcs_offset */
	   59:	int	phnxoff;				/* phnx_offset */
	   60:	char	*arcsptr,*phnxptr;			/* char ptrs to arcs & phnx */
	   61:	char	arcsfld[256];				/* mask & fld */
	   62:	char	*phnxmask;				/* ptr to cust-file template */
	   63:	int	nmask,nfld;				/* len of mask, tot fld len */
	   64:	static	int ncalls = 0;				/* toggle for filler init */
	   65:	static	char arcs_filler[256];			/* filler */
	   66:	
	   67:	/* ---------------------------------------------------------------------------
	   68:	   Initialization
	   69:	--------------------------------------------------------------------------- */
	   70:	if ( msglevel > 99 )				/* level of debugging output */
	   71:		printf("\nARCSproof> %.4s arcs<%.25s> phnx<%.25s>",
	   72:		opcode,arcsmsg,(char *)&(pdata->static_cust_data));
	   73:	if ( ncalls == 0 )				/* init filler on 1st call */
	   74:		for(ncalls=0;ncalls<256;ncalls++) arcs_filler[ncalls] = ARCS_FILLER;
	   75:	nprf = 0;					/* so far, so good */
	   76:	iprf = 0;					/* start at the beginning */
	   77:	
	   78:	/* ---------------------------------------------------------------------------
	   79:	   Kludge to check for foreign/domestic indicator
	   80:	   (this requirement was conveyed by Randi during 1/24/86 meeting)
	   81:	--------------------------------------------------------------------------- */
	   82:	skipprf = -1;					/* init to no skips */
	   83:	arcsptr = arcsmsg + arcsphnx_flds[DOMESTIC_FLD-1].arcs_offset; /* ptr to I/D */
	   84:	if ((*arcsptr == 'I')
	   85:	||  (*arcsptr == 'N')) skipprf= DOMROUTE_FLD-1;	/* Int'l, so skip domestic */
	   86:	if ( *arcsptr == 'D' )
	   87:		{					/* check domestic non-blank */
	   88:		arcsptr = arcsmsg + arcsphnx_flds[DOMROUTE_FLD-1].arcs_offset;
	   89:		for (nbytes=0; nbytes<32; nbytes++)	/* strncpy won't 0 term. so */
	   90:			arcsfld[nbytes]='\000';		/* all nulls to start */
	   91:		nbytes = arcsphnx_flds[DOMROUTE_FLD-1].fld_len; /* len of DOMROUTE */
	   92:		strncpy(arcsfld,arcsptr,nbytes);	/* local copy of DOMROUTE */
	   93:		arcsfld[nbytes] = '\000';		/* NULL-terminated */
	   94:		if( (strlen(arcsfld) == nbytes)		/* if we have a DOMROUTE_FLD */
	   95:		&&  strncmp(arcsfld,"        ",nbytes) )/* and it's non-blank */
	   96:			skipprf= FORROUTE_FLD-1; 	/* Domestic, so skip int'l */
	   97:		else
	   98:			skipprf= DOMROUTE_FLD-1;	/* skip blank domestic field */
	   99:		}
	  100:	
	  101:	/* ---------------------------------------------------------------------------
	  102:	   Run through arcsphnx_flds until -1 fld_len indicates end-of-table
	  103:	--------------------------------------------------------------------------- */
	  104:	while ( (nbytes = arcsphnx_flds[iprf].fld_len) > 0 )	/* trailer is -1 */
	  105:		{
	  106:		if ( (iprf != skipprf)			/* skip int'l or domestic */
	  107:		&&   (arcsoff = arcsphnx_flds[iprf].arcs_offset) >= 0 )/* <0 is stub */
	  108:			{
	  109:			phnxoff = arcsphnx_flds[iprf].phnx_offset;
	  110:			arcsptr = arcsmsg + arcsoff;
	  111:			nmask = strlen((phnxmask = arcsphnx_flds[iprf].phnx_mask));

	  ARCScomm/Phoenix Detail Design                                              Page B11
	  Appendix B: Source Code - 5) ARCSPROOF.C


	  112:			nfld = nmask + nbytes;		/* tot fld len = mask + arcs */
	  113:			strcpy(arcsfld,phnxmask);	/* start with mask */
	  114:			strncat(arcsfld,arcsptr,nbytes);/* concat arcs field */
	  115:			arcsfld[nfld] = '\000';		/* NULL-terminated */
	  116:			if ( phnxoff >= 0 )		/* use static_cust_data */
	  117:				phnxptr= (char *)&(pdata->static_cust_data) + phnxoff;
	  118:			else				/* use dynamic_cust_data */
	  119:				phnxptr= (char *)&(pdata->dynamic_cust_data) - phnxoff;
	  120:			if ( msglevel > 199 )
	  121:				printf("\nARCSproof> fld#%2d len=%2d <%.25s> <%.25s>",
	  122:				iprf,nbytes,arcsfld,phnxptr);
	  123:			if ( !strcmp(opcode,"INIT") )	/* always copy for INIT */
	  124:				strncpy(phnxptr,arcsfld,nfld);
	  125:			if (strncmp(arcsfld,phnxptr,nfld)	/* (a) ARCS!=Phoenix */
	  126:			&&  strncmp(arcsptr,arcs_filler,nbytes))/* (b) ARCS!=filler */
	  127:				{				/* fields not equal */
	  128:				prfflds[nprf++] = iprf;		/* so record field # */
	  129:				if ( !strcmp(opcode,"COPY") )	/* and copy if asked */
	  130:					strncpy(phnxptr,arcsfld,nfld);
	  131:				}
	  132:			}
	  133:		iprf++;
	  134:		}
	  135:	
	  136:	/* ---------------------------------------------------------------------------
	  137:	   Return to caller
	  138:	--------------------------------------------------------------------------- */
	  139:	return ( nprf );
	  140:	}

	  ARCScomm/Phoenix Detail Design                                              Page B12
	  Appendix B: Source Code - 6) ARCSRPT.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	ARCSrpt
	    4:	 *
	    5:	 * Purpose:	Write update report for a single customer record.
	    6:	 *
	    7:	 * Call:	arcsrpt ( rptptr, arcsmsg, pdata, nprf, prfflds )
	    8:	 *
	    9:	 * Arguments:
	   10:	 *		rptptr (I)	addr of FILE struct to report file,
	   11:	 *				as returned by fopen().
	   12:	 *		arcsmsg (I)	addr of char string containing ARCS message.
	   13:	 *		pdata (I)	addr of process data struct containing
	   14:	 *				static and dynamic cust-data to be
	   15:	 *				reported.
	   16:	 *		nprf (I)	int containing number of prfflds below.  If
	   17:	 *				nprf=0 indicates initial customer record,
	   18:	 *				nprf<0 to print report trailer at end of job.
	   19:	 *		prfflds (I)	addr of int vector containing the sequence
	   20:	 *				number (1=gcn,etc) of fields not agreeing.
	   21:	 *
	   22:	 * Returns:	- int
	   23:	 *
	   24:	 * Source:	ARCSRPT.C
	   25:	 *
	   26:	 * --------------------------------------------------------------------------
	   27:	 * Revision History:
	   28:	 *
	   29:	 * 01/08/86	J.Forkosh	Installation.
	   30:	 *
	   31:	 ****************************************************************************/
	   32:	
	   33:	#include stdio
	   34:	#include "arcscomm.h"
	   35:	#include "pdata.h"
	   36:	
	   37:	/* ---------------------------------------------------------------------------
	   38:	   Global Variables
	   39:	--------------------------------------------------------------------------- */
	   40:	globalref int	msglevel;			/* debugging message level */
	   41:	
	   42:	arcsrpt ( rptptr, arcsmsg, pdata, nprf, prfflds )
	   43:	FILE	*rptptr;
	   44:	char	*arcsmsg;
	   45:	struct	process_data *pdata;
	   46:	int	nprf;
	   47:	int	*prfflds;
	   48:	{
	   49:	
	   50:	/* ---------------------------------------------------------------------------
	   51:	   Allocations and Declarations
	   52:	--------------------------------------------------------------------------- */
	   53:	int	ifld,nfld;				/* index over nprf */
	   54:	int	iprf;					/* field number */
	   55:	int	nbytes,nmask;				/* fld_len, mask len */

	  ARCScomm/Phoenix Detail Design                                              Page B13
	  Appendix B: Source Code - 6) ARCSRPT.C


	   56:	int	arcsoff;				/* arcs_offset */
	   57:	int	phnxoff;				/* phnx_offset */
	   58:	char	*arcsptr,*phnxptr;			/* char ptrs to arcs & phnx */
	   59:	char	arcsfld[256],phnxfld[256];		/* local copies of fields */
	   60:	char	*stub_name;				/* char ptr to field name */
	   61:	char	*hdr_ptrs[8];				/* char ptrs to hdr fields */
	   62:	static	int nlines = 99, maxlines = 60;		/* num lines on page */
	   63:	static	int npages = 0;				/* page number */
	   64:	static	int hdr_flds[] = {0,3,4,-1};		/* GCN,Country,Inst. */
	   65:	int	ihdr;					/* index for hdr_lines */
	   66:	
	   67:	/* ---------------------------------------------------------------------------
	   68:	   Report Layouts
	   69:	------------------------------------------------------------------------------
	   70:	          1         2         3         4         5         6         7
	   71:	"1234567890123456789012345678901234567890123456789012345678901234567890123456"
	   72:	--------------------------------------------------------------------------- */
	   73:	static	char *hdr_lines[] =
	   74:	{
	   75:	"                        ARCSCOMM/PHOENIX UPDATE REPORT                      ",
	   76:	"     ---------------------------------------------------------------------  ",
	   77:	" ",
	   78:	" ",
	   79:	" ",
	   80:	""
	   81:	};
	   82:	static	char *hdr_fmt =
	   83:	"\n     ROUTE CODE: %-5.5s  COUNTRY: %-3.3s  NAME: %-.32s";
	   84:	static	char *fld_fmt =
	   85:	"\n     %-12.12s     %-25.25s    %-25.25s";
	   86:	static	char *fld_ftr =
	   87:	"\n     ---------------------------------------------------------------------";
	   88:	static	char *pg_ftr =
	   89:	"\n                              --  Page %d  --\f";
	   90:	
	   91:	/* ---------------------------------------------------------------------------
	   92:	   Initialization
	   93:	--------------------------------------------------------------------------- */
	   94:	if ( msglevel > 99 )				/* level of debugging output */
	   95:		{
	   96:		printf("\nARCSrpt> arcs<%.25s> phnx<%.25s>",
	   97:		arcsmsg,(char *)&(pdata->static_cust_data));
	   98:		}
	   99:	if( (nfld=(nprf>0)?nprf:0) == 0 )		/* new record or update ? */
	  100:		while(arcsphnx_flds[nfld].fld_len>=0) nfld++;
	  101:	if ( nprf<0 ) nfld=99;				/* kicker for final footer */
	  102:	
	  103:	/* ---------------------------------------------------------------------------
	  104:	   Print header
	  105:	--------------------------------------------------------------------------- */
	  106:	/* --- first "foot" previous customer --- */
	  107:	if ( npages > 0 )				/* don't foot before 1st pg */
	  108:		{
	  109:		fprintf(rptptr,fld_ftr);		/* footer */
	  110:		fprintf(rptptr,"\n\n");			/* and white space */
	  111:		nlines += 3;				/* and bump line counter */

	  ARCScomm/Phoenix Detail Design                                              Page B14
	  Appendix B: Source Code - 6) ARCSRPT.C


	  112:		}
	  113:	
	  114:	/* --- now check for required page break --- */
	  115:	if ( nlines + nfld + 5 > maxlines )		/* can't finish on this page */
	  116:		{					/* so we need a page break */
	  117:		if ( npages > 0 )
	  118:			{				/* print footer except pg 1 */
	  119:			while ( nlines++ < maxlines )
	  120:				fprintf(rptptr,"\n");	/* skip to bottom of page */
	  121:			fprintf(rptptr,pg_ftr,npages);	/* and print footer */
	  122:			}
	  123:		if ( nfld>maxlines ) return;		/* trap end-of-job footer */
	  124:		npages++;				/* bump page counter */
	  125:		for ( nlines=0; strlen(hdr_lines[nlines])>0; nlines++ )
	  126:			fprintf(rptptr,"\n%s",hdr_lines[nlines]); /* print header */
	  127:		}
	  128:	
	  129:	/* --- print header lines for this customer update --- */
	  130:	for ( ihdr=0; (iprf=hdr_flds[ihdr]) >= 0; ihdr++ ) /* get hdr flds */
	  131:		hdr_ptrs[ihdr] = arcsmsg + arcsphnx_flds[iprf].arcs_offset;
	  132:	fprintf(rptptr,hdr_fmt, hdr_ptrs[0],hdr_ptrs[1],hdr_ptrs[2]);
	  133:	fprintf(rptptr,fld_ftr);
	  134:	fprintf(rptptr,fld_fmt, "FIELD NAME","ARCS VALUE","PHOENIX VALUE");
	  135:	fprintf(rptptr,fld_fmt, "----------","----------","-------------");
	  136:	nlines += 4;					/* bump line counter */
	  137:	
	  138:	/* ---------------------------------------------------------------------------
	  139:	   Run through unreconciled fields indicated in prfflds
	  140:	--------------------------------------------------------------------------- */
	  141:	/* --- loop through fields --- */
	  142:	for ( ifld=0; ifld < nfld; ifld++ )
	  143:		{
	  144:		if( nprf > 0 )				/* got an updated cust... */
	  145:			iprf = prfflds[ifld];		/* ...so lookup prfflds */
	  146:		else					/* got a new cust... */
	  147:			iprf=ifld;			/* ...so shoot the works */
	  148:		stub_name=arcsphnx_flds[iprf].fld_name;
	  149:		nbytes  = arcsphnx_flds[iprf].fld_len;
	  150:		nmask   = strlen(arcsphnx_flds[iprf].phnx_mask);
	  151:		arcsoff = arcsphnx_flds[iprf].arcs_offset;
	  152:		phnxoff = arcsphnx_flds[iprf].phnx_offset;
	  153:		arcsptr = arcsmsg + arcsoff;
	  154:		if ( phnxoff >= 0 )			/* use static_cust_data */
	  155:			phnxptr = (char *)&(pdata->static_cust_data) + phnxoff;
	  156:		else					/* use dynamic_cust_data */
	  157:			phnxptr = (char *)&(pdata->dynamic_cust_data)- phnxoff;
	  158:		if ( arcsoff >= 0 )
	  159:			{				/* >=0 means real field */
	  160:			strncpy(arcsfld,arcsptr,nbytes);/* local copies... */
	  161:			strncpy(phnxfld,phnxptr,nbytes+nmask);
	  162:			arcsfld[nbytes] = phnxfld[nbytes+nmask] = '\000';/* NULLs */
	  163:			}
	  164:		else
	  165:			{				/* <0 means dummy field */
	  166:			strcpy(arcsfld,"dummy field");
	  167:			phnxfld[0] = '\000';

	  ARCScomm/Phoenix Detail Design                                              Page B15
	  Appendix B: Source Code - 6) ARCSRPT.C


	  168:			}
	  169:		if( nprf==0 )
	  170:			{				/* we're doing new cust ... */
	  171:			phnxfld[0]='\000';		/* print blanks except line1 */
	  172:			if( ifld==0 )
	  173:				strcpy(phnxfld,"---NEW CUSTOMER---");
	  174:			}
	  175:		fprintf(rptptr, fld_fmt, stub_name,arcsfld,phnxfld);/* print them */
	  176:		nlines++;				/* bump line counter */
	  177:		}
	  178:	
	  179:	/* ---------------------------------------------------------------------------
	  180:	   Return to caller
	  181:	--------------------------------------------------------------------------- */
	  182:	return;
	  183:	}

	  ARCScomm/Phoenix Detail Design                                              Page B16
	  Appendix B: Source Code - 7) ARCSSRVR.COM


	    1:	$ run dua1:[ccasy1.forkosh.arcscomm]arcssrvr.exe
	    2:	$ exit

	  ARCScomm/Phoenix Detail Design                                              Page B17
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	    1:	C/*****************************************************************************
	    2:	C *
	    3:	C * PROGRAM:	ARCSSRVR
	    4:	C *
	    5:	C * PURPOSE:	READS REQUEST FOR ARCS RECORD FROM PHOENIX CLIENT TASK
	    6:	C *		USING TRANSPARENT TASK-TO-TASK DECNET COMMUNICATION,
	    7:	C *		AND RETURNS THE REQUESTED RECORD.
	    8:	C *
	    9:	C * CALL:	$ RUN ARCSSRVR
	   10:	C *		(NOTE: ARCSSRVR MUST BE RUN FROM PROCEDURE ARCSSRVR.COM,
	   11:	C *		WHICH IS POINTED TO ON THE CLIENT MACHINE BY:
	   12:	C *		$ DEF TASK "VODKA""ARCSCOMM PHOENIX""::""TASK=ARCSSRVR.COM""")
	   13:	C *
	   14:	C * ARGUMENTS:	NONE - ALL INPUT READ FROM 'SYS$NET'
	   15:	C *
	   16:	C * SOURCE:	ARCSSRVR.FOR
	   17:	C *
	   18:	C * ---------------------------------------------------------------------------
	   19:	C * REVISION HISTORY:
	   20:	C *
	   21:	C * 12/19/85  J.FORKOSH		INSTALLATION
	   22:	C *
	   23:	C ****************************************************************************/
	   24:	
	   25:	C ----------------------------------------------------------------------------
	   26:		PROGRAM ARCSSRVR
	   27:	C ----------------------------------------------------------------------------
	   28:	C -----	GLOBAL VARIABLES
	   29:		INCLUDE 'ROUTEMST.INC'			! ROUTE_MST RECORD LAYOUT
	   30:		INCLUDE 'PHNXMST.INC'			! PHOENIX BUFFER RECORD LAYOUT
	   31:	
	   32:	C -----	LOCAL VARIABLES
	   33:		CHARACTER RTEMST_KEY*50			! KEY SENT TO SERVER BY CLIENT
	   34:		CHARACTER ARCSCOMM_BUF*512		! BUFFER RETURNED TO CLIENT
	   35:		INTEGER KEY_ID/5/			! RMS KEYID
	   36:		INTEGER DECNET_UNIT/1/, ROUTE_UNIT/2/,	! FORTRAN UNIT #'S
	   37:	     +		CITY_UNIT/3/
	   38:	
	   39:	C -----------------------------------------------------------------------------
	   40:	C	OPEN FILES TO DECNET PARTNER ON SYS$NET AND TO ROUTE_MST AND CITY_TBL.
	   41:	C -----------------------------------------------------------------------------
	   42:		OPEN	(
	   43:	     +		UNIT=DECNET_UNIT,
	   44:	     +		NAME='SYS$NET',
	   45:	     +		TYPE='OLD',
	   46:	     +		FORM='FORMATTED',
	   47:	     +		ACCESS='SEQUENTIAL',
	   48:	     +		RECORDSIZE=512,
	   49:	     +		CARRIAGECONTROL='NONE'
	   50:	     +		)
	   51:	
	   52:		OPEN	(
	   53:	     +		UNIT=ROUTE_UNIT,
	   54:	     +		NAME='ROUTE_MST',
	   55:	     +		TYPE='OLD',

	  ARCScomm/Phoenix Detail Design                                              Page B18
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	   56:	     +		FORM='UNFORMATTED',
	   57:	     +		ORGANIZATION='INDEXED',
	   58:	     +		ACCESS='KEYED',
	   59:	     +		READONLY,
	   60:	     +		SHARED,
	   61:	     +		RECORDTYPE='FIXED',
	   62:	     +		RECORDSIZE=128,
	   63:	     +		BLOCKSIZE=4096,
	   64:	     +		ERR=1000,
	   65:	     +		IOSTAT=IOS
	   66:	     +		)
	   67:	
	   68:		OPEN	(
	   69:	     +		UNIT=CITY_UNIT,
	   70:	     +		NAME='CITY_TBL',
	   71:	     +		STATUS='OLD',
	   72:	     +		ACCESS='KEYED',
	   73:	     +		FORM='UNFORMATTED',
	   74:	     +		DISP='SAVE',
	   75:	     +		RECORDTYPE='FIXED', 
	   76:	     +		BUFFERCOUNT=2,
	   77:	     +		SHARED,
	   78:	     +		ERR=1000
	   79:	     +		)
	   80:	
	   81:	C ----------------------------------------------------------------------------
	   82:	C 	LOOP FOREVER, SERVING CLIENT UNTIL EOF ON SYS$NET
	   83:	C ----------------------------------------------------------------------------
	   84:		DO 999 WHILE (.TRUE.)
	   85:	
	   86:	C ----- WAIT ON READ FOR NEXT CLIENT REQUEST OR EOF FOR END
	   87:		READ(DECNET_UNIT,100,END=1000,ERR=910) RTEMST_KEY
	   88:	  100	FORMAT(A)
	   89:	
	   90:	C ----- REQUEST FORMAT IS 'NEXT' FOR SEQUENTIAL ACCESS, OR KEY VALUE
	   91:	  200	IF(RTEMST_KEY(1:4).EQ.'NEXT') THEN	! SEQUENTIAL ACCESS REQUESTED
	   92:			READ (ROUTE_UNIT,END=920,ERR=910) RTEBUF
	   93:		ELSE					! GOT A KEYED ACCESS REQUEST
	   94:			READ (ROUTE_UNIT,KEYID=KEY_ID,KEYGE=RTEMST_KEY,IOSTAT=IOS,
	   95:	     +		ERR=910) RTEBUF
	   96:		END IF
	   97:	
	   98:	C ----- FORMAT A ARCSCOMM MESSAGE BUFFER AND RETURN IT
	   99:		CALL ARCSCOMM_MSG ( RTEBUF, PHX_FILLER, ARCSCOMM_BUF, NBYTES )
	  100:		IF(NBYTES.LT.0) THEN			! CHECK RETURN FOR DUMMY RECORD
	  101:			RTEMST_KEY(1:4) = 'NEXT'	! TRY NEXT REC IF CURRENT DUMMY
	  102:			GOTO 200
	  103:		END IF
	  104:		WRITE(DECNET_UNIT,100) ARCSCOMM_BUF(1:NBYTES)	! WRITE MSG TO CLIENT
	  105:		GOTO 999				! GO WAIT FOR NEXT REQUEST
	  106:	
	  107:	C ----- ERR/EOF RETURNS
	  108:	  910	WRITE(DECNET_UNIT,915)			! WRITE ERROR MSG TO CLIENT
	  109:	  915	FORMAT('***ERR***')
	  110:		GOTO 999
	  111:	  920	WRITE(DECNET_UNIT,925)			! WRITE EOF ON ROUTE_MST MSG

	  ARCScomm/Phoenix Detail Design                                              Page B19
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	  112:	  925	FORMAT('***END***')
	  113:		GOTO 999
	  114:	
	  115:	  999	END DO
	  116:	
	  117:	C ----------------------------------------------------------------------------
	  118:	C 	END OF JOB, CLOSE FILES AND EXIT.
	  119:	C ----------------------------------------------------------------------------
	  120:	 1000	CLOSE (UNIT=DECNET_UNIT)
	  121:		CLOSE (UNIT=ROUTE_UNIT)
	  122:		CALL EXIT
	  123:		END
	  124:	
	  125:	C *****************************************************************************
	  126:	C *
	  127:	C * SUBROUTINE:	ARCSCOMM_MSG
	  128:	C *
	  129:	C * PURPOSE:	PRODUCES A PHOENIX-FORMATTED MESSAGE FROM AN ARCS RECORD.
	  130:	C *
	  131:	C * CALL:	ARCSCOMM_MSG ( RTEBUF, FILLER, ARCSCOMM_BUF, NBYTES )
	  132:	C *
	  133:	C * ARGUMENTS:
	  134:	C *		RTEBUF (I)	CHAR*512 RECORD FROM ROUTE_MST DATABASE.
	  135:	C *		FILLER (I)	CHAR*1 BYTE TO PACK IN UNDEFINED FIELDS.
	  136:	C *		ARCSCOMM_BUF(O)	CHAR*512 MESSAGE TO BE SHIPPED BACK TO CLIENT.
	  137:	C *		NBYTES (O)	INT NUMBER OF BYTES RETURNED IN ARCSCOMM_BUF,
	  138:	C *				OR -1 IF RTEBUF IS A DUMMY RECORD.
	  139:	C *
	  140:	C * ---------------------------------------------------------------------------
	  141:	C * REVISION HISTORY:
	  142:	C *
	  143:	C * 12/19/85  J.FORKOSH		INSTALLATION
	  144:	C *
	  145:	C *****************************************************************************
	  146:	
	  147:	C ----------------------------------------------------------------------------
	  148:		SUBROUTINE ARCSCOMM_MSG ( RTEBUF, FILLER, ARCSCOMM_BUF, NBYTES )
	  149:	C ----------------------------------------------------------------------------
	  150:	C ----- ARGUMENTS
	  151:		CHARACTER RTEBUF*512
	  152:		CHARACTER FILLER*1
	  153:		CHARACTER ARCSCOMM_BUF*512
	  154:		INTEGER NBYTES
	  155:	
	  156:	C ----- GLOBAL VARIABLES
	  157:		INTEGER*2 N_PHX_FIELDS,			! # FIELDS IN ARCSCOMM_BUF
	  158:	     +		PHX_LAYOUT(2,32)		! POS IN RTEBUF, LENGTH, ...
	  159:		COMMON/PHX_FORM/ N_PHX_FIELDS, PHX_LAYOUT
	  160:	
	  161:	C ----- LOCAL VARIABLES
	  162:		INTEGER IFIELD,				! LOOP OVER N_PHX_FIELDS
	  163:	     +		IBYTE,				! DUMMY TO LOOP OVER FILLER
	  164:	     +		RTE_BYTE1,			! 1ST BYTE=PHX_LAYOUT(1,IFIELD)
	  165:	     +		RTE_BYTE2,			! LAST BYTE IN RTEBUF
	  166:	     +		PHX_BYTE1,			! 1ST BYTE=CURRENT NBYTES + 1
	  167:	     +		PHX_BYTE2			! LAST BYTE IN ARCSCOMM_BUF

	  ARCScomm/Phoenix Detail Design                                              Page B20
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	  168:		INTEGER CITY_UNIT			! KLUDGE TO READ CITY_TBL
	  169:		CHARACTER CITY_REC*32			! BUFFER FOR CITY_TBL RECORD
	  170:		CHARACTER CITY_CODE*3			! CITY CODE FROM RTEBUF
	  171:		LOGICAL DUMMY_REC			! TOGGLE FOR DUMMY RECORDS
	  172:	
	  173:	C ----------------------------------------------------------------------------
	  174:	C 	INITIALIZATION.
	  175:	C ----------------------------------------------------------------------------
	  176:		DUMMY_REC = .FALSE.			! WILL BE TOGGLED IF NECESSARY.
	  177:		NBYTES = 0				! NOTHING VENTURED YET.
	  178:		CITY_UNIT = 3				! THAT'S WHERE MAIN OPENED IT.
	  179:	
	  180:	C ----------------------------------------------------------------------------
	  181:	C 	CHECK FOR DUMMY RECORDS.
	  182:	C ----------------------------------------------------------------------------
	  183:		DO 99 I=1,2				! SEVERAL FIELDS INDICATE DUMMY
	  184:	   99	IF ( 1 .GT. 2 ) DUMMY_REC = .TRUE.	! DON'T KNOW WHAT TO CHECK YET
	  185:		IF ( DUMMY_REC ) THEN
	  186:			NBYTES = -1			! TELL CALLER HE GAVE US DUMMY
	  187:			RETURN				! AND GO HOME.
	  188:		END IF
	  189:	
	  190:	C ----------------------------------------------------------------------------
	  191:	C 	LOOP OVER ALL FIELDS DEFINED IN PHX_LAYOUT, CONCATANATING THEM TO BUF.
	  192:	C ----------------------------------------------------------------------------
	  193:		DO 999 IFIELD = 1, N_PHX_FIELDS
	  194:		PHX_BYTE1 = NBYTES + 1			! START THIS FIELD 1 BYTE OVER
	  195:		PHX_BYTE2 = NBYTES + PHX_LAYOUT(2,IFIELD)
	  196:		RTE_BYTE1 = PHX_LAYOUT(1,IFIELD)
	  197:		IF ( RTE_BYTE1 .GT. 0 ) THEN		! COPY RTEBUF IF FIELD DEFINED
	  198:			RTE_BYTE2 = RTE_BYTE1 + PHX_LAYOUT(2,IFIELD) - 1	
	  199:			ARCSCOMM_BUF(PHX_BYTE1:PHX_BYTE2) = RTEBUF(RTE_BYTE1:RTE_BYTE2)
	  200:		ELSE					! CHECK FOR VARIOUS KLUDGES ...
	  201:	C -----	KLUDGES ... FIRST DEFAULT FIELD TO FILLER
	  202:			DO 910 IBYTE = PHX_BYTE1, PHX_BYTE2
	  203:	  910		ARCSCOMM_BUF(IBYTE:IBYTE) = FILLER
	  204:	C -----	CHECK IF IT'S THE CITY_NAME FIELD
	  205:			IF ( - RTE_BYTE1 .EQ. CITY_UNIT ) THEN
	  206:				CITY_CODE = RTEBUF(7:9)
	  207:				CALL READ_CITY_TBL(CITY_UNIT,1,CITY_CODE,CITY_REC,IOS)
	  208:				IF(IOS.EQ.0) ARCSCOMM_BUF(PHX_BYTE1:PHX_BYTE2)=CITY_REC
	  209:			END IF
	  210:	C -----	CHECK IF IT'S THE OPR FIELD
	  211:			IF ( - RTE_BYTE1 .EQ. 99 ) THEN
	  212:				ARCSCOMM_BUF(PHX_BYTE1:PHX_BYTE2) = '999999999'
	  213:			END IF
	  214:		END IF
	  215:		NBYTES = NBYTES + PHX_LAYOUT(2,IFIELD)	! BUMP BUFFER LENGTH
	  216:	  999	CONTINUE
	  217:	
	  218:	C ----------------------------------------------------------------------------
	  219:	C 	RETURN COMPLETED ARCSCOMM_BUF TO CALLER.
	  220:	C ----------------------------------------------------------------------------
	  221:		RETURN
	  222:		END
	  223:	

	  ARCScomm/Phoenix Detail Design                                              Page B21
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	  224:	C *****************************************************************************
	  225:	C *
	  226:	C * SUBROUTINE:	READ_CITY_TBL
	  227:	C *
	  228:	C * PURPOSE:	READS A RECORD FROM CITY_TBL.
	  229:	C *
	  230:	C * CALL:	READ_CITY_TBL
	  231:	C *		( CITY_UNIT, KEY_ID, KEY_VALUE, CITY_REC, FOR_IOS )
	  232:	C *
	  233:	C * ARGUMENTS:
	  234:	C *		CITY_UNIT (I)	INT UNIT ON WHICH CITY_TBL IS OPENED.
	  235:	C *		KEY_ID (I)	INT FORTRAN KEYID FOR KEYED ACCESS --
	  236:	C *				0=CITY NAME, 1=CITY CODE, 2=COUNTRY CODE,
	  237:	C *				OR KEYID < 0 FOR SEQUIENTIAL READ.
	  238:	C *		KEY_VALUE (I)	CHAR*(*) KEY TO BE RETRIEVED (DUMMY IF
	  239:	C *				KEYID<0).
	  240:	C *		CITY_REC (O)	CHAR*(CTYBUF_L) RETURNED RECORD.
	  241:	C *		FOR_IOS (O)	INT 0=SUCCESSFUL, 1=ERR, 2=END.
	  242:	C *
	  243:	C * ---------------------------------------------------------------------------
	  244:	C * REVISION HISTORY:
	  245:	C *
	  246:	C * 12/31/85  J.FORKOSH		INSTALLATION (MODIFIED FROM SIMILAR ROUTINE
	  247:	C *				IN PROGRAM MNCITY.FOR)
	  248:	C *
	  249:	C *****************************************************************************
	  250:	
	  251:	C ----------------------------------------------------------------------------
	  252:		SUBROUTINE READ_CITY_TBL
	  253:	     +	( CITY_UNIT, KEY_ID, KEY_VALUE, CITY_REC, FOR_IOS )
	  254:	C ----------------------------------------------------------------------------
	  255:	C -----	GLOBAL VARIABLES
	  256:		INCLUDE 'CITY.INC'			! CITY_TBL RECORD LAYOUT
	  257:	
	  258:	C -----	ARGUMENTS
	  259:		INTEGER CITY_UNIT, KEY_ID, FOR_IOS
	  260:		CHARACTER KEY_VALUE*(*), CITY_REC*(CTYBUF_L)
	  261:	
	  262:	C ----------------------------------------------------------------------------
	  263:	C	ISSUE READ -- KEYED IF KEY_ID .GE. 0, ELSE SEQUENTIAL.
	  264:	C ----------------------------------------------------------------------------
	  265:		IF ( KEY_ID .GE. 0 ) THEN
	  266:			READ (CITY_UNIT, KEYID=KEY_ID, KEY=KEY_VALUE,
	  267:	     +		IOSTAT=IOS, ERR=100) CTYBUF
	  268:		ELSE
	  269:			READ (CITY_UNIT, IOSTAT=IOS, END=200, ERR=100) CTYBUF
	  270:		END IF
	  271:		CITY_REC = CTYBUF
	  272:		FOR_IOS = 0
	  273:		RETURN
	  274:	
	  275:	C ----------------------------------------------------------------------------
	  276:	C	END/ERR RETURNS
	  277:	C ----------------------------------------------------------------------------
	  278:	  100	FOR_IOS = 1
	  279:		RETURN

	  ARCScomm/Phoenix Detail Design                                              Page B22
	  Appendix B: Source Code - 8) ARCSSRVR.FOR


	  280:	  200	FOR_IOS = 2
	  281:		RETURN
	  282:		END

	  ARCScomm/Phoenix Detail Design                                              Page B23
	  Appendix B: Source Code - 9) ARCSUPDT.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Program:	ARCSupdt
	    4:	 *
	    5:	 * Purpose:	Main routine for ARCScomm/Phoenix Automated ARCS-to-Phoenix
	    6:	 *		Update Facility.  Drives the reconciliation/update process by:
	    7:	 *		1. retrieving all recently-updated ARCS records,
	    8:	 *		2. reconciling them with corresponding customer records,
	    9:	 *		3. requesting user validation (if required),
	   10:	 *		4. writing and logging updated customer records.
	   11:	 *
	   12:	 * Call:	$ arcsupdt "date-of-last-update" "flow-control"
	   13:	 *		(Note: $arcsupdt :== $device:[]arcsupdt.exe must be installed
	   14:	 *		as a foreign command to allow passing command-line arguments.)
	   15:	 *
	   16:	 * Arguments:
	   17:	 *		date-of-last-update (I)	Six chars in the form YYMMDD indicating
	   18:	 *					the last Phoenix update.
	   19:	 *		flow-control (I)	YY/NN,etc for validation/navigation.
	   20:	 *
	   21:	 * Returns:
	   22:	 *		- none
	   23:	 *
	   24:	 * Note:	$define task "vodka""arcscomm phopenix""::""task=arcssrvr"""
	   25:	 *		before running arcsupdt.  You may replace vodka with star1
	   26:	 *		if a local copy of the ARCS database route_mst has been copied
	   27:	 *		from magtape.  But in this case the logical route_mst must
	   28:	 *		also be defined (pointing to the ARCS database).
	   29:	 *
	   30:	 * Source:	ARCSUPDT.C
	   31:	 *
	   32:	 * --------------------------------------------------------------------------
	   33:	 * Revision History:
	   34:	 *
	   35:	 * 12/30/85	J.Forkosh	Installation.
	   36:	 *
	   37:	 ****************************************************************************/
	   38:	
	   39:	#include stdio
	   40:	#include rms
	   41:	#include "arcscomm.h"
	   42:	#include "pdata.h"
	   43:	#include "phnxstat.h"
	   44:	#define MSGLEVEL 99
	   45:	#define MAX_ERRS 3
	   46:	#define RPTFILE  "ARCSUPDT.RPT"
	   47:	#define DUPFILE  "ARCSUPDT.DUP"
	   48:	
	   49:	/* ---------------------------------------------------------------------------
	   50:	   Global Variables
	   51:	--------------------------------------------------------------------------- */
	   52:	globaldef int	msglevel = MSGLEVEL;		/* message level for debug */
	   53:	globaldef char	dummy_rec[512];			/* phnxclnt test msgs kludge */
	   54:	
	   55:	main( argc, argv )

	  ARCScomm/Phoenix Detail Design                                              Page B24
	  Appendix B: Source Code - 9) ARCSUPDT.C


	   56:	int	argc;
	   57:	char	*argv[];
	   58:	{
	   59:	
	   60:	/* ---------------------------------------------------------------------------
	   61:	   Allocations and Declarations
	   62:	--------------------------------------------------------------------------- */
	   63:	char	dup[64];				/* last update = *argv[1] */
	   64:	char	dup_key[64];				/* dup from retrieved record */
	   65:	char	gcn_key[64];				/* gcn from retrieved record */
	   66:	char	flow_control[64];			/* YY/NN,etc = *argv[2] */
	   67:	int	validate, navigate;			/* user flow control flags */
	   68:	static	char rptfile[64] = RPTFILE;		/* RMS file for audit report */
	   69:	static	char dupfile[64] = DUPFILE;		/* RMS file for dup date */
	   70:	FILE	*rptptr,*dupptr,*fopen();		/* ptrs to rpt and dup files */
	   71:	char	request[64];				/* buffer for ARCS request */
	   72:	char	command[64];				/* validation command return */
	   73:	union	{
	   74:		char	clnt_reply[512];		/* char buffer for reply */
	   75:		struct	arcscomm_buf phx_reply;		/* struct buffer for reply */
	   76:		} reply;
	   77:	struct	process_data pdata;			/* DBSA process data struct */
	   78:	char	dbsa_data[256];				/* DBSA input, generic */
	   79:	int	reply_len;				/* #chars returned in reply */
	   80:	int	err_count;				/* accumulated error count */
	   81:	int	nupdates;				/* number of updates done */
	   82:	int	prfflds[32];				/* fields requiring update */
	   83:	int	nprf;					/* #fields requiring update */
	   84:	int	rms_stat,arcs_stat,phnx_stat;		/* various return statuses */
	   85:	
	   86:	/* ---------------------------------------------------------------------------
	   87:	   Get command-line arguments
	   88:	--------------------------------------------------------------------------- */
	   89:	/* --- Date of Last Update is 1st command line arg --- */
	   90:	if ( argc > 1 )
	   91:		{
	   92:		strcpy ( dup, argv[1] );		/* local copy of *argv[1] */
	   93:		/* we may want to validate YYMMDD format of dup */
	   94:		}
	   95:	else
	   96:		{					/* exit if dup not supplied */
	   97:		if ( msglevel > 0 )
	   98:			printf("\nARCSupdt> Date of Last Update must be specified.");
	   99:		exit (-1);
	  100:		}
	  101:	
	  102:	/* --- Flow Control flags are 2nd command line arg --- */
	  103:	validate = navigate = FALSE;			/* default no flow control */
	  104:	msglevel = 1;					/* be quiet unless 2nd arg */
	  105:	if ( argc > 2 )
	  106:		{
	  107:		msglevel = MSGLEVEL;			/* use defined default */
	  108:		strcpy ( flow_control, argv[2] );	/* copy 2nd arg if present */
	  109:		if( flow_control[0] == 'Y' )
	  110:			validate = TRUE;		/* user wants to validate */
	  111:		if( flow_control[1] == 'Y' )		/* user wants to navigate */

	  ARCScomm/Phoenix Detail Design                                              Page B25
	  Appendix B: Source Code - 9) ARCSUPDT.C


	  112:			{
	  113:			validate = navigate = TRUE;	/* shoot the works */
	  114:			if(msglevel<99) msglevel = 99;	/* tell all to user */
	  115:			}
	  116:		}
	  117:	
	  118:	/* ---------------------------------------------------------------------------
	  119:	   Initialization
	  120:	--------------------------------------------------------------------------- */
	  121:	/* --- open the report and date-of-last-update files --- */
	  122:	if( (rptptr=fopen(rptfile,"w")) == NULL )	/* open rptfile for writing */
	  123:		{					/* couldn't do it ... */
	  124:		if ( msglevel > 0 )			/* so print err msg, */
	  125:			printf("\nARCSupdt> Can't open() report file.");
	  126:		exit (-1);
	  127:		}
	  128:	if ( navigate )
	  129:		dupptr = NULL;				/* can't dup if navigating */
	  130:	else
	  131:		{
	  132:		if( (dupptr=fopen(dupfile,"w")) == NULL )/* open dupfile for writing */
	  133:			{				/* couldn't do it ... */
	  134:			if ( msglevel > 0 )		/* so print err msg, */
	  135:				printf("\nARCSupdt> Can't open() dup file.");
	  136:			exit (-1);
	  137:			}
	  138:		}
	  139:	
	  140:	/* --- open the DECnet task --- */
	  141:	if( (arcs_stat = arcsclnt("OPEN",&reply.clnt_reply,&reply_len))
	  142:	!= RMS$_NORMAL )				/* try to "open" DECnet */
	  143:		{					/* couldn't do it ... */
	  144:		if ( msglevel > 0 )			/* so print err msg, */
	  145:			printf("\nARCSupdt> Can't open() TASK file.");
	  146:		exit (-1);
	  147:		}
	  148:	
	  149:	/* --- INIT the Phoenix DBSA --- */
	  150:	if ( (phnx_stat = phnxclnt("INIT","ARCScomm",&pdata))
	  151:	!= PHNX$_SUCCESS )				/* try to init DBSA process */
	  152:		{					/* couldn't do it ... */
	  153:		if ( msglevel > 0 )			/* so print err msg, */
	  154:			printf("\nARCSupdt> Can't INIT Phoenix DBSA.");
	  155:		arcsclnt("CLOSE",&reply.clnt_reply,&reply_len);	/* close DECnet link */
	  156:		exit (-1);				/* and quit */
	  157:		}
	  158:	
	  159:	/* --- get ready for first reconciliation --- */
	  160:	strcpy ( request, dup );			/* 1st request is keyed dup */
	  161:	err_count = 0;					/* so far, so good */
	  162:	nupdates = 0;					/* nothing done yet */
	  163:	
	  164:	/* ---------------------------------------------------------------------------
	  165:	   Loop forever, i.e., until EOF from ARCSsrvr partner means no more updates.
	  166:	--------------------------------------------------------------------------- */
	  167:	while (TRUE)

	  ARCScomm/Phoenix Detail Design                                              Page B26
	  Appendix B: Source Code - 9) ARCSUPDT.C


	  168:		{
	  169:	/* --- debugging mode if msglevel > 9 (same test throughout program) --- */
	  170:		if ( msglevel > 9 )			/* debugging audit trail */
	  171:			printf("\n\nARCSupdt> request= %.32s", request);
	  172:	
	  173:	/* ---------------------------------------------------------------------------
	  174:	   Issue request to get next updated ARCS record
	  175:	--------------------------------------------------------------------------- */
	  176:	/* --- Issue request until server returns RMS$_NORMAL --- */
	  177:		while ( (rms_stat = arcsclnt(request,&reply.clnt_reply,&reply_len))
	  178:		!= RMS$_NORMAL )			/* issue request until ok */
	  179:			{
	  180:			if ( msglevel > 1 )		/* print err message if not */
	  181:				printf("\nARCSupdt> ARCSclnt returned %s",
	  182:				vmsmsg(rms_stat));
	  183:			if ( ++err_count > MAX_ERRS )	/* abort if too many errs */
	  184:				goto end_of_job;
	  185:			}
	  186:		if ( msglevel > 9 )			/* print reply when ok */
	  187:			printf("\nARCSupdt> reply= %.56s", reply.clnt_reply);
	  188:		strncpy(dummy_rec,reply.clnt_reply,reply_len);	/* for testing */
	  189:	
	  190:	/* --- check for ARCSsrvr ERR message --- */
	  191:		if ( !strncmp(reply.clnt_reply,"***ERR***",9) )
	  192:			{				/* got an ERR msg ... */
	  193:			if ( msglevel > 1 )		/* print it ??? */
	  194:				printf("\nARCSupdt> ARCSclnt ERR for request=%.32s",
	  195:				request);
	  196:			if ( ++err_count > MAX_ERRS )	/* ***ERR*** handler */
	  197:				goto end_of_job;	/* abort if too many errs, */
	  198:			else	goto next_request;	/* don't retry same request */
	  199:			}
	  200:	
	  201:	/* --- check for ARCSsrvr EOF message --- */
	  202:		if ( !strncmp(reply.clnt_reply,"***END***",9) )
	  203:			{				/* got an EOF msg ... */
	  204:			if ( navigate )			/* if user issued request */
	  205:				goto next_request;	/* let him issue another */
	  206:			else	break;			/* else fall through loop */
	  207:			}
	  208:	
	  209:	/* ---------------------------------------------------------------------------
	  210:	   Retrieve corresponding Phoenix customer-file record
	  211:	--------------------------------------------------------------------------- */
	  212:	/* --- Extract key from ARCSsrvr message --- */
	  213:	strncpy( dup_key, &reply.clnt_reply[DUPPOS], DUPLEN ); /* copy dup from msg */
	  214:	dup_key[DUPLEN] = '\0';				/* must be NULL terminated */
	  215:	strncpy( gcn_key, &reply.clnt_reply[GCNPOS], GCNLEN ); /* copy gcn from msg */
	  216:	gcn_key[GCNLEN] = '\0';				/* must be NULL terminated */
	  217:	
	  218:	/* --- Issue request to Phoenix DBSA to read cust with same GCN as ARCS --- */
	  219:		if ( (phnx_stat = phnxclnt("RDCUST",gcn_key,&pdata))
	  220:		!= PHNX$_SUCCESS )			/* try to read DBSA cust rec */
	  221:			{				/* couldn't do it ... */
	  222:			if ( phnx_stat == PHNX$_NOTFOUND )
	  223:				{			/* new customer */

	  ARCScomm/Phoenix Detail Design                                              Page B27
	  Appendix B: Source Code - 9) ARCSUPDT.C


	  224:				nprf = 0;		/* default it for validate */
	  225:				goto validate_update;	/* let user check it out */
	  226:				}
	  227:			if ( msglevel > 0 )		/* something else, print err */
	  228:				printf("\nARCSupdt> Can't READ_CUST=%.5s",
	  229:				reply.phx_reply.gcn);
	  230:			if ( phnx_stat != PHNX$_FATALERR )
	  231:				{			/* if it's not fatal ... */
	  232:				if ( ++err_count > MAX_ERRS )
	  233:					goto end_of_job;/* abort if too many errs */
	  234:				else
	  235:					goto next_request;/* else try again */
	  236:				}
	  237:			else
	  238:				goto end_of_job;	/* else it is fatal, so quit */
	  239:			}
	  240:	
	  241:	/* ---------------------------------------------------------------------------
	  242:	   Perform reconciliation, and check with user if update required 
	  243:	--------------------------------------------------------------------------- */
	  244:	/* --- arcsproof returns nprf,prfflds indicating fields not proofing --- */
	  245:	reconcile:
	  246:		if ( (nprf = arcsproof("COMP",&reply.clnt_reply,&pdata,&prfflds))
	  247:		== 0 )	goto next_request;		/* reconciled ok */
	  248:		if ( msglevel > 9 )
	  249:			printf("\nARCSupdt> #unreconciled fields=%d", nprf);
	  250:	
	  251:	/* --- check with user if validating updates --- */
	  252:	validate_update:
	  253:		if ( validate )
	  254:			{
	  255:			arcsvalid("VALID",&reply.clnt_reply,&pdata,
	  256:			nprf,&prfflds,&command);
	  257:			if ( !strcmp(command,"NG") )
	  258:				{			/* must stop logging dup */
	  259:				if ( dupptr!=NULL )	/* if we were logging */
	  260:					{
	  261:					fclose(dupptr);	/* close the dup file */
	  262:					dupptr = NULL;	/* trash the pointer */
	  263:					}
	  264:				goto next_request;
	  265:				}
	  266:			if ( !strcmp(command,"BY") ) goto end_of_job;
	  267:			if ( !strcmp(command,"GO") ) validate = FALSE;
	  268:			}
	  269:	
	  270:	/* ---------------------------------------------------------------------------
	  271:	   Write initial customer or update existing record, and log it to audit trail.
	  272:	--------------------------------------------------------------------------- */
	  273:	/* --- log to audit trail and report (log first, before changing pdata) --- */
	  274:		if ( rptptr!=NULL )
	  275:			arcsrpt(rptptr,&reply.clnt_reply,&pdata,nprf,&prfflds);
	  276:	
	  277:	/* --- write updated record --- */
	  278:		if ( phnx_stat == PHNX$_NOTFOUND )	/* either write initial cust */
	  279:			{				/* record */

	  ARCScomm/Phoenix Detail Design                                              Page B28
	  Appendix B: Source Code - 9) ARCSUPDT.C


	  280:			arcsproof("INIT",&reply.clnt_reply,&pdata,&prfflds);
	  281:			phnx_stat = phnxclnt("WRCUST",&reply.phx_reply.gcn,&pdata);
	  282:			}
	  283:		else					/* or update existing cust */
	  284:			{
	  285:			arcsproof("COPY",&reply.clnt_reply,&pdata,&prfflds);
	  286:			phnx_stat = phnxclnt("UPCUST",&reply.phx_reply.gcn,&pdata);
	  287:			}
	  288:		if (phnx_stat == PHNX$_SUCCESS )	/* check for success */
	  289:			nupdates++;			/* ok-increment update count */
	  290:		else					/* ng- ... */
	  291:			{
	  292:			if ( ++err_count > MAX_ERRS )
	  293:				goto end_of_job;	/* abort if too many errs */
	  294:			}
	  295:	
	  296:	/* ---------------------------------------------------------------------------
	  297:	   Check if user is manually navigating, request "NEXT" if not.
	  298:	--------------------------------------------------------------------------- */
	  299:	next_request:
	  300:		strcpy ( request, "NEXT" );		/* default if not navigating */
	  301:		if ( navigate )				/* but if navigating ... */
	  302:			{
	  303:			printf("\n\nARCSupdt> Enter Request -->");    /* prompt user */
	  304:			gets(request);			/* see what he wants */
	  305:			if ( !strcmp(request,"BYE") || !strcmp(request,"bye") )
	  306:				goto end_of_job;	/* bye means bye */
	  307:			if ( !strcmp(request,"DUMP") || !strcmp(request,"dump") )
	  308:				{
	  309:				arcsvalid("DUMP",&reply.clnt_reply,&pdata,
	  310:				nprf,&prfflds,&command);
	  311:				if ( !strcmp(command,"BY") ) goto end_of_job;
	  312:				if ( !strcmp(command,"GO") )
	  313:					{
	  314:					navigate = FALSE;
	  315:					msglevel = 1;
	  316:					}
	  317:				goto next_request;
	  318:				}
	  319:			if ( strlen(request) == 0 )
	  320:				strcpy(request,"NEXT");	/* null means next */
	  321:			err_count = 0;			/* more lenient navigating */
	  322:			}
	  323:		else
	  324:			{				/* only if not navigating - */
	  325:			if ( dupptr != NULL )		/* see if dupfile still open */
	  326:				fprintf(dupptr,"%s\n",dup_key);	/* write last dup */
	  327:			}
	  328:	
	  329:		}	/* --- End of main while loop --- */
	  330:	
	  331:	/* ---------------------------------------------------------------------------
	  332:	   End of job
	  333:	--------------------------------------------------------------------------- */
	  334:	end_of_job:
	  335:	phnxclnt("SHUTDN",&dbsa_data,&pdata);		/* shut down the DBSA */

	  ARCScomm/Phoenix Detail Design                                              Page B29
	  Appendix B: Source Code - 9) ARCSUPDT.C


	  336:	arcsclnt("CLOSE",&reply.clnt_reply,&reply_len);	/* "close" the DECnet link */
	  337:	if ( rptptr!=NULL )
	  338:		{
	  339:		arcsrpt(rptptr,NULL,NULL,-1,NULL);	/* -1 arg for final footer */
	  340:		fclose(rptptr);				/* close the report file */
	  341:		}
	  342:	if ( dupptr!=NULL )
	  343:		fclose(dupptr);				/* close the dup file */
	  344:	if ( msglevel > 9 )
	  345:		printf("\n\nHave a nice day.");		/* aloha */
	  346:	exit ( -1 );					/* return to VMS */
	  347:	}

	  ARCScomm/Phoenix Detail Design                                              Page B30
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	    1:	$  ON CONTROL_Y THEN GOTO ABORT		! set captive session at once.
	    2:	$! ****************************************************************************
	    3:	$! *
	    4:	$! * PROCEDURE:	arcsupdt.com
	    5:	$! *
	    6:	$! * PURPOSE:	Front-end DCL shell to drive ARCScomm/Phoenix functions.
	    7:	$! *		Establishes captive session with user and diaplays menus
	    8:	$! *		to determine desired function.
	    9:	$! *
	   10:	$! * CALL:      @ARCSUPDT type-of-user
	   11:	$! *
	   12:	$! * ARGUMENTS:
	   13:	$! *		type-of-user (I)	Must be either "DBSA" or "PHNX" or
	   14:	$! *					"ARCS".  DBSA users do updates and
	   15:	$! *					print reports.  ARCS/PHNX operators
	   16:	$! *					do tape backup/restore, respectively.
	   17:	$! *
	   18:	$! * SOURCE:	ARCSUPDT.COM
	   19:	$! *
	   20:	$! * --------------------------------------------------------------------------
	   21:	$! * Revision History:
	   22:	$! * 01/03/86 J.Forkosh		Installation.
	   23:	$! *
	   24:	$! ****************************************************************************
	   25:	$  goto INITIALIZATION
	   26:	$!
	   27:	$! ----------------------------------------------------------------------------
	   28:	$  ABORT:
	   29:	$! ----------------------------------------------------------------------------
	   30:	$! --- TRAP FOR < Ctrl-Y > AS WELL AS NORMAL EXIT ---
	   31:	$  write sys$output ff			! clear the screen,
	   32:	$  exit					! and return to caller.
	   33:	$!
	   34:	$! ----------------------------------------------------------------------------
	   35:	$  INITIALIZATION:
	   36:	$! ----------------------------------------------------------------------------
	   37:	$  user = P1				! type-of-user input argument
	   38:	$  tape_flag = "TEST"			! must be "TRUE" to do backup/restore
	   39:	$  pr_cmd := "print/que=txb0:"		! this is the way we print reports
	   40:	$  message = ""				! error/info msg, normally null
	   41:	$  tape_mounts = 0			! check if user wants more than 1
	   42:	$  arcs = "CCA$DEV:[ARCS.DEVELOP.DATA]"	! path to ARCS database on ARCS machine
	   43:	$  phnx = "CCA$DEV:[ARCS.DEVELOP.DATA]"	! path to ARCS database on Phoenix
	   44:	$  home = "CCA$DEV:''f$directory()'"	! path to ARCScomm programs on Phoenix
	   45:	$  blanks = "                                                                 "
	   46:	$  ff = ""		! form-feed for ANSI or hardcopy device
	   47:	$  if f$getdvi("sys$output","DEVTYPE") .lt. 64 then ff = " "
	   48:	$!
	   49:	$! ----------------------------------------------------------------------------
	   50:	$  MAIN_MENU:				! display main menu for type-of-user
	   51:	$! ----------------------------------------------------------------------------
	   52:	$! --- DISPLAY HEADER LINE COMMON TO ALL TYPES-OF-USERS ---
	   53:	$  write sys$output ff,"     TERMINAL: ''f$logical("sys$command")'",-
	   54:	   "''f$extract(0,34,blanks)'''f$extract(0,20,f$time())'"
	   55:	$!

	  ARCScomm/Phoenix Detail Design                                              Page B31
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	   56:	$! --- CHECK TYPE-OF-USER ARG IN P1 ---
	   57:	$  if user .eqs. "PHNX" then goto phnx_oper	! Phoenix oper-tape loads only
	   58:	$  if user .eqs. "ARCS" then goto arcs_oper	! ARCS oper-tape backups only
	   59:	$  if user .nes. "DBSA" then goto ABORT		! three strikes and you're out
	   60:	$!
	   61:	$! ----------------------------------------------------------------------------
	   62:	$  dbsa_user:				! got a DBSA user - update/report menu
	   63:	$! ----------------------------------------------------------------------------
	   64:	$! --- DISPLAY THE DBSA MAIN MENU ---
	   65:	$!       1         2         3         4         5         6         7
	   66:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	   67:	$  type sys$input			! DBSA-user main menu follows...
	   68:	                         ARCSCOMM/PHOENIX MAIN MENU
	   69:	     -----------------------------------------------------------------------
	   70:	
	   71:	     DATABASE UPDATES                      REPORTS
	   72:	     ----------------                      -------
	   73:	     UA - UPDATE USING DECNET TO READ      UR - PRINT UPDATE REPORT
	   74:	          ARCS DATABASE DIRECTLY
	   75:	     UP - UPDATE USING PHOENIX COPY OF
	   76:	          ARCS DATABASE
	   77:	
	   78:	     CONTROL
	   79:	     -------
	   80:	     LO - LOGOFF (RETURN TO PHOENIX SYSTEM CONTROL)
	   81:	
	   82:	
	   83:	
	   84:	
	   85:	
	   86:	
	   87:	$! end-of-file
	   88:	$  write sys$output message		! display any residual message	
	   89:	$  message = ""				! reset message
	   90:	$!
	   91:	$! --- SEE WHAT USER WANTS ---
	   92:	$  inquire/nopunc command "     COMMAND: "	! get a new command and
	   93:	$  if command .eqs. "LO" then goto ABORT	! branch accordingly...
	   94:	$  if command .eqs. "UA" then goto ARCS_UPDT	! "
	   95:	$  if command .eqs. "UP" then goto PHNX_UPDT	! "
	   96:	$  if command .eqs. "UR" then goto UPDT_RPT	! "
	   97:	$  message = "     PLEASE ENTER A TWO-CHARACTER COMMAND FROM THE LIST ABOVE..."
	   98:	$  goto MAIN_MENU			! oops-user entered garbage
	   99:	$!
	  100:	$! ----------------------------------------------------------------------------
	  101:	$  phnx_oper:				! got a phoenix oper-tape loads only
	  102:	$! ----------------------------------------------------------------------------
	  103:	$! --- DISPLY THE PHOENIX OPER MAIN MENU ---
	  104:	$!       1         2         3         4         5         6         7
	  105:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	  106:	$  type sys$input			! phoenix-oper main menu follows ...
	  107:	                         ARCSCOMM/PHOENIX MAIN MENU
	  108:	     -----------------------------------------------------------------------
	  109:	
	  110:	     LOAD TAPE
	  111:	     ---------

	  ARCScomm/Phoenix Detail Design                                              Page B32
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	  112:	     LT - LOAD TAPE CONTAINING ARCS DATABASE
	  113:	
	  114:	     CONTROL
	  115:	     -------
	  116:	     LO - LOGOFF (RETURN TO PHOENIX SYSTEM CONTROL)
	  117:	
	  118:	
	  119:	
	  120:	
	  121:	
	  122:	
	  123:	
	  124:	
	  125:	$! end-of-file
	  126:	$  write sys$output message		! display any residual message
	  127:	$  message = ""				! reset message
	  128:	$!
	  129:	$! --- SEE WHAT THE OPER WANTS ---
	  130:	$  inquire/nopunc command "     COMMAND: "	! see what phoenix-oper wants
	  131:	$  if command .eqs. "LO" then goto ABORT	! and branch accordingly...
	  132:	$  if command .eqs. "LT" then goto LOAD_TAPE
	  133:	$  message = "     PLEASE ENTER A TWO-CHARACTER COMMAND FROM THE LIST ABOVE..."
	  134:	$  goto MAIN_MENU			! oops-phoenix oper gave us garbage
	  135:	$!
	  136:	$! ----------------------------------------------------------------------------
	  137:	$  arcs_oper:				! got an ARCS oper-tape backups only
	  138:	$! ----------------------------------------------------------------------------
	  139:	$! --- DISPLY ARCS OPER MAIN MENU ---
	  140:	$!       1         2         3         4         5         6         7
	  141:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	  142:	$  type sys$input			! ARCS-oper main menu follows...
	  143:	                         ARCSCOMM/PHOENIX MAIN MENU
	  144:	     -----------------------------------------------------------------------
	  145:	
	  146:	     BACKUP TAPE
	  147:	     -----------
	  148:	     BT - CREATE A BACKUP TAPE CONTAINING ARCS DATABASE
	  149:	
	  150:	     CONTROL
	  151:	     -------
	  152:	     LO - LOGOFF (RETURN TO PHOENIX SYSTEM CONTROL)
	  153:	
	  154:	
	  155:	
	  156:	
	  157:	
	  158:	
	  159:	
	  160:	
	  161:	$! end-of-file
	  162:	$  write sys$output message		! display any residual message
	  163:	$  message = ""				! reset message
	  164:	$!
	  165:	$! --- SEE WHAT THE OPER WANTS ---
	  166:	$  inquire/nopunc command "     COMMAND: "	! see what ARCS-oper wants
	  167:	$  if command .eqs. "LO" then goto ABORT	! and branch accordingly...

	  ARCScomm/Phoenix Detail Design                                              Page B33
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	  168:	$  if command .eqs. "BT" then goto BACKUP_TAPE
	  169:	$  message = "     PLEASE ENTER A TWO-CHARACTER COMMAND FROM THE LIST ABOVE..."
	  170:	$  goto MAIN_MENU			! oops-ARCS oper gave us garbage
	  171:	$! EJECT 
	  172:	$!
	  173:	$! ----------------------------------------------------------------------------
	  174:	$! ASSIGN APPROPRIATE LOGICALS BEFORE PERFORMING UPDATE
	  175:	$! ----------------------------------------------------------------------------
	  176:	$  ARCS_UPDT:
	  177:	$  if f$logical("route_mst") .nes. "" then deassign route_mst
	  178:	$  if f$logical("city_tbl") .nes. "" then deassign city_tbl
	  179:	$  if f$logical("task") .nes. "" then deassign task
	  180:	$  assign/process 'arcs'route.mst route_mst
	  181:	$  assign/process 'arcs'city.tbl city_tbl
	  182:	$  define task "vodka""arcssrvr arcssrvr""::""task=arcssrvr"""
	  183:	$  goto PERFORM_UPDT
	  184:	$!
	  185:	$  PHNX_UPDT:
	  186:	$  if f$logical("route_mst") .nes. "" then deassign route_mst
	  187:	$  if f$logical("city_tbl") .nes. "" then deassign city_tbl
	  188:	$  if f$logical("task") .nes. "" then deassign task
	  189:	$  assign/process 'phnx'route.mst route_mst
	  190:	$  assign/process 'phnx'city.tbl city_tbl
	  191:	$  define task "vodka""arcssrvr arcssrvr""::""task=arcssrvr"""
	  192:	$  goto PERFORM_UPDT
	  193:	$!
	  194:	$! ----------------------------------------------------------------------------
	  195:	$  PERFORM_UPDT:			! got logicals so let's get started...
	  196:	$! ----------------------------------------------------------------------------
	  197:	$! --- FIRST ERASE THE MAIN MENU AND DISPLAY A HEADER ---
	  198:	$  write sys$output ff,"     TERMINAL: ''f$logical("sys$command")'",-
	  199:	   "''f$extract(0,34,blanks)'''f$extract(0,20,f$time())'"
	  200:	$!       1         2         3         4         5         6         7
	  201:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	  202:	$  type sys$input
	  203:	                          ARCSCOMM/PHOENIX UPDATE
	  204:	     -----------------------------------------------------------------------
	  205:	
	  206:	$! end-of-file
	  207:	$!
	  208:	$! --- CHECK THAT ARCSUPDT.DUP FILE EXISTS BEFORE PROCEEDING ---
	  209:	$  if f$search("''home'arcsupdt.dup") .nes. "" then -	! check for dup file
	  210:	   goto found_dup			! ok-found file with dup record
	  211:	$  type sys$input			! uh oh-no dup file/fatal error.
	  212:	     ***********************************************************************
	  213:	     *DATE-OF-LAST-UPDATE NOT AVAILABLE.  CANNOT PERFORM UPDATE.  GET HELP.*
	  214:	     ***********************************************************************
	  215:	
	  216:	$! end-of-file
	  217:	$  inquire/nopunc reply "     PRESS < RETURN > FOR MAIN MENU: "
	  218:	$  goto MAIN_MENU			! force user back to main menu
	  219:	$!
	  220:	$! --- READ LAST DUP DATE FROM LAST LINE OF ARCSUPDT.DUP ---
	  221:	$  found_dup:				! ok-we've got a dup file...
	  222:	$  open/read dup_file 'home'arcsupdt.dup! open the dup file for read access
	  223:	$  dup_loop:				! read loop

	  ARCScomm/Phoenix Detail Design                                              Page B34
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	  224:	$  read/end=last_dup dup_file dup	! read dup record till eof
	  225:	$  goto dup_loop			! still reading??? try again for eof.
	  226:	$  last_dup:				! got an eof-last rec is most recent
	  227:	$  close dup_file			! close the dup file, and...
	  228:	$  write sys$output "     Date of Last Update: ''dup'"	! display dup for user
	  229:	$  if f$logical("arcs_dup") .nes. "" then deassign arcs_dup	! old logical
	  230:	$  assign/process 'dup' arcs_dup	! create logical for ARCSupdt program
	  231:	$!
	  232:	$! --- RUN THE UPDATE PROGRAM ---
	  233:	$  set noon				! don't let program shoot us down
	  234:	$  arcsupdt := "$''home'arcsupdt.exe"	! create foreign command to execute it
	  235:	$  arcsupdt "''dup'" "X"		! and give it dup on command line
	  236:	$  set on				! back home so restore "on"
	  237:	$!
	  238:	$! --- PURGE ANY EXTRA ARCSUPDT.DUP FILES CREATED ---
	  239:	$  if f$search("''home'arcsupdt.dup;-1") .nes. "" then -	! another file?
	  240:	   purge 'home'arcsupdt.dup		! purge any extra dup files created.
	  241:	$  goto MAIN_MENU			! all done.
	  242:	$!
	  243:	$! ----------------------------------------------------------------------------
	  244:	$  UPDT_RPT:
	  245:	$! ----------------------------------------------------------------------------
	  246:	$! --- PRINT UPDATE REPORT - NOT MUCH TO DO HERE, JUST PRINT IT AND GO BACK ---
	  247:	$  pr_cmd 'home'arcsupdt.rpt;0		! print most recent report
	  248:	$  if f$search("''home'arcsupdt.rpt;-1") .nes. "" then -
	  249:	   purge 'home'arcsupdt.rpt		! purge any old reports
	  250:	$  goto MAIN_MENU			! that's all.
	  251:	$! EJECT 
	  252:	$!
	  253:	$! ----------------------------------------------------------------------------
	  254:	$  LOAD_TAPE:				! restore a copy of ARCS data on Phnx
	  255:	$! ----------------------------------------------------------------------------
	  256:	$! --- FIRST CHECK INTERNAL FLAG TO MAKE SURE WE CAN HANDLE TAPE ---
	  257:	$  message = "     SORRY, TAPE LOADS CANNOT BE PERFORMED AT THIS TIME."
	  258:	$  if tape_flag .eqs. "FALSE" then goto MAIN_MENU	! force oper to menu
	  259:	$  message = ""				! false alarm, reset message
	  260:	$  if tape_mounts .gt. 0 then -
	  261:	$  message = "     *** NOTE *** YOU HAVE ALREADY LOADED A TAPE"
	  262:	$!
	  263:	$! --- ERASE MAIN MENU AND DISPLAY TAPE LOAD HEADER ---
	  264:	$  load_msg:
	  265:	$  write sys$output ff,"     TERMINAL: ''f$logical("sys$command")'",-
	  266:	   "''f$extract(0,34,blanks)'''f$extract(0,20,f$time())'"
	  267:	$!       1         2         3         4         5         6         7
	  268:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	  269:	$  type sys$input
	  270:	                         ARCSCOMM/PHOENIX LOAD TAPE
	  271:	     -----------------------------------------------------------------------
	  272:	
	  273:	     ***********************************************************************
	  274:	     *TO PROCEED YOU MUST HAVE A MAGNETIC TAPE CONTAINING THE ARCS DATABASE*
	  275:	     ***********************************************************************
	  276:	
	  277:	$! end-of-file
	  278:	$  write sys$output message		! display any residual message
	  279:	$  message = ""				! reset message

	  ARCScomm/Phoenix Detail Design                                              Page B35
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	  280:	$!
	  281:	$! --- DOUBLE-CHECK THAT OPER WANTS TAPE LOAD AND PROMPT HIM TO MOUNT TAPE ---
	  282:	$  inquire/nopunc reply "     DO YOU WANT TO PROCEED (ENTER Y OR N): "
	  283:	$  if reply .eqs. "N" then goto MAIN_MENU	! oper decided against it
	  284:	$  message = "     PLEASE ENTER Y FOR YES OR N FOR NO..."
	  285:	$  if reply .nes. "Y" then goto load_msg	! oper didn't decide
	  286:	$  message = ""
	  287:	$  inquire/nopunc reply "     MOUNT THE TAPE AND PRESS < RETURN > WHEN READY: "
	  288:	$!
	  289:	$! --- ALL SET - MOUNT THE TAPE AND RUN THE BACKUP PROGRAM ---
	  290:	$  if tape_flag .eqs. "TRUE" then -	! final check on internal tape flag
	  291:	   mount/foreign msa0:			! ask VMS for tape mount
	  292:	$  tape_mounts = tape_mounts + 1
	  293:	$  set default 'phnx'			! go to database directory
	  294:	$  write sys$output "Now in ''f$directory()'"
	  295:	$  if tape_flag .eqs. "TRUE" then -	! check internal flag and
	  296:	   backup msa0:arcs.sav/rewind 'phnx'	! do the backup
	  297:	$  set default 'home'			! come back to ARCScomm directory
	  298:	$  write sys$output "Now in ''f$directory()'"
	  299:	$!
	  300:	$! --- ALL DONE - FREEZE THE SCREEN FOR A MOMENT AND GO HOME ---
	  301:	$  inquire/nopunc reply "     TAPE LOAD DONE.  PRESS < RETURN > TO CONTINUE: "
	  302:	$  goto MAIN_MENU			! back to main menu for next selection
	  303:	$! EJECT 
	  304:	$!
	  305:	$! ----------------------------------------------------------------------------
	  306:	$  BACKUP_TAPE:				! restore ARCS database tape on Phoenix
	  307:	$! ----------------------------------------------------------------------------
	  308:	$! --- FIRST CHECK INTERNAL FLAG TO MAKE SURE WE CAN HANDLE TAPE ---
	  309:	$  message = "     SORRY, TAPE BACKUPS CANNOT BE PERFORMED AT THIS TIME."
	  310:	$  if tape_flag .eqs. "FALSE" then goto MAIN_MENU	! force oper to menu
	  311:	$  message = ""				! false alarm, reset message
	  312:	$  if tape_mounts .gt. 0 then -
	  313:	$  message = "     *** NOTE *** YOU HAVE ALREADY BACKED UP A TAPE"
	  314:	$!
	  315:	$! --- ERASE MAIN MENU AND DISPLAY TAPE BACKUP HEADER ---
	  316:	$  backup_msg:
	  317:	$  write sys$output ff,"     TERMINAL: ''f$logical("sys$command")'",-
	  318:	   "''f$extract(0,34,blanks)'''f$extract(0,20,f$time())'"
	  319:	$!       1         2         3         4         5         6         7
	  320:	$! 4567890123456789012345678901234567890123456789012345678901234567890123456789
	  321:	$  type sys$input
	  322:	                        ARCSCOMM/PHOENIX BACKUP TAPE
	  323:	     -----------------------------------------------------------------------
	  324:	
	  325:	     **********************************************************************
	  326:	     *TO PROCEED YOU MUST HAVE A MAGNETIC TAPE TO BACKUP THE ARCS DATABASE*
	  327:	     **********************************************************************
	  328:	
	  329:	$! end-of-file
	  330:	$  write sys$output message		! display any residual message
	  331:	$  message = ""				! reset message
	  332:	$!
	  333:	$! --- DOUBLE-CHECK THAT OPER WANTS BACKUP AND PROMPT HIM TO MOUNT TAPE ---
	  334:	$  inquire/nopunc reply "     DO YOU WANT TO PROCEED (ENTER Y OR N): "
	  335:	$  if reply .eqs. "N" then goto MAIN_MENU	! oper decided against it

	  ARCScomm/Phoenix Detail Design                                              Page B36
	  Appendix B: Source Code - 10) ARCSUPDT.COM


	  336:	$  message = "     PLEASE ENTER Y FOR YES OR N FOR NO..."
	  337:	$  if reply .nes. "Y" then goto backup_msg	! oper didn't decide
	  338:	$  message = ""
	  339:	$  inquire/nopunc reply "     MOUNT THE TAPE AND PRESS < RETURN > WHEN READY: "
	  340:	$!
	  341:	$! --- ALL SET - MOUNT THE TAPE AND RUN THE BACKUP PROGRAM ---
	  342:	$  if tape_flag .eqs. "TRUE" then -	! final check on internal tape flag
	  343:	   mount/foreign msa0:			! ask VMS for tape mount
	  344:	$  tape_mounts = tape_mounts + 1
	  345:	$  set default 'arcs'			! go to database directory
	  346:	$  write sys$output "Now in ''f$directory()'"
	  347:	$  if tape_flag .eqs. "TRUE" then -
	  348:	   backup 'phnx' msa0:arcs.sav/rewind/init
	  349:	$  set default 'home'			! come back to ARCScomm directory
	  350:	$  write sys$output "Now in ''f$directory()'"
	  351:	$!
	  352:	$! --- ALL DONE - FREEZE THE SCREEN FOR A MOMENT AND GO HOME ---
	  353:	$  inquire/nopunc reply "     TAPE BACKUP DONE.  PRESS < RETURN > TO CONTINUE: "
	  354:	$  goto MAIN_MENU			! back to main menu for next selection
	  355:	$!
	  356:	$! =============================== End-of-File ================================

	  ARCScomm/Phoenix Detail Design                                              Page B37
	  Appendix B: Source Code - 11) ARCSVALID.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	ARCSvalid
	    4:	 *
	    5:	 * Purpose:	Display validation screen and prompt user for command.
	    6:	 *
	    7:	 * Call:	arcsvalid ( opcode, arcsmsg, pdata, nprf, prfflds, reply )
	    8:	 *
	    9:	 * Arguments:
	   10:	 *		opcode (I)	addr of char string containing either "VALID"
	   11:	 *				to perform normal validation, or "DUMP" to
	   12:	 *				dump both ARCS and Phoenix records on screen.
	   13:	 *		arcsmsg (I)	addr of char string containing ARCS message.
	   14:	 *		pdata (I)	addr of process data struct containing
	   15:	 *				static and dynamic cust-data to be
	   16:	 *				reconciled.
	   17:	 *		nprflds (I)	int containing number of prfflds below, if
	   18:	 *				nprflds=0 indicates initial customer record.
	   19:	 *		prfflds (I)	addr of int vector containing the sequence
	   20:	 *				number (1=gcn,etc) of fields not agreeing.
	   21:	 *		reply (O)	addr of char string returning user command.
	   22:	 *
	   23:	 * Returns:	- int
	   24:	 *		icmd		index of user command within internal table.
	   25:	 *
	   26:	 * Source:	ARCSVALID.C
	   27:	 *
	   28:	 * --------------------------------------------------------------------------
	   29:	 * Revision History:
	   30:	 *
	   31:	 * 01/06/86	J.Forkosh	Installation.
	   32:	 *
	   33:	 ****************************************************************************/
	   34:	
	   35:	#include stdio
	   36:	#include ctype
	   37:	#include "arcscomm.h"
	   38:	#include "pdata.h"
	   39:	
	   40:	/* ---------------------------------------------------------------------------
	   41:	   Global Variables
	   42:	--------------------------------------------------------------------------- */
	   43:	globalref int	msglevel;			/* debugging message level */
	   44:	
	   45:	arcsvalid ( opcode, arcsmsg, pdata, nprflds, prfflds, reply )
	   46:	char	*opcode;
	   47:	char	*arcsmsg;
	   48:	struct	process_data *pdata;
	   49:	int	nprflds;
	   50:	int	*prfflds;
	   51:	char	*reply;
	   52:	{
	   53:	
	   54:	/* ---------------------------------------------------------------------------
	   55:	   Allocations and Declarations

	  ARCScomm/Phoenix Detail Design                                              Page B38
	  Appendix B: Source Code - 11) ARCSVALID.C


	   56:	--------------------------------------------------------------------------- */
	   57:	int	ifld,ifld1,nfld;			/* index over nprf */
	   58:	int	iprf,nprf;				/* field number, num fields */
	   59:	int	nbytes,nmask;				/* fld_len, fld+mask_len */
	   60:	int	arcsoff;				/* arcs_offset */
	   61:	int	phnxoff;				/* phnx_offset */
	   62:	char	*arcsptr,*phnxptr;			/* char ptrs to arcs & phnx */
	   63:	char	arcsfld[256],phnxfld[256];		/* local copies of fields */
	   64:	char	*stub_name;				/* char ptr to field name */
	   65:	char	*hdr_ptrs[8];				/* char ptrs to hdr fields */
	   66:	static	int nflds_per_pg = 6;			/* num fields printed per pg */
	   67:	static	int hdr_flds[] = {0,3,4,-1};		/* GCN,Country,Inst. */
	   68:	int	ipage,npage;				/* page # of validation scrn */
	   69:	int	ihdr;					/* index for hdr_lines */
	   70:	int	icmd;					/* index over commands */
	   71:	char	command[64];				/* local copy of user reply */
	   72:	char	errmsg[64];				/* tell user he goofed */
	   73:	char	toupper();				/* convert command to upper */
	   74:	int	got_command;				/* TRUE if we got good cmd */
	   75:	static	char *command_set[] = { "OK","NG","BY","GO","UP","DN","\000" };
	   76:	
	   77:	/* ---------------------------------------------------------------------------
	   78:	   Screen Layouts
	   79:	------------------------------------------------------------------------------
	   80:	          1         2         3         4         5         6         7
	   81:	"1234567890123456789012345678901234567890123456789012345678901234567890123456"
	   82:	--------------------------------------------------------------------------- */
	   83:	static	char *hdr_fmt =
	   84:	"\n     ROUTE CODE: %-5.5s  COUNTRY: %-3.3s  NAME: %-.32s\n";
	   85:	static	char *fld_fmt =
	   86:	"\n     %-12.12s     %-25.25s    %-25.25s";
	   87:	static	char *hdr_lines[] =
	   88:	{
	   89:	"\033[0;0H\033[2J",
	   90:	"     -----------------------------------------------------------------------",
	   91:	"                       ARCSCOMM/PHOENIX UPDATE VALIDATION                   ",
	   92:	"     -----------------------------------------------------------------------",
	   93:	"                              --- COMMANDS ---",
	   94:	"     OK - PERFORM THIS UPDATE               BY - ABORT JOB (NO MORE UPDATES)",
	   95:	"     NG - DON'T PERFORM THIS UPDATE         GO - CONTINUE WITHOUT VALIDATING",
	   96:	"     UP - DISPLAY PREVIOUS PAGE             DN - DISPLAY NEXT PAGE          ",
	   97:	"     -----------------------------------------------------------------------",
	   98:	""
	   99:	};
	  100:	
	  101:	/* ---------------------------------------------------------------------------
	  102:	   Initialization
	  103:	--------------------------------------------------------------------------- */
	  104:	if ( msglevel > 99 )				/* level of debugging output */
	  105:		{
	  106:		printf("\nARCSvalid> arcs<%.25s> phnx<%.25s>",
	  107:		arcsmsg,(char *)&(pdata->static_cust_data));
	  108:		printf("\nPress ENTER to continue -->");
	  109:		gets(reply);
	  110:		}
	  111:	ipage = 0;					/* start with 1st page */

	  ARCScomm/Phoenix Detail Design                                              Page B39
	  Appendix B: Source Code - 11) ARCSVALID.C


	  112:	nprf = nprflds;					/* usually the same... */
	  113:	if ( !strcmp(opcode,"DUMP") ) nprf=0;		/* ...unless we're doing dump */
	  114:	if ( (nfld=(nprf>0)?nprf:0) == 0)		/* new record or update ? */
	  115:		while(arcsphnx_flds[nfld].fld_len >= 0) nfld++;
	  116:	npage = (nfld-1)/nflds_per_pg;			/* max number pages */
	  117:	errmsg[0] = '\000';				/* so far, so good */
	  118:	command[0]= '\000';				/* so far, no command */
	  119:	got_command = FALSE;				/* not got yet */
	  120:	
	  121:	/* ---------------------------------------------------------------------------
	  122:	   Display Validation Screen
	  123:	--------------------------------------------------------------------------- */
	  124:	while ( !got_command )				/* user still wants more */
	  125:		{
	  126:	/* --- print the page header --- */
	  127:		for ( ihdr=0; strlen(hdr_lines[ihdr])>0; ihdr++ )
	  128:			printf("\n%s",hdr_lines[ihdr]);	/* print all header lines */
	  129:		for ( ihdr=0; (iprf=hdr_flds[ihdr]) >= 0; ihdr++ ) /* get hdr flds */
	  130:			hdr_ptrs[ihdr] = arcsmsg + arcsphnx_flds[iprf].arcs_offset;
	  131:		printf(hdr_fmt, hdr_ptrs[0],hdr_ptrs[1],hdr_ptrs[2]);
	  132:		printf(fld_fmt, "FIELD NAME","ARCS VALUE","PHOENIX VALUE");
	  133:		printf(fld_fmt, "----------","----------","-------------");
	  134:	
	  135:	/* ---------------------------------------------------------------------------
	  136:	   Run through unreconciled fields indicated in prfflds for this page
	  137:	--------------------------------------------------------------------------- */
	  138:	/* --- first handle page navigation --- */
	  139:		if ( !strcmp(command,"DN") )
	  140:			if( ++ipage > npage)			/* DN=next page */
	  141:				{				/* if went past last */
	  142:				ipage = 0;			/* wrap to 1st page */
	  143:				strcpy(errmsg,"WRAPPING TO FIRST PAGE");
	  144:				}
	  145:		if ( !strcmp(command,"UP") )
	  146:			if( --ipage < 0 )			/* UP=prev page */
	  147:				{				/* if before 1st pg */
	  148:				ipage = npage;			/* wrap to last page */
	  149:				strcpy(errmsg,"WRAPPING TO LAST PAGE");
	  150:				}
	  151:	
	  152:	/* now loop through fields on this page --- */
	  153:		for ( ifld=ifld1 = ipage*nflds_per_pg;	/* first field on this pg, */
	  154:			ifld < nfld && ifld < ifld1+nflds_per_pg; ifld++ ) /* and last */
	  155:			{
	  156:			if( nprf > 0 )			/* got an updated cust... */
	  157:				iprf = prfflds[ifld];	/* ...so lookup prfflds */
	  158:			else				/* got a new cust... */
	  159:				iprf=ifld;		/* ...so shoot the works */
	  160:			stub_name=arcsphnx_flds[iprf].fld_name;
	  161:			nbytes  = arcsphnx_flds[iprf].fld_len;
	  162:			nmask = strlen(arcsphnx_flds[iprf].phnx_mask);
	  163:			arcsoff = arcsphnx_flds[iprf].arcs_offset;
	  164:			phnxoff = arcsphnx_flds[iprf].phnx_offset;
	  165:			arcsptr = arcsmsg + arcsoff;
	  166:			if ( phnxoff >= 0 )		/* use static_cust_data */
	  167:				phnxptr = (char *)&(pdata->static_cust_data) + phnxoff;

	  ARCScomm/Phoenix Detail Design                                              Page B40
	  Appendix B: Source Code - 11) ARCSVALID.C


	  168:			else				/* use dynamic_cust_data */
	  169:				phnxptr = (char *)&(pdata->dynamic_cust_data)- phnxoff;
	  170:			if ( arcsoff >= 0 )
	  171:				{			/* >=0 means a real field */
	  172:				strncpy(arcsfld,arcsptr,nbytes);/* local copies... */
	  173:				strncpy(phnxfld,phnxptr,nbytes+nmask);
	  174:				arcsfld[nbytes] = phnxfld[nbytes+nmask] = '\000';
	  175:				}
	  176:				else
	  177:				{			/* <0 is a dummy field */
	  178:				strcpy(arcsfld,"dummy field");
	  179:				phnxfld[0] = '\000';
	  180:				}
	  181:			if( nprf==0			/* new cust or dump... */
	  182:			&&  strcmp(opcode,"DUMP") )	/* ...not a dump so new cust */
	  183:				{
	  184:				phnxfld[0]='\000';	/* print blanks except line1 */
	  185:				if( ifld==ifld1 )
	  186:					{
	  187:					strcpy(phnxfld,"---NEW CUSTOMER---");
	  188:					if( ipage==0 ) strcat(phnxfld,"\007");
	  189:					}		/* bell on first page too */
	  190:				}
	  191:			printf(fld_fmt, stub_name,arcsfld,phnxfld);/* print them */
	  192:			}
	  193:	
	  194:	/* --- skip to page bot, print error message (if any) and command prompt --- */
	  195:		while (ifld++ - ifld1 < nflds_per_pg)
	  196:			printf("\n");			/* skip to bottom of pg */
	  197:		printf("\n\n     %s\n     COMMAND: ",errmsg); /* print err & prompt */
	  198:	
	  199:	/* --- read command, < CR > defaults to Page DN, and lookup in table  --- */
	  200:		gets ( command );			/* get reply */
	  201:		if ( strlen(command)==0 )
	  202:			strcpy(command,"DN");		/* default < CR > to Page DN */
	  203:		for ( icmd=0; command[icmd] != NULL; icmd++ )/* convert each char */
	  204:			command[icmd] = toupper(command[icmd]);/* to uppercase */
	  205:		strcpy(errmsg,"\007PLEASE ENTER A VALID TWO-CHARACTER COMMAND");
	  206:		for ( icmd=0; strlen(command_set[icmd])>0; icmd++ )
	  207:			if ( !strcmp(command_set[icmd],command) )
	  208:				{
	  209:				errmsg[0] = '\000';	/* reset err msg */
	  210:				strcpy(reply,command);	/* return uppercase reply */
	  211:				if ( icmd < 4 ) got_command = TRUE; /* else UP or DN */
	  212:				break;			/* already found it so break */
	  213:				}
	  214:		}
	  215:	
	  216:	/* ---------------------------------------------------------------------------
	  217:	   Return to caller
	  218:	--------------------------------------------------------------------------- */
	  219:	return(icmd);
	  220:	}

	  ARCScomm/Phoenix Detail Design                                              Page B41
	  Appendix B: Source Code - 12) PDATA.H


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Structure:	pdata
	    4:	 *
	    5:	 * Purpose:	Describes the process_data structure used by the Phoenix
	    6:	 *		DBSA.  Note that this is a temporary stub, to be replaced
	    7:	 *		when CICI provides the definitive structure definitions.
	    8:	 *
	    9:	 * Source:	PDATA.H
	   10:	 *
	   11:	 * ------------------------------------------------------------------------
	   12:	 * Revision History:
	   13:	 *
	   14:	 * 12/27/85	J.Forkosh	Installation.
	   15:	 *
	   16:	 ****************************************************************************/
	   17:	
	   18:	/* ------------------------------------------------------------------------
	   19:	   DBS error codes / return statuses
	   20:	   received from Steve Wolfe 01/8/86 for testing.
	   21:	--------------------------------------------------------------------------- */
	   22:	#define	DBSI_EC_SUCCESSFUL_OPERATION	1
	   23:	#define	DBSI_EC_SUCCESSFUL_NO_DATA	3
	   24:	#define	DBSI_EC_INVALID_CUST_KEY_TYPE	100
	   25:	#define	DBSI_EC_CANT_CHANGE_ORIG_TEXT	102
	   26:	#define	DBSI_EC_NO_ACTIVE_TRANS_SESSION	104
	   27:	#define	DBSI_EC_APPLIC_CANCEL_TRAN	106
	   28:	#define	DBSI_EC_REF_MSG_MODIFIED	110
	   29:	#define	DBSI_EC_NO_STAT_BKT_FOR_OPR	112
	   30:	
	   31:	/* ------------------------------------------------------------------------
	   32:	   Static Customer Data -- fields for simulation DBS Static Customer File
	   33:	   received from Steve Wolfe 01/8/86 for testing.
	   34:	--------------------------------------------------------------------------- */
	   35:	#define	SZ_CORR_NAME		72
	   36:	#define SZ_CITY_NAME		26
	   37:	#define	SZ_CITY_CODE		3
	   38:	#define	SZ_ST_COUNTRY		3
	   39:	#define	SZ_CABLE_ADDR		20
	   40:	#define	SZ_GCN_ADDR		5
	   41:	#define	SZ_IN_ROUTE		5
	   42:	#define	SZ_CALL_SIGN		6
	   43:	#define	SZ_DIAL_ACCESS_TYPE	1
	   44:	#define	SZ_TELEX_NUM		14
	   45:	#define	SZ_ANSBK_NUM		21
	   46:	#define	SZ_DDA_NUM		8
	   47:	#define	SZ_ABA_NUM		9
	   48:	#define	SZ_CURRENCY_CODE	3
	   49:	#define	SZ_VERIFY_MSGS		1
	   50:	#define	SZ_MARTI_YN		1
	   51:	#define	SZ_TWD_ALG_IN		20
	   52:	#define	SZ_TWD_ALG_IM		20
	   53:	#define	SZ_TWD_ALG_OT		20
	   54:	#define	SZ_FOR_DOM_FLAG		1
	   55:	#define	SZ_MISC_FLAGS		3

	  ARCScomm/Phoenix Detail Design                                              Page B42
	  Appendix B: Source Code - 12) PDATA.H


	   56:	#define	SZ_COMMENT_C		80
	   57:							/*---------------------------*/
	   58:	struct	static_cust_def				/*L E N G T H            POS */
	   59:		{					/*---------------------------*/
	   60:		unsigned char	dbs_corr_name		[SZ_CORR_NAME];	      /*   0 */
	   61:		unsigned char	dbs_city_name		[SZ_CITY_NAME];	      /*  72 */
	   62:		unsigned char	dbs_city_code		[SZ_CITY_CODE];	      /*  98 */
	   63:		unsigned char	dbs_st_country		[SZ_ST_COUNTRY];      /* 101 */
	   64:		unsigned char	dbs_cable_addr		[SZ_CABLE_ADDR];      /* 104 */
	   65:		unsigned char	dbs_gcn_addr		[SZ_GCN_ADDR];	      /* 124 */
	   66:		unsigned char	dbs_in_route		[SZ_IN_ROUTE];	      /* 129 */
	   67:		unsigned char	dbs_call_sign		[SZ_CALL_SIGN];	      /* 134 */
	   68:		unsigned char	dbs_dial_access_type1	[SZ_DIAL_ACCESS_TYPE];/* 140 */
	   69:		unsigned char	dbs_telex_num1		[SZ_TELEX_NUM];	      /* 141 */
	   70:		unsigned char	dbs_ansbk_num1		[SZ_ANSBK_NUM];	      /* 155 */
	   71:		unsigned char	dbs_dial_access_type2	[SZ_DIAL_ACCESS_TYPE];/* 176 */
	   72:		unsigned char	dbs_telex_num2		[SZ_TELEX_NUM];	      /* 177 */
	   73:		unsigned char	dbs_ansbk_num2		[SZ_ANSBK_NUM];	      /* 191 */
	   74:		unsigned char	dbs_dial_access_type3	[SZ_DIAL_ACCESS_TYPE];/* 212 */
	   75:		unsigned char	dbs_telex_num3		[SZ_TELEX_NUM];	      /* 213 */
	   76:		unsigned char	dbs_ansbk_num3		[SZ_ANSBK_NUM];	      /* 227 */
	   77:		unsigned char	dbs_dda_num		[SZ_DDA_NUM];	      /* 248 */
	   78:		unsigned char	dbs_aba_num		[SZ_ABA_NUM];	      /* 256 */
	   79:		unsigned char	dbs_currency_code	[SZ_CURRENCY_CODE];   /* 265 */
	   80:		unsigned char	dbs_verify_msgs		[SZ_VERIFY_MSGS];     /* 268 */
	   81:		unsigned char	dbs_marti_yn		[SZ_MARTI_YN];	      /* 269 */
	   82:		unsigned char	dbs_twd_alg_in		[SZ_TWD_ALG_IN];      /* 270 */
	   83:		unsigned char	dbs_twd_alg_im		[SZ_TWD_ALG_IM];      /* 290 */
	   84:		unsigned char	dbs_twd_alg_ot		[SZ_TWD_ALG_OT];      /* 310 */
	   85:		unsigned char	dbs_for_dom_flag	[SZ_FOR_DOM_FLAG];    /* 330 */
	   86:		unsigned char	dbs_misc_flags		[SZ_MISC_FLAGS];      /* 331 */
	   87:		unsigned char	dbs_comment_c		[SZ_COMMENT_C]; /*-----* 334 */
	   88:		};					/* Static Cust Rec Size= 414 */
	   89:							/*---------------------------*/
	   90:	
	   91:	/* ------------------------------------------------------------------------
	   92:	   Dynamic Customer Data -- trash for testing (actually, ROUTE.MST record fmt)
	   93:	--------------------------------------------------------------------------- */
	   94:						/* -------------------------------- */
	   95:	struct	dynamic_cust_def		/* Fld#  Bytes  Description     Key */
	   96:		{				/* -------------------------------- */
	   97:		unsigned char	rte[ 5];	/*  01	001-005	GCN Address      00 */
	   98:		unsigned char	typ[ 1];	/*  02    006   Address type     01 */
	   99:		unsigned char	cty[ 3];	/*  03  007-009 City Code        02 */
	  100:		unsigned char	cny[ 3];	/*  04  010-012 Country Code     03 */
	  101:		unsigned char	rgn[ 2];	/*  05  013-014 Region Code      04 */
	  102:		unsigned char	nm1[72];	/*  06  015-086 Institution      05 */
	  103:		unsigned char	smn[ 1];	/*  07    087   Single/Mult Name    */
	  104:		unsigned char	bkw[ 4];	/*  08  088-091 BankWire Code       */
	  105:		unsigned char	$$1[23];	/*  09  092-114 << available >>     */
	  106:		unsigned char	ad1[50];	/*  10  115-164 Inst Address 1      */
	  107:		unsigned char	ad2[50];	/*  11  165-214 Inst Address 2      */
	  108:		unsigned char	ad3[50];	/*  12  215-264 Inst Address 3      */
	  109:		unsigned char	nam[20];	/*  13  265-284 User Name           */
	  110:		unsigned char	phn[10];	/*  14  285-294 User Phone#         */
	  111:		unsigned char	pwd[21];	/*  15  295-315 User Password       */

	  ARCScomm/Phoenix Detail Design                                              Page B43
	  Appendix B: Source Code - 12) PDATA.H


	  112:		unsigned char	csw[ 2];	/*  16  316-317 Switch ID           */
	  113:		unsigned char	sta[ 3];	/*  17  318-320 Station/Line ID     */
	  114:		unsigned char	sda[ 5];	/*  18  321-325 2nd Delivery Addr   */
	  115:		unsigned char	rfl[ 3];	/*  19  326-328 Refile Country Code */
	  116:		unsigned char	tac[ 3];	/*  20  329-331 Telex Area Code     */
	  117:		unsigned char	tx1[13];	/*  21  332-344 1st Telex Number    */
	  118:		unsigned char	ta1[20];	/*  22  345-364 1st Tx Answerback   */
	  119:		unsigned char	tx2[13];	/*  23  365-377 2nd Telex Number    */
	  120:		unsigned char	ta2[20];	/*  24  378-397 2nd Tx Answerback   */
	  121:		unsigned char	tx3[13];	/*  25  398-410 3rd Telex Number    */
	  122:		unsigned char	ta3[20];	/*  26  411-430 3rd Tx Answerback   */
	  123:		unsigned char	bid[19];	/*  27  431-449 Bank ID             */
	  124:		unsigned char	$$2[ 1];	/*  28    450   << available >>     */
	  125:		unsigned char	chp[ 9];	/*  29  451-459 CHIPS number        */
	  126:		unsigned char	swf[11];	/*  30  460-470 Swift Address       */
	  127:		unsigned char	dda[ 8];	/*  31  471-478 DDA Number          */
	  128:		unsigned char	exp[ 4];	/*  32  479-482 Expense Code        */
	  129:		unsigned char	bkg[ 2];	/*  33  483-484 Bank Group          */
	  130:		unsigned char	bkc[ 4];	/*  34  485-488 MARTI Bank Code     */
	  131:		unsigned char	bix[ 1];	/*  35    489   Bank ID Prefix      */
	  132:		unsigned char	sts[ 1];	/*  36    490   Status Flag         */
	  133:		unsigned char	utr[ 1];	/*  37    491   User Test Region    */
	  134:		unsigned char	cos[ 2];	/*  38  492-493 Class of Service    */
	  135:		unsigned char	cot[ 1];	/*  39    494   Class of Terminal   */
	  136:		unsigned char	udi[ 1];	/*  40    495   User Delivery Info  */
	  137:		unsigned char	tfs[ 1];	/*  41    496   Test Flag - SENDS   */
	  138:		unsigned char	tfr[ 1];	/*  42    497   Test Flag - RECVS   */
	  139:		unsigned char	sys[ 2];	/*  43  498-499 System Indicator    */
	  140:		unsigned char	dir[ 1];	/*  44    500   GCN Directory       */
	  141:		unsigned char	dcr[ 6];	/*  45  501-506 Date Record Created */
	  142:		unsigned char	dup[ 6];	/*  46  507-512 Date Record Updated */
	  143:		};				/* -------------------------------- */
	  144:	
	  145:	/* ------------------------------------------------------------------------
	  146:	   DBSA Process Data Structure
	  147:	--------------------------------------------------------------------------- */
	  148:							/* ------------------------ */
	  149:	struct	process_data				/* Len Description          */
	  150:		{					/* ------------------------ */
	  151:		long		process_id;		/*     PID of this process  */
	  152:		unsigned char	proc_logical_name[32];	/*     process PHOENIX name */
	  153:		unsigned char	filler_1[128];		/*     filler               */
	  154:		long		trans_session_status;	/*     running trans status */
	  155:		unsigned char	filler_2[128];		/*     filler               */
	  156:		long		dbs_error_code;		/*     last dbs err status  */
	  157:		unsigned char	filler_3[128];		/*     filler               */
	  158:		unsigned char	cust_key[21];		/*     "AxxxxxBLANKS..."    */
	  159:		unsigned char	filler_4[128];		/*     filler               */
	  160:		struct static_cust_def			/*                          */
	  161:				static_cust_data;	/*     static customer data */
	  162:		struct dynamic_cust_def			/*                          */
	  163:				dynamic_cust_data;	/*     dynamic customer dat */
	  164:		unsigned char	filler_5[128];		/*     filler               */
	  165:		};					/* ------------------------ */
	  166:	
	  167:	/* ============================ End-of-File ============================== */

	  ARCScomm/Phoenix Detail Design                                              Page B44
	  Appendix B: Source Code - 13) PHNXCLNT.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	PHNXclnt
	    4:	 *
	    5:	 * Purpose:	Issues request for cust-file record I/O to the Phoenix DBSA.
	    6:	 *
	    7:	 * Call:	phnxclnt ( request, parg, pdata )
	    8:	 *
	    9:	 * Arguments:
	   10:	 *		request (I)	addr of char string containing a mnemonic for
	   11:	 *				the operation to be performed:
	   12:	 *				request(I) parg(I/O*)	operation
	   13:	 *				---------- ----------	---------
	   14:	 *				(1)INIT	   proc name	Initialize Process
	   15:	 *				(2)BEGIN   < unused >	Begin Transaction
	   16:	 *				(3)WRTLOG# applic msg	Write to Generic Log
	   17:	 *				(4)COMMIT  < unused >	Commit Transaction
	   18:	 *				(5)CANCEL  < unused >	Cancel Transaction
	   19:	 *				(6)SHUTDN  shutdn msg*	Shutdown Process
	   20:	 *				(7)RDCUST# route code	Read Customer
	   21:	 *				(8)WRCUST# route code	Write Initial Customer
	   22:	 *				(9)UPCUST# route code	Update Customer
	   23:	 *				# BEGIN/COMMIT done within PHNXclnt
	   24:	 *				* Output field
	   25:	 *		parg (I/O)	addr of char string containing argument
	   26:	 *				corresponding to above table.  When parg is
	   27:	 *				route code, it's the 5-char routing code
	   28:	 *				for customer (same as ROUTE_MST gcn code).
	   29:	 *				If NULL, pdata cust-key will be left unchanged
	   30:	 *				from previous call.
	   31:	 *		pdata (I/O)	addr of process data struct containing
	   32:	 *				cust-data, etc (see pdata.h).  Note that caller
	   33:	 *				MUST ALWAYS call phnxclnt with the same pdata
	   34:	 *				struct, and MUST NEVER write into it himself.
	   35:	 *
	   36:	 * Returns:	- int
	   37:	 *
	   38:	 * Source:	PHNXCLNT.C
	   39:	 *
	   40:	 * --------------------------------------------------------------------------
	   41:	 * Revision History:
	   42:	 *
	   43:	 * 12/31/85	J.Forkosh	Installation.
	   44:	 *
	   45:	 ****************************************************************************/
	   46:	
	   47:	#include stdio
	   48:	#include "pdata.h"
	   49:	#include "phnxstat.h"
	   50:	
	   51:	/* ---------------------------------------------------------------------------
	   52:	   Phoenix DBSA Gateway Interface Functions
	   53:	--------------------------------------------------------------------------- */
	   54:	#define	INIT	phnx_stub
	   55:	#define	BEGIN	phnx_stub

	  ARCScomm/Phoenix Detail Design                                              Page B45
	  Appendix B: Source Code - 13) PHNXCLNT.C


	   56:	#define	WRTLOG	phnx_stub
	   57:	#define	COMMIT	phnx_stub
	   58:	#define	CANCEL	phnx_stub
	   59:	#define	SHUTDN	phnx_stub
	   60:	#define	RDCUST	test_rdcust
	   61:	#define	WRCUST	phnx_stub
	   62:	#define	UPCUST	phnx_stub
	   63:	/* ---------------------------------------------------------------------------
	   64:	   Global Variables
	   65:	--------------------------------------------------------------------------- */
	   66:	globalref int	msglevel;			/* debugging message level */
	   67:	globalref char	dummy_rec[512];			/* for testing */
	   68:	
	   69:	phnxclnt ( request, parg, pdata )
	   70:	char	*request;
	   71:	char	*parg;
	   72:	struct	process_data *pdata;
	   73:	{
	   74:	
	   75:	/* ---------------------------------------------------------------------------
	   76:	   Allocations and Declarations
	   77:	--------------------------------------------------------------------------- */
	   78:	static	char *dbsa_calls[] =			/* lookup tbl of DBSA calls */
	   79:		{					/* switch() uses tbl index  */
	   80:		"INIT",		"BEGIN",	"WRTLOG",
	   81:		"COMMIT",	"CANCEL",	"SHUTDN",
	   82:		"RDCUST",	"WRCUST",	"UPCUST",
	   83:		"\0"
	   84:		};
	   85:	int	irequest;				/* indx in tbl match request */
	   86:	int	dbsa_stat;				/* return stat from DBSA */
	   87:	int	phnx_stat;				/* return stat to caller */
	   88:	char	cust_key[32];				/* 21-char cust_key */
	   89:	
	   90:	/* ---------------------------------------------------------------------------
	   91:	   Initialization
	   92:	--------------------------------------------------------------------------- */
	   93:	if ( msglevel > 99 )				/* level of debugging output */
	   94:		printf ("\nPHNXclnt> request= %.32s", request);
	   95:	phnx_stat = dbsa_stat = PHNX$_SUCCESS;		/* so far, so good */
	   96:	
	   97:	/* ---------------------------------------------------------------------------
	   98:	   Determine request type
	   99:	--------------------------------------------------------------------------- */
	  100:	irequest = 0;					/* start with 1st call */
	  101:	while ( strlen(dbsa_calls[irequest]) > 0 )	/* trailer is "\0" */
	  102:		{					/* does tbl match request? */
	  103:		if ( !strcmp(dbsa_calls[irequest],request) ) goto issue_request;
	  104:		irequest++;				/* nope - try next call */
	  105:		}
	  106:	if ( msglevel > 1 )				/* input arg has bum request */
	  107:		printf ("\nPHNXclnt> invalid request= %.32s", request);
	  108:	return ( PHNX$_BADARG );
	  109:	
	  110:	/* ---------------------------------------------------------------------------
	  111:	   Issue request

	  ARCScomm/Phoenix Detail Design                                              Page B46
	  Appendix B: Source Code - 13) PHNXCLNT.C


	  112:	--------------------------------------------------------------------------- */
	  113:	issue_request:
	  114:	dbsa_stat = DBSI_EC_SUCCESSFUL_OPERATION;	/* default DBSA status ok */
	  115:	phnx_stat = PHNX$_SUCCESS;			/* default Phoenix stat ok */
	  116:	switch ( irequest+1 )
	  117:		{
	  118:		case 1:
	  119:			INIT	( parg,  pdata, &dbsa_stat );
	  120:			if ( dbsa_stat != DBSI_EC_SUCCESSFUL_OPERATION )
	  121:				phnx_stat = PHNX$_FATALERR;	/* can't init fatal */
	  122:			break;
	  123:		case 2:
	  124:			BEGIN	( pdata, pdata );
	  125:			break;
	  126:		case 3:
	  127:			BEGIN	( pdata, pdata );
	  128:			WRTLOG	( pdata, parg,  pdata, &dbsa_stat );
	  129:			if ( dbsa_stat == DBSI_EC_SUCCESSFUL_OPERATION )
	  130:				COMMIT	( pdata, pdata, &dbsa_stat );
	  131:			else
	  132:				{
	  133:				phnx_stat = PHNX$_FAILURE;
	  134:				CANCEL	( pdata, pdata, &dbsa_stat );
	  135:				}
	  136:			break;
	  137:		case 4:
	  138:			COMMIT	( pdata, pdata, &dbsa_stat );
	  139:			break;
	  140:		case 5:
	  141:			CANCEL	( pdata, pdata, &dbsa_stat );
	  142:			break;
	  143:		case 6:
	  144:			SHUTDN	( pdata, parg,  &dbsa_stat );
	  145:			break;
	  146:		case 7:
	  147:			strncpy	( cust_key, "A                       ", 21);
	  148:			strncpy ( &cust_key[1], parg, 5 );
	  149:			BEGIN	( pdata, pdata );
	  150:			RDCUST	( pdata, cust_key, pdata, &dbsa_stat );
	  151:			if ( dbsa_stat != DBSI_EC_SUCCESSFUL_OPERATION )
	  152:				{
	  153:				if ( dbsa_stat == DBSI_EC_SUCCESSFUL_NO_DATA )
	  154:					phnx_stat = PHNX$_NOTFOUND;
	  155:				else
	  156:					phnx_stat = PHNX$_FAILURE;
	  157:				}
	  158:			COMMIT	( pdata, pdata, &dbsa_stat );
	  159:			break;
	  160:		case 8:
	  161:			BEGIN	( pdata, pdata );
	  162:			WRCUST	( pdata, pdata, &dbsa_stat );
	  163:			if ( dbsa_stat == DBSI_EC_SUCCESSFUL_OPERATION )
	  164:				COMMIT	( pdata, pdata, &dbsa_stat );
	  165:			else
	  166:				{
	  167:				phnx_stat = PHNX$_FAILURE;

	  ARCScomm/Phoenix Detail Design                                              Page B47
	  Appendix B: Source Code - 13) PHNXCLNT.C


	  168:				CANCEL	( pdata, pdata, &dbsa_stat );
	  169:				}
	  170:			break;
	  171:		case 9:
	  172:			BEGIN	( pdata, pdata );
	  173:			UPCUST	( pdata, pdata, &dbsa_stat );
	  174:			if ( dbsa_stat == DBSI_EC_SUCCESSFUL_OPERATION )
	  175:				COMMIT	( pdata, pdata, &dbsa_stat );
	  176:			else
	  177:				{
	  178:				phnx_stat = PHNX$_FAILURE;
	  179:				CANCEL	( pdata, pdata, &dbsa_stat );
	  180:				}
	  181:			break;
	  182:		default:
	  183:			break;
	  184:		}
	  185:	
	  186:	/* ---------------------------------------------------------------------------
	  187:	   Return to caller
	  188:	--------------------------------------------------------------------------- */
	  189:	return ( phnx_stat );
	  190:	}
	  191:	
	  192:	/* ---------------------------------------------------------------------------
	  193:	   Dummy Routines
	  194:	--------------------------------------------------------------------------- */
	  195:	phnx_stub()
	  196:		{
	  197:		return;
	  198:		}
	  199:	
	  200:	test_rdcust(pdata,arg2,arg3,dbsa_stat)
	  201:	struct	process_data *pdata;
	  202:	int	*arg2,*arg3;
	  203:	int	*dbsa_stat;
	  204:	{
	  205:	char *stat,*dynam;				/* char ptrs to cust-data */
	  206:	float xrand;	int irand;			/* random error decision */
	  207:	int  prfflds[32];				/* dummy for arcsproof */
	  208:	arcsproof ( "INIT",dummy_rec,pdata,prfflds );	/* init pdata */
	  209:	*dbsa_stat = DBSI_EC_SUCCESSFUL_OPERATION;	/* init return stat */
	  210:	stat = (char *)&(pdata->static_cust_data);
	  211:	dynam= (char *)&(pdata->dynamic_cust_data);
	  212:	strncpy(dynam,dummy_rec,276);			/* init dynam = arcs */
	  213:	xrand = (float)rand()/(float)(2147483647);	/* 0 <= xrand <= 1 */
	  214:	irand = (int)(xrand*276.);			/* 0 to length of rec */
	  215:	if ( irand < 200 )				/* about 1 chance in 3 */
	  216:		{
	  217:		stat[irand]=dynam[irand]='X';		/* we'll mess up a char */
	  218:		if(irand<150)
	  219:		stat[irand+100]=dynam[irand+100]='X';	/* we'll mess up a char */
	  220:		if(irand<100)
	  221:		stat[4*irand]=dynam[4*irand]='X';	/* we'll mess up a char */
	  222:		}
	  223:	if ( irand < 50 )

	  ARCScomm/Phoenix Detail Design                                              Page B48
	  Appendix B: Source Code - 13) PHNXCLNT.C


	  224:		*dbsa_stat = DBSI_EC_SUCCESSFUL_NO_DATA;/* new rec in this case */
	  225:	if ( msglevel > 9 )
	  226:		printf("\nPHNXrdcust> arcs<%.25s> phnx<%.25s>",
	  227:		dummy_rec,(char *)&(pdata->static_cust_data));
	  228:	return;
	  229:	}

	  ARCScomm/Phoenix Detail Design                                              Page B49
	  Appendix B: Source Code - 14) PHNXMST.INC


	    1:	C/****************************************************************************
	    2:	C *
	    3:	C * Structure:	PHNXMST
	    4:	C *
	    5:	C * Purpose:	Describes the structure used to transfer ROUTE_MST records
	    6:	C *		from the ARCS server to the Phoenix client.
	    7:	C *
	    8:	C * Notes:	The Route Master file ROUTE_MST contains one 512-byte
	    9:	C *		fixed-length record per GCN address.  (It is an indexed file,
	   10:	C *		with primary key RTERTE and several alternate keys.)  Each
	   11:	C *
	   12:	C *		Each ROUTE_MST record maps into a Phoenix buffer, ARCSCOMM_BUF,
	   13:	C *		as described in this include file:
	   14:	C *		_P extension refers to a variable's position within RTEBUF,
	   15:	C *		_L refers to its length in  B*O*T*H  RTEBUF and ARCSCOMM_BUF.
	   16:	C *
	   17:	C *		The position within ARCSCOMM_BUF is determined dynamically as
	   18:	C *		the record is built by successively concatanating specified
	   19:	C *		fields.
	   20:	C *
	   21:	C *		THERE ARE SEVERAL KLUDGES:
	   22:	C *		_P - Value	Meaning
	   23:	C *		----------	-------
	   24:	C *		-1		Undefined (filled with PHX_FILLER char)
	   25:	C *		-3		City_Name field (read from CITY.TBL)
	   26:	C *		-99		OPR field (literal '99')
	   27:	C *		
	   28:	C *		Compile this file with /CONTINUATIONS=32 since the
	   29:	C *		initialization contains more than 19 lines.
	   30:	C *
	   31:	C * Source:	PHNXMST.INC
	   32:	C *
	   33:	C * --------------------------------------------------------------------------
	   34:	C * Revision History:
	   35:	C *
	   36:	C * 12/27/85	J.Forkosh	Installation.
	   37:	C *
	   38:	C ****************************************************************************/
	   39:	C 
	   40:		INTEGER*2	N_PHX_FIELDS /22/	! # FIELDS IN PHOENIX RECORD
	   41:		CHARACTER*1	PHX_FILLER/'?'/		! FILLER FOR UNDEFINED FIELDS
	   42:	C
	   43:		INTEGER*2 PHX_LAYOUT(2,32)
	   44:	     +		 !-------------------------------------------------------------
	   45:	     +		 !	POSITION	LENGTH		!FLD	DESCRIPTION
	   46:	     +		/!-------------------------------------------------------------
	   47:	     +			RTERTE_P,	RTERTE_L,	!  1	GCN ADDRESS
	   48:	     +			RTECTY_P,	RTECTY_L,	!  2	CITY CODE
	   49:	     +			-3,		26,		!  3	CITY NAME
	   50:	     +			RTECNY_P,	RTECNY_L,	!  4	COUNTRY CODE
	   51:	     +			RTENM1_P,	72,!RTENM1_L,	!  5	INSTITUTION NM
	   52:	     +			RTEBKW_P,	RTEBKW_L,	!  6	BANKWIRE CODE
	   53:	     +			RTETN1_P,	RTETN1_L,	!  7	1ST TELEX #
	   54:	     +			RTETA1_P,	RTETA1_L,	!  8	1ST TELEX ANS
	   55:	     +			RTETN2_P,	RTETN2_L,	!  9	2ND TELEX #

	  ARCScomm/Phoenix Detail Design                                              Page B50
	  Appendix B: Source Code - 14) PHNXMST.INC


	   56:	     +			RTETA2_P,	RTETA2_L,	! 10	2ND TELEX ANS
	   57:	     +			RTETN3_P,	RTETN3_L,	! 11	3RD TELEX #
	   58:	     +			RTETA3_P,	RTETA3_L,	! 12	3RD TELEX ANS
	   59:	     +			RTEBID_P,	RTEBID_L,	! 13	BANK ID
	   60:	     +			-1,		9,		! 14	ABA Number
	   61:	     +			RTEDDA_P,	RTEDDA_L,	! 15	DDA NUMBER
	   62:	     +			RTEMBC_P,	RTEMBC_L,	! 16	MARTI CODE
	   63:	     +			RTETFS_P,	RTETFS_L,	! 17	TEST FLAG SEND
	   64:	     +			RTEDUP_P,	RTEDUP_L,	! 18	DATE LAST UPDT
	   65:	     +			-99,		2,		! 19	OPR ID= "99"
	   66:	     +			-1,		5,		! 20	SGM=SYS MSGS
	   67:	     +			-1,		5,		! 21	MCI=MASTER ID
	   68:	     +			-1,		5,		! 22	OVERRIDE ROUTE
	   69:	     +			20*-1
	   70:	     +		/!-------------------------------------------------------------
	   71:	C
	   72:		COMMON/PHX_FORM/ N_PHX_FIELDS, PHX_LAYOUT
	   73:	C/* =========================== End-of-File ================================ */

	  ARCScomm/Phoenix Detail Design                                              Page B51
	  Appendix B: Source Code - 15) PHNXSTAT.H


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Structure:	phnxstat
	    4:	 *
	    5:	 * Purpose:	Describes the Phoenix return statuses that PHNXclnt
	    6:	 *		may return to ARCSupdt.
	    7:	 *
	    8:	 * Source:	PHNXSTAT.H
	    9:	 *
	   10:	 * Note:	This small file must be kept separate from pdata.h since
	   11:	 *		these symbols have nothing to do with Phoenix or the DBSA.
	   12:	 *
	   13:	 * ------------------------------------------------------------------------
	   14:	 * Revision History:
	   15:	 *
	   16:	 * 01/23/86	J.Forkosh	Installation.
	   17:	 *
	   18:	 ****************************************************************************/
	   19:	
	   20:	/* ------------------------------------------------------------------------
	   21:	   Return Statuses from PHNXclnt
	   22:	--------------------------------------------------------------------------- */
	   23:	#define	PHNX$_SUCCESS	0
	   24:	#define PHNX$_NOTFOUND	1
	   25:	#define	PHNX$_BADARG	2
	   26:	#define PHNX$_FAILURE	3
	   27:	#define	PHNX$_FATALERR	9
	   28:	/* ============================ End-of-File ============================== */

	  ARCScomm/Phoenix Detail Design                                              Page B52
	  Appendix B: Source Code - 16) ROUTEMST.INC


	    1:	C --------------------------- ROUTEMST.INC ---------------------------
	    2:	C 
	    3:	C The Route Master File, ROUTE_MST, contains 1 record per GCN address.
	    4:	C It is an indexed file, with primary key RTERTE and alternate keys 
	    5:	C as noted below.  It contains 512 byte fixed-length records.
	    6:	C Modified:
	    7:	C  1/8/85 SAZ RTE_STATUS added
	    8:	C  1/10/85 SAZ RTE_TSTRGN added
	    9:	C  1/11/85 SAZ Rewritten with a new format and symbolic representation of
	   10:	C   varible position and length.
	   11:	C  1/24/85 SAZ RTEBID_L changed from 20 to 19.
	   12:	C  3/12/85 SAZ RTEBUF_L added.
	   13:	C  6/3/85 SAZ _K variables added to parameterize KEYID values
	   14:	C-----------------------------------------------------------------------
	   15:	C	_P extension refers to variable's position within RTEBUF; _L 
	   16:	C	extension refers to its length; _K refers to variable's KEYID 
	   17:	C	value
	   18:	
	   19:		INTEGER*2 RTEBID_K, RTECNY_K, RTECTY_K, RTENM1_K, RTERGN_K, 
	   20:		1 RTERTE_K, RTETA1_K, RTETA2_K, RTETA3_K, RTETN1_K, RTETN2_K, 
	   21:		1 RTETN3_K, RTETYP_K
	   22:		PARAMETER (RTERTE_K=0, RTETYP_K=1, RTECTY_K=2, RTECNY_K=3, 
	   23:		1 RTERGN_K=4, RTENM1_K=5, RTETN1_K=7, RTETA1_K=8, RTETN2_K=9, 
	   24:		1 RTETA2_K=10, RTETN3_K=11, RTETA3_K=12, RTEBID_K=13)
	   25:	
	   26:		INTEGER*2 RTENM1_LEN			! Same as RTENM1_L
	   27:	
	   28:		INTEGER*2
	   29:		1 RTERTE_P, RTERTE_L, RTETYP_P, RTETYP_L, RTECTY_P, RTECTY_L, 
	   30:		1 RTECNY_P, RTECNY_L, RTERGN_P, RTERGN_L, RTENM1_P, RTENM1_L, 
	   31:		1 RTE_MULT_NAMES_P, RTE_MULT_NAMES_L, RTEBKW_P, RTEBKW_L, 
	   32:		1 RTEAD1_P, RTEAD1_L, RTEAD2_P, RTEAD2_L, RTEAD3_P, RTEAD3_L, 
	   33:		1 RTENAM_P, RTENAM_L, RTEPHN_P, RTEPHN_L, RTEPWD_P, RTEPWD_L, 
	   34:		1 RTECSW_P, RTECSW_L, RTESTA_P, RTESTA_L, RTESDA_P, RTESDA_L, 
	   35:		1 RTERFL_P, RTERFL_L, RTETAC_P, RTETAC_L, RTETN1_P, RTETN1_L, 
	   36:		1 RTETA1_P, RTETA1_L, RTETN2_P, RTETN2_L, RTETA2_P, RTETA2_L, 
	   37:		1 RTETN3_P, RTETN3_L, RTETA3_P, RTETA3_L, RTEBID_P, RTEBID_L, 
	   38:		1 RTECHP_P, RTECHP_L, RTESWF_P, RTESWF_L, RTEDDA_P, RTEDDA_L, 
	   39:		1 RTEEXP_P, RTEEXP_L, RTEBKG_P, RTEBKG_L, RTEMBC_P, RTEMBC_L, 
	   40:		1 RTEBIX_P, RTEBIX_L, RTE_STATUS_P, RTE_STATUS_L, 
	   41:		1 RTE_TSTRGN_P, RTE_TSTRGN_L, RTECOS_P, RTECOS_L, 
	   42:		1 RTECOT_P, RTECOT_L, RTEUDI_P, RTEUDI_L, RTETFS_P, RTETFS_L, 
	   43:		1 RTETFR_P, RTETFR_L, RTESYS_P, RTESYS_L, RTEDIR_P, RTEDIR_L, 
	   44:		1 RTEDCR_P, RTEDCR_L, RTEDUP_P, RTEDUP_L, RTEBUF_L
	   45:	
	   46:		PARAMETER (
	   47:		1 RTERTE_P = 1,				! 001-005  Route Code
	   48:		1 RTERTE_L = 5,
	   49:		1 RTETYP_P = RTERTE_P + RTERTE_L,	! 006-006  Address Type
	   50:		1 RTETYP_L = 1,
	   51:		1 RTECTY_P = RTETYP_P + RTETYP_L,	! 007-009  City Code
	   52:		1 RTECTY_L = 3,
	   53:		1 RTECNY_P = RTECTY_P + RTECTY_L,	! 010-012  Country Code
	   54:		1 RTECNY_L = 3,
	   55:		1 RTERGN_P = RTECNY_P + RTECNY_L,	! 013-014  Region Code

	  ARCScomm/Phoenix Detail Design                                              Page B53
	  Appendix B: Source Code - 16) ROUTEMST.INC


	   56:		1 RTERGN_L = 2,
	   57:		1 RTENM1_P = RTERGN_P + RTERGN_L,	! 015-086  Official Name
	   58:		1 RTENM1_L = 72, RTENM1_LEN=72,
	   59:		1 RTE_MULT_NAMES_P = RTENM1_P + RTENM1_L, ! 087-087  'S' or 'M' to 
	   60:		1 RTE_MULT_NAMES_L = 1,		! indicate single or multiple names
	   61:		1 RTEBKW_P = RTE_MULT_NAMES_P + RTE_MULT_NAMES_L, 	
	   62:		1 RTEBKW_L = 4,				! 088-091  Bankwire Code
	   63:		1 RTEAD1_P = RTEBKW_P + RTEBKW_L + 23,	! 115-164  Address Line 1
	   64:		1 RTEAD1_L = 50, 
	   65:		1 RTEAD2_P = RTEAD1_P + RTEAD1_L)	! 165-214  Address Line 2
	   66:		PARAMETER (
	   67:		1 RTEAD2_L = 50,
	   68:		1 RTEAD3_P = RTEAD2_P + RTEAD2_L,	! 215-264  Address Line 3
	   69:		1 RTEAD3_L = 50,
	   70:		1 RTENAM_P = RTEAD3_P + RTEAD3_L,	! 265-284  User Name
	   71:		1 RTENAM_L = 20, 
	   72:		1 RTEPHN_P = RTENAM_P + RTENAM_L,	! 285-294  User Telephone
	   73:		1 RTEPHN_L = 10,
	   74:		1 RTEPWD_P = RTEPHN_P + RTEPHN_L,	! 295-315  User Password
	   75:		1 RTEPWD_L = 21,
	   76:		1 RTECSW_P = RTEPWD_P + RTEPWD_L,	! 316-317  Switch ID
	   77:		1 RTECSW_L = 2,
	   78:		1 RTESTA_P = RTECSW_P + RTECSW_L,	! 318-320  Station ID
	   79:		1 RTESTA_L = 3,
	   80:		1 RTESDA_P = RTESTA_P + RTESTA_L,	! 321-325  Sec. Delivery Addr
	   81:		1 RTESDA_L = 5,
	   82:		1 RTERFL_P = RTESDA_P + RTESDA_L,	! 326-329  Refile Country Code
	   83:		1 RTERFL_L = 3,
	   84:		1 RTETAC_P = RTERFL_P + RTERFL_L,	! 329-331  Telex Area Code
	   85:		1 RTETAC_L = 3)
	   86:		PARAMETER (
	   87:		1 RTETN1_P = RTETAC_P + RTETAC_L,	! 332-344  1st Telex Number
	   88:		1 RTETN1_L = 13,
	   89:		1 RTETA1_P = RTETN1_P + RTETN1_L,	! 345-364  1st Telex Answerback
	   90:		1 RTETA1_L = 20,
	   91:		1 RTETN2_P = RTETA1_P + RTETA1_L,	! 365-377  2nd Telex Number
	   92:		1 RTETN2_L = 13,
	   93:		1 RTETA2_P = RTETN2_P + RTETN2_L,	! 378-397  2nd Telex Answerback
	   94:		1 RTETA2_L = 20,
	   95:		1 RTETN3_P = RTETA2_P + RTETA2_L,	! 398-410  3rd Telex Number
	   96:		1 RTETN3_L = 13,
	   97:		1 RTETA3_P = RTETN3_P + RTETN3_L,	! 411-430  3rd Telex Answerback
	   98:		1 RTETA3_L = 20, 
	   99:		1 RTEBID_P = RTETA3_P + RTETA3_L,	! 431-449  Bank ID/Cable Addr
	  100:		1 RTEBID_L = 19,
	  101:		1 RTECHP_P = RTEBID_P + RTEBID_L + 1,	! 451-459  CHIPS ABA Number
	  102:		1 RTECHP_L = 9, 
	  103:		1 RTESWF_P = RTECHP_P + RTECHP_L,	! 460-470  Swift Address
	  104:		1 RTESWF_L = 11, 
	  105:		1 RTEDDA_P = RTESWF_P + RTESWF_L)	! 471-478  DDA Number
	  106:		PARAMETER (
	  107:		1 RTEDDA_L = 8, 
	  108:		1 RTEEXP_P = RTEDDA_P + RTEDDA_L,	! 479-482  Expense Code
	  109:		1 RTEEXP_L = 4, 
	  110:		1 RTEBKG_P = RTEEXP_P + RTEEXP_L,	! 483-484  Bank Group
	  111:		1 RTEBKG_L = 2, 

	  ARCScomm/Phoenix Detail Design                                              Page B54
	  Appendix B: Source Code - 16) ROUTEMST.INC


	  112:		1 RTEMBC_P = RTEBKG_P + RTEBKG_L,	! 485-488  Marti Bank Code
	  113:		1 RTEMBC_L = 4, 
	  114:		1 RTEBIX_P = RTEMBC_P + RTEMBC_L,	! 489-489  Bank ID prefix
	  115:		1 RTEBIX_L = 1, 
	  116:		1 RTE_STATUS_P = RTEBIX_P + RTEBIX_L,	! 490-490  Record status
	  117:		1 RTE_STATUS_L = 1,			! (L/D/P)
	  118:		1 RTE_TSTRGN_P = RTE_STATUS_P + RTE_STATUS_L,! 491-491  Switch where 
	  119:		1 RTE_TSTRGN_L = 1,	! test is performed (L=London; N=New York)
	  120:		1 RTECOS_P = RTE_TSTRGN_P + RTE_TSTRGN_L,   ! 492-493  Class of Service
	  121:		1 RTECOS_L =  2,
	  122:		1 RTECOT_P = RTECOS_P + RTECOS_L,	! 494-494  Class of Terminal
	  123:		1 RTECOT_L = 1, 
	  124:		1 RTEUDI_P = RTECOT_P + RTECOT_L,	! 495-495  User Delivery Info
	  125:		1 RTEUDI_L = 1) 
	  126:		PARAMETER (
	  127:		1 RTETFS_P = RTEUDI_P + RTEUDI_L,	! 496-496  Test Flag - Sends
	  128:		1 RTETFS_L = 1, 
	  129:		1 RTETFR_P = RTETFS_P + RTETFS_L,	! 497-497  Test Flag - Recieves
	  130:		1 RTETFR_L = 1, 
	  131:		1 RTESYS_P = RTETFR_P + RTETFR_L,	! 498-499  System Indicator
	  132:		1 RTESYS_L = 2, 
	  133:		1 RTEDIR_P = RTESYS_P + RTESYS_L,	! 500-500  GCN Dir Indicator
	  134:		1 RTEDIR_L = 1, 
	  135:		1 RTEDCR_P = RTEDIR_P + RTEDIR_L,	! 501-506  Date Created 
	  136:		1 RTEDCR_L = 6,				! (mmddyy)
	  137:		1 RTEDUP_P = RTEDCR_P + RTEDCR_L,	! 507-512  Date Updated 
	  138:		1 RTEDUP_L = 6,				! (mmddyy)
	  139:		1 RTEBUF_L = RTEDUP_P +RTEDUP_L - 1)	! length of record = 512
	  140:	
	  141:		CHARACTER
	  142:		1 RTEBUF*(RTEBUF_L),		! 001-512  Entire Record
	  143:		1 RTERTE*(RTERTE_L),		! 001-005  Route Code
	  144:		1 RTETYP*(RTETYP_L),		! 006-006  Address Type
	  145:		1 RTECTY*(RTECTY_L),		! 007-009  City Code
	  146:		1 RTECNY*(RTECNY_L),		! 010-012  Country Code
	  147:		1 RTERGN*(RTERGN_L),		! 013-014  Region Code
	  148:		1 RTENM1*(RTENM1_L),		! 015-086  Official Name
	  149:		1 RTE_MULT_NAMES*(RTE_MULT_NAMES_L),	! 087-087  'S' or 'M' to
	  150:						! indicate single or multiple names
	  151:		1 RTEBKW*(RTEBKW_L),		! 088-091  Bankwire Code
	  152:		1 RTEAD1*(RTEAD1_L),		! 115-164  Address Line 1
	  153:		1 RTEAD2*(RTEAD2_L),		! 165-214  Address Line 2
	  154:		1 RTEAD3*(RTEAD3_L),		! 215-264  Address Line 3
	  155:		1 RTENAM*(RTENAM_L),		! 265-284  User Name
	  156:		1 RTEPHN*(RTEPHN_L),		! 285-294  User Telephone
	  157:		1 RTEPWD*(RTEPWD_L),		! 295-315  User Password
	  158:		1 RTECSW*(RTECSW_L),		! 316-317  Switch ID
	  159:		1 RTESTA*(RTESTA_L),		! 318-320  Station ID
	  160:		1 RTESDA*(RTESDA_L),		! 321-325  Sec. Delivery Addr
	  161:		1 RTERFL*(RTERFL_L)		! 326-329  Refile Country Code
	  162:		CHARACTER
	  163:		1 RTETAC*(RTETAC_L),		! 329-331  Telex Area Code
	  164:		1 RTETN1*(RTETN1_L),		! 332-344  1st Telex Number
	  165:		1 RTETA1*(RTETA1_L),		! 345-364  1st Telex Answerback
	  166:		1 RTETN2*(RTETN2_L),		! 365-377  2nd Telex Number
	  167:		1 RTETA2*(RTETA2_L),		! 378-397  2nd Telex Answerback

	  ARCScomm/Phoenix Detail Design                                              Page B55
	  Appendix B: Source Code - 16) ROUTEMST.INC


	  168:		1 RTETN3*(RTETN3_L),		! 398-410  3rd Telex Number
	  169:		1 RTETA3*(RTETA3_L),		! 411-430  3rd Telex Answerback
	  170:		1 RTEBID*(RTEBID_L),		! 431-449  Bank ID/Cable Addr
	  171:		1 RTECHP*(RTECHP_L),		! 451-459  CHIPS ABA Number
	  172:		1 RTESWF*(RTESWF_L),		! 460-470  Swift Address
	  173:		1 RTEDDA*(RTEDDA_L),		! 471-478  DDA Number
	  174:		1 RTEEXP*(RTEEXP_L),		! 479-482  Expense Code
	  175:		1 RTEBKG*(RTEBKG_L),		! 483-484  Bank Group
	  176:		1 RTEMBC*(RTEMBC_L),		! 485-488  Marti Bank Code
	  177:		1 RTEBIX*(RTEBIX_L),		! 489-489  Bank ID prefix
	  178:		1 RTE_STATUS*(RTE_STATUS_L),	! 490-490  Record status (L/D/P)
	  179:		1 RTE_TSTRGN*(RTE_TSTRGN_L),	! 491-491  Switch where test is 
	  180:						! performed (L=London; N=New York)
	  181:		1 RTECOS*(RTECOS_L),		! 492-493  Class of Service
	  182:		1 RTECOT*(RTECOT_L)		! 494-494  Class of Terminal
	  183:		CHARACTER
	  184:		1 RTEUDI*(RTEUDI_L),		! 495-495  User Delivery Info
	  185:		1 RTETFS*(RTETFS_L),		! 496-496  Test Flag - Sends
	  186:		1 RTETFR*(RTETFR_L),		! 497-497  Test Flag - Recieves
	  187:		1 RTESYS*(RTESYS_L),		! 498-499  System Indicator
	  188:		1 RTEDIR*(RTEDIR_L),		! 500-500  GCN Dir Indicator
	  189:		1 RTEDCR*(RTEDCR_L),		! 501-506  Date Created (mmddyy)
	  190:		1 RTEDUP*(RTEDUP_L)		! 507-512  Date Updated (mmddyy)
	  191:	
	  192:		INTEGER*2 SYSINT		! 498-499  Bit version of RTESYS
	  193:		EQUIVALENCE	(RTESYS,SYSINT)
	  194:	
	  195:		EQUIVALENCE
	  196:		1 (RTEBUF(RTERTE_P:RTERTE_P),		RTERTE),
	  197:		1 (RTEBUF(RTETYP_P:RTETYP_P),		RTETYP),
	  198:		1 (RTEBUF(RTECTY_P:RTECTY_P),		RTECTY),
	  199:		1 (RTEBUF(RTECNY_P:RTECNY_P),		RTECNY),
	  200:		1 (RTEBUF(RTERGN_P:RTERGN_P),		RTERGN),
	  201:		1 (RTEBUF(RTENM1_P:RTENM1_P),		RTENM1),
	  202:		1 (RTEBUF(RTE_MULT_NAMES_P:RTE_MULT_NAMES_P),	RTE_MULT_NAMES),
	  203:		1 (RTEBUF(RTEBKW_P:RTEBKW_P),		RTEBKW),
	  204:		1 (RTEBUF(RTEAD1_P:RTEAD1_P),		RTEAD1),
	  205:		1 (RTEBUF(RTEAD2_P:RTEAD2_P),		RTEAD2),
	  206:		1 (RTEBUF(RTEAD3_P:RTEAD3_P),		RTEAD3),
	  207:		1 (RTEBUF(RTENAM_P:RTENAM_P),		RTENAM),
	  208:		1 (RTEBUF(RTEPHN_P:RTEPHN_P),		RTEPHN),
	  209:		1 (RTEBUF(RTEPWD_P:RTEPWD_P),		RTEPWD),
	  210:		1 (RTEBUF(RTECSW_P:RTECSW_P),		RTECSW),
	  211:		1 (RTEBUF(RTESTA_P:RTESTA_P),		RTESTA),
	  212:		1 (RTEBUF(RTESDA_P:RTESDA_P),		RTESDA),
	  213:		1 (RTEBUF(RTERFL_P:RTERFL_P),		RTERFL),
	  214:		1 (RTEBUF(RTETAC_P:RTETAC_P),		RTETAC)
	  215:		EQUIVALENCE
	  216:		1 (RTEBUF(RTETN1_P:RTETN1_P),		RTETN1),
	  217:		1 (RTEBUF(RTETA1_P:RTETA1_P),		RTETA1),
	  218:		1 (RTEBUF(RTETN2_P:RTETN2_P),		RTETN2),
	  219:		1 (RTEBUF(RTETA2_P:RTETA2_P),		RTETA2),
	  220:		1 (RTEBUF(RTETN3_P:RTETN3_P),		RTETN3),
	  221:		1 (RTEBUF(RTETA3_P:RTETA3_P),		RTETA3),
	  222:		1 (RTEBUF(RTEBID_P:RTEBID_P),		RTEBID),
	  223:		1 (RTEBUF(RTECHP_P:RTECHP_P),		RTECHP),

	  ARCScomm/Phoenix Detail Design                                              Page B56
	  Appendix B: Source Code - 16) ROUTEMST.INC


	  224:		1 (RTEBUF(RTESWF_P:RTESWF_P),		RTESWF),
	  225:		1 (RTEBUF(RTEDDA_P:RTEDDA_P),		RTEDDA),
	  226:		1 (RTEBUF(RTEEXP_P:RTEEXP_P),		RTEEXP),
	  227:		1 (RTEBUF(RTEBKG_P:RTEBKG_P),		RTEBKG),
	  228:		1 (RTEBUF(RTEMBC_P:RTEMBC_P),		RTEMBC),
	  229:		1 (RTEBUF(RTEBIX_P:RTEBIX_P),		RTEBIX),
	  230:		1 (RTEBUF(RTE_STATUS_P:RTE_STATUS_P),	RTE_STATUS),
	  231:		1 (RTEBUF(RTE_TSTRGN_P:RTE_TSTRGN_P),	RTE_TSTRGN),
	  232:		1 (RTEBUF(RTECOS_P:RTECOS_P),		RTECOS),
	  233:		1 (RTEBUF(RTECOT_P:RTECOT_P),		RTECOT),
	  234:		1 (RTEBUF(RTEUDI_P:RTEUDI_P),		RTEUDI)
	  235:		EQUIVALENCE
	  236:		1 (RTEBUF(RTETFS_P:RTETFS_P),		RTETFS),
	  237:		1 (RTEBUF(RTETFR_P:RTETFR_P),		RTETFR),
	  238:		1 (RTEBUF(RTESYS_P:RTESYS_P),		RTESYS),
	  239:		1 (RTEBUF(RTEDIR_P:RTEDIR_P),		RTEDIR),
	  240:		1 (RTEBUF(RTEDCR_P:RTEDCR_P),		RTEDCR),
	  241:		1 (RTEBUF(RTEDUP_P:RTEDUP_P),		RTEDUP)
	  242:	
	  243:	C ------------------------- End ROUTEMST.INC -------------------------

	  ARCScomm/Phoenix Detail Design                                              Page B57
	  Appendix B: Source Code - 17) VMSMSG.C


	    1:	/****************************************************************************
	    2:	 *
	    3:	 * Function:	vmsmsg
	    4:	 *
	    5:	 * Purpose:	Returns text of VMS message corresponding to SS$_status.
	    6:	 *
	    7:	 * Call:	vmsmsg ( vms_stat )
	    8:	 *
	    9:	 * Arguments:
	   10:	 *		vms_stat (I)	int SS$_ status.
	   11:	 *
	   12:	 * Returns:	(char *)	address of char string containing message.
	   13:	 *		
	   14:	 * Source:	VMSMSG.C
	   15:	 *
	   16:	 * --------------------------------------------------------------------------
	   17:	 * Revision History:
	   18:	 *
	   19:	 * 12/11/85	J.Forkosh	Installation.
	   20:	 *
	   21:	 ****************************************************************************/
	   22:	
	   23:	#include descrip
	   24:	
	   25:	char *vmsmsg (vms_stat)
	   26:	int vms_stat;
	   27:	{
	   28:	/* -------------------------------------------------------------------------
	   29:	Allocations and Declarations
	   30:	-------------------------------------------------------------------------- */
	   31:	static	char msgbuf[256];			/* VMS error message buffer */
	   32:	int	msglen;					/* message length */
	   33:	struct	dsc$descriptor_s			/* message descriptor */
	   34:		msg_desc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &msgbuf[0] };
	   35:	char	outadr[4];				/* dummy getmsg array */
	   36:	
	   37:	/* -------------------------------------------------------------------------
	   38:	Issue $getmsg and print message
	   39:	-------------------------------------------------------------------------- */
	   40:	msg_desc.dsc$w_length = 255;				/* Init msg length */
	   41:	sys$getmsg(vms_stat, &msglen, &msg_desc, 0xF, outadr );	/* 0xF for full msg */
	   42:	if (msglen > 255) msglen=255;				/* max msg size */
	   43:	msgbuf[msglen] = '\0';					/* null-terminate it */
	   44:	return ( msgbuf );					/* and go home */
	   45:	}

Copyright © 1986-2000, John Forkosh Associates, Inc.   All rights reserved.
email: john@forkosh.com