.flags capitalize .left margin 5 .right margin 70 .subtitle .autosubtitle 1 .figure 12 .center;R E M T A B .blank 2 .center;REMOTE TABLE HANDLING ROUTINES .blank 2 .center;USER DOCUMENTATION .blank 25 .center;Version 2.0 .blank .center;September, 1988 .page .title REMOTE TABLE HANDLING PROCEDURES .subtitle TABLE OF CONTENTS .require "REMTAB.RNT" .chapter INTRODUCTION .hl 1 What is REMTAB? REMTAB is a collection of routines written in VAX COBOL and MACRO that were designed to ease the task of dealing with static and semi-static data definitions that are used by multiple programs. These routines were developed by TERADYNE, Inc. in conjunction with a VAX DBMS application which is now used by Teradyne's Customer Service Organization. .blank Early on in the development cycle of the system we determined that there would be certain types of data that we would need to maintain that would not require any or would require very little in the way modifications. We quickly learned that a DBMS database was not the kind of place to be storing these small data sets. We experimented with the idea of having separate RMS files for each table and decided that this too was not going to suffice. In both cases the overhead involved in loading the tables was too costly. In certain programs up to ten different tables would need to be loaded and in the case of the RMS file idea the amount of time invloved in simply opening each of the separate table files was sufficient enough that we decided to look at other alternatives. .blank The Remote Table concept soon started to evolve. Our first attempts were much better than the RMS file concept but it was still taking too long to load all of the tables required by certain programs. The subroutine that loaded the tables was written in COBOL and we determined that this was likely part of the problem. After scrapping the table loader module and rewritting it in VAX MACRO we noticed a considerable improvement over the prior version. Finally we has something we could use. .hl 1 TABLE FILE FORMAT The actual table files are defined as RMS relative files with variable length records. The beginning of the file contains a series of header records that are used to describe the tables that are stored in this particular table file. The format of a header record takes the following form: .literal /TABLE ttttt ssss nnnn .end literal Where "ttttt" is the table name, "ssss" is the starting relative key of the table within the file, and "nnnn" is the number of entries in the table. Following is an example of the header records for a given table file. .literal /TABLE ACTCD 0006 0034 /TABLE CNTRY 0040 0055 /TABLE CRNCY 0095 0019 /TABLE SBSYS 0114 0051 /TABLE SERVI 0165 0007 .end literal .page The REMTAB system is broken down into five modules: .list .le;REMTAB.EXE# -- The table maintenance program. .blank .left margin 23 This program, written in VAX COBOL, handles all of the maintenance functions required for the table files. It allows you to add new entries to tables, change or delete existing entries, delete entire tables, and also has the capability to import and export tables entries from and to sequential RMS files. .left margin 9 .le;LOADTABLE.OBJ# -- The table loading module. .blank .left margin 23 This subroutine, written in VAX MACRO, handles the loading of tables at run-time for the calling program. You simply specify the table file to be used, the tables you want loaded, and where to put the table entries in memory. .left margin 9 .le;SHOWTAB.EXE -- The table inquiry program. .blank .left margin 23 This program, also written in VAX COBOL, can be used to examine the contents of particular tables. The screen is formatted in such a way that makes it easy to visualize the table contents. It also has the ability to select only certain entries within the table to be displayed based on user supplied selection criteria. .left margin 9 .le;LISTTAB.EXE -- The remote table lister program. .blank .left margin 23 This program is similar to SHOWTAB in regards to the type of output that it generates, the major difference being that it creates a printable file which contains all of the table entries for all tables that are currently defined. .left margin 9 .le;REMTABLIB.EXE -- The remote table library generator program. .blank .left margin 23 This program can be used to generate a default set of library modules that can be incorporated into COBOL programs via the COBOL COPY statement to define the table in the WORKING-STORAGE SECTION and load it in the PROCEDURE DIVISION. .left margin 9 .els Each of these modules is described in detail over the rest of this document. The flowchart on the following page illustrates the interaction between the various program modules and files that comprise the REMTAB system, and the users application. .page .hl 1 REMTAB System Flowchart .figure 30 .page .chapter TABLE DEFINITIONS Before you can make use of the REMTAB programs for maintaining and loading tables you must first define what these tables are and what information will be stored within them. This is done by creating a file called REMTAB.DEF and placing the table definitions in it. The format of this file is described below and an example can be found in Appendix A. .hl 1 DEFINING TABLES There are basically two different types of definitions to be found in REMTAB.DEF. The first is used to define an actual table and takes the form: .literal *{table description},{table name},{table file} .end literal The asterick at the beginning of the line is required and identifies this as a new table definition. The {table description} is a brief (up to 30 character) description of the table. The {table name} is the name that will be used to refer to the table when changing, loading or looking at the table. The {table file} is the name of the RMS file that will be used to store the table entries for this table. An example of a table definition entry would be: .literal *ACTIVITY CODE TABLE,ACTCD,TABLES.DAT .end literal .hl 1 DEFINING TABLE ELEMENTS The other type of definition to be found in REMTAB.DAT is that of a table element definition. This definition takes the form of: .literal {element name} {element type} {size} [{decimal}] [KEY] .end literal The {element name} is the name that will be used to refer to this particular data item within the table as well as within the COBOL programs that will use the table. It should be no more than 31 characters in length and should follow the normal naming conventions for COBOL variable names. .blank The {element type} identifies the data class for the data item and can have one of two values: "C" for character (i.e. alphanumeric) data or "N" for numeric data. .blank The {size} is the total length in bytes of the data item. .blank The optional {decimal} parameter specifies the number of decimal places after the decimal point for numeric data items. .blank The KEY parameter is used to identify this data element as part of the key to the table. Whenever making changes to table entries you must first supply the key to the entry that you wish to change. Duplicate key values are allowed within a given table. When making changes to the table you will be given the option of changing any table entries that match the specified key. All tables must have at least one KEYed data item and all KEYed data items must be definied before any non-KEYed data items. An example of a couple of table element definitions would be: .literal ACTIVITY_CODE C 3 KEY ACTIVITY_DESCRIPTION C 20 .end literal Once you have defined what the tables will look like you can then start the process of entering and maintaining the tables, which will be discussed in the next chapter. It should be noted at this point that once a table has been defined and table entries have been added to it that you should be very careful should you decide to alter the definition of the table. Adding additional data items to the end of a table is perfectly accceptable but under no condition should you change the {size} or {decimal} attributes for a given data item. Should you need to do this, you should first export the table to a sequential RMS file, make the necessary changes to REMTAB.DEF, edit the contents of the exported file to match the new definition and then import the table back into the table file. .page .chapter THE TABLE MAINTENANCE PROGRAM .hl 1 STARTING REMTAB The table maintenance program, REMTAB, is used to make changes to table entries in tables within a given table file. Assuming you have a DCL symbol defined as REMTAB that points to the executable you can use the following command to start REMTAB: .literal $ REMTAB [/TABLE_FILE={table file spec}] [{command file spec}] .end literal If you omit the /TABLE__FILE qualifier a default table file of REMTAB.DAT is assumed. If you include the optional {command file spec}, commands used to alter the table file will be read from this file, otherwise you will be prompted for commands at the keyboard. .hl 1 ONE REMTAB PER TABLE FILE The first thing that REMTAB does when it starts is to make sure that no one else is currently changing the table file that you have specified. To do this it scans the system processes looking for a process with a process name of "REMTAB__{table file name}". If you had specified "COOKIE.DAT" as the {table file spec} then REMTAB would look for a process named "REMTAB__COOKIE". If it finds one the following message is displayed on your terminal: .literal %REMTAB-F-INUSE, Already in use by someone else, try again later... .end literal You are then denied access to the program and are returned to DCL command level. Only one person can change the entries in a table file at any one time. If no one else is currently changing the table file then your process name is modified to indicate that you are changing the table and on one else can. .blank Note that because REMTAB attempts to get information about other processes on the system it should either be run by users that have WORLD privilege enabaled or it should be installed with WORLD privilege. .hl 1 REMTAB OPTIONS Once you have gained access to the table file that you wish to change, REMTAB will begin loading the contents of this table file into memory. This is done so that you have your own copy of the data that can be changed as a whole while other users can still view the existing data without having to worry about partial changes that you may have made. When you exit from REMTAB the table file is written out under an new name and then renamed to replace the prior version. .blank Once the table has ben loaded into memory you will be prompted for a REMTAB option. Typing "HELP" at this point will produce the following list: .literal Enter one of the following: A or ADD to add an element to a table C or CHANGE to change an element in a table D or DELETE to delete an element from a table I or INQUIRE to look at a table element L or LIST to list all elements for a table IM or IMPORT to import from a RMS file EX or EXPORT to export to a RMS file ER or ERASE to erase all elements for a table H or Help to get this list V or Valid to list valid table codes and descriptons T or Tables to list only those that exist in this file E or End to end this program and write new table file Q or Quit to end this program without writing new file .end literal .hl 2 The ADD option The ADD option is used to add entries to a given table. After entering "ADD" at the option prompt you will first be prompted for the name of the table that you wish to add an entry to. If the table name that you supply cannot be found in the REMTAB.DEF file an error message will be displayed and you will be returned to the option prompt. Assuming you enter a valid table name you will be prompted for all of the data items in the table that are specified as KEY fields for the table. Once you have supplied all of the KEY values REMTAB will look at the table to see if an entry aleady exists with the key value. If one does the following message will appear: .literal %Key value exists in table... %Add it anyway? .end literal You should respond with "NO" if you do not want duplicate table entries in this table or "YES" if duplicate entries are to be allowed. .blank After checking for duplicates based on the KEYed data items the program will prompt you for the rest of the data items for the table and will then ask if it is OK to add the new element to the table. You should respond with "YES" to add the new element or "NO" to abort the ADD operation and return to the option prompt. .hl 2 The CHANGE option The CHANGE option is similar to the ADD option in that it will prompt for the name of the table and the KEY data items first. It will then scan the table entries looking for a match on those KEYed items. If it doesn't find any it will display an error message and return to the option prompt. Any matches that are found are displayed and you are given the option of changing them when the following prompt is displayed: .literal Change this entry? .end literal If you do not want to change the displayed entry simply enter "NO" and the program will continue to scan the table looking for other matches for the KEYed data items. If you do want to change the displayed entry enter "YES" and you will be prompted for new values for all of the data items in the entry. To leave the value for a particular data item alone simply press ENTER or RETURN. To change the value of an alphanumeric data item to spaces enter " " (quote,space,quote). .hl 2 The DELETE option The DELETE option is similar to the CHANGE option except that once the KEYed matches are displayed you are given the option of deleting them or leaving the alone. .hl 2 The INQUIRE option The INQUIRE option behaves just like CHANGE and DELETE except that the KEYed matches are only displayed on your terminal. .hl 2 The LIST option The LIST option can be used to display all of the entries for a given table. You are prompted for the table name and then you either get an error message if table name cannot be found in the current table file or the table is displayed on your terminal. .hl 2 The IMPORT option The IMPORT option allows you to add table entries to a table file from a sequential RMS file. You will be prompted for the name of the file from which the import will be done. The file to be imported should have the table name to which an entry should be added coded in the first five character positions of each line. The rest of the line represents the contents of the data items for the table and should match the table definition in REMTAB.DEF. .hl 2 The EXPORT option The EXPORT option is the counterpart of the IMPORT option. You will be prompted for the name of the table that you wish to export and then the name of a file to write the exported table entries to. .hl 2 The ERASE option The ERASE option allows you to delete all of the table entries for a given table at once. You are prompted for the table name only. .hl 2 The "Help" option The "Help" option displays a list of valid options. .hl 2 The "Valid" option The "Valid" option will display a list of valid table names. Tables names are prefixed with an asterick if they do not contain any entries within the particular table file that you are editing. .hl 2 The "Tables" option The "Tables" option is similar to the "Valid" option except that only tables that have entries in the current table file are displayed. .hl 2 The "End" option The "End" option causes REMTAB to write the internal table back out to disk and returns you to DCL level. The new table file is first written out to a file called {table file name}.NEW and is then renamed to the original {table file spec}. This is done to avoid any conflicts with other users that may be looking at the existing table while you are creating a new version. .hl 2 The "Quit" option The "Quit" command forgets all of the changes that you have made to the current table by returning you to DCL level without writing a new version of the table file. .chapter THE TABLE LOADING MODULE .hl 1 CALLING SEQUENCE The table loading module, LOADTABLE, is called in the following way: .literal CALL "LOADTABLE" USING BY DESCRIPTOR "{table file name}", BY DESCRIPTOR "{table 1 name}", BY REFERENCE {table 1 location}, {table 1 entry size}, {table 1 maximum entries}, {table 1 count} BY DESCRIPTOR "{table 2 name}", BY REFERENCE {table 2 location}, {table 2 entry size}, {table 2 maximum entries}, {table 2 count} . . . GIVING {return status}. .end literal The {table file name} is specified only once and must be the first parameter passed to LOADTABLE. All of the tables to be loaded by this call to LOADTABLE must exist in this table file. If it is omitted a default table file name of REMOTE$TABLES:REMTAB.DAT is assumed. The rest of the parameters repeat for as many table as you need to load. .blank The {table name} parameter specifies the name of the table to load as defined in REMTAB.DEF. .blank The {table loaction} parameter specifies the starting location (address) in the WORKING-STORAGE SECTION to start loading the table. .blank The {table entry size} parameter specfies the total length in bytes for one entry of the table and should be defined as a PICTURE 9(3) COMPUATIONAL data item. .blank The {maximum entries} parameter specifies the maximum number of entries that can be loaded into the table. This is typically the same value that is used in the OCCURS clause that is used to define the table in your COBOL program. .blank The {table count} parameter is used by LOADTABLE to return the number of actual table entries that were loaded into this particular table. A value of zero indicates that no table entries for this table exist in the specified table file. .blank The {return status} parameter is used to return the final completion status of the LOADTABLE call. It should be tested by including an "IF {return status} IS FAILURE ..." statement immeditately following the LOADTABLE call. .hl 1 EXAMPLE .literal WORKING-STORAGE SECTION. 01 WS-ENTRY-SIZE PIC 9(3), COMP, VALUE 28. 01 WS-MAX-ENTRY PIC 9(3), COMP, VALUE 100. 01 WS-TABLE. 02 WS-ENTRY OCCURS 100 TIMES. 03 ACTIVITY-CODE PIC X(3). 03 ACTIVITY-DESCRIPTION PIC X(20). 03 CUSTOMER-REQUIRED PIC X(1). 03 SYSTEM-REQUIRED PIC X(1). 03 SUPPORT-FLAG PIC X(1). 03 GROUP-FLAG PIC X(1). 03 ACTIVE-FLAG PIC X(1). 01 WS-COUNT PIC S9(3), COMP. 01 STAT PIC S9(8), COMP. PROCEDURE DIVISION. CALL "LOADTABLE" USING BY DESCRIPTOR "TABLES.DAT" "ACTCD", BY REFERENCE WS-TABLE, WS-ENTRY-SIZE, WS-MAX-ENTRY, WS-COUNT GIVING STAT. IF STAT IS FAILURE DISPLAY "ACTCD TABLE COOULD NOT BE LOADED!". .end literal .hl 1 USING COPY STATEMENTS The REMTABLIB program, which is described in Chapter 7, will generate both the WORKING-STORAGE SECTION entries necessary to define the tables and the PROCEDURE DIVISION entries used to load them. Samples of these COPYable files are included in Appendix B. .chapter THE TABLE INQUIRY PROGRAM .hl 1 COMMAND FORMAT The table inquiry program, SHOWTAB, allows you to display all or part of the contents of a table at your terminal without having to get into REMTAB and tie up the whole table file. Assuming you have a DCL symbol defined as SHOWTAB that points to the executable, the format of the command line to execute SHOWTAB is as follows: .literal $ SHOWTAB [ /TABLE_FILE={table file name} ] {table name} [ /SELECT=({table item},{relation},{value}) ] [ /OR ] .end literal The /TABLE__FILE qualifier is optional and if omitted SHOWTAB will use the table file name that is defined for the table in the REMTAB.DEF table definition file. .blank The {table name} is the only required parameter and specifies the name of the table to be displayed. .blank The /SELECT qualifier allows you to narrow down the scope of the table entries to be displayed by including only those table entries that match certain selection criteria. To use the /SELECT qualifier you must supply the {table item} which you wish to test, a {relation} to test with, and a {value} to test against. The following values are valid for the {relation}: .list .le;EQ - test for {table item} equal to {value} .le;NE - test for {table item} not equal to {value} .le;GT - test for {table item} greater than {value} .le;GE - test for {table item} greater than or equal to {value} .le;LT - test for {table item} less then {value} .le;LE - test for {table item} less than or equal to {value} .le;ST - test for {table item} starts with {value} for alphanumeric items .le;CT - test for {table item} contains {value} for alphanumeric items .els .blank The /OR qualifier is used to break the normal sequence of /SELECT qualifier processing. In order for a table entry to qualify for being displayed all specified selection criteria must be met. If more than one group of selection criteria are to be used they must be separated by /OR qualifiers. For example: .literal $ SHOWTAB ACTCD /SELECT=(ACTIVITY_CODE,EQ,A) - /OR /SELECT=(ACTIVITY_CODE,EQ,B) - /OR /SELECT=(ACTIVITY_CODE,EQ,C) .end literal .hl 1 OUTPUT FORMAT After terminating your SHOWTAB command the program starts up and attempts to parse the command line that you have supplied. A number of errors can occur at this point, namely if the {table file} or {table name} do not exist or cannot be found. Additionally if you have specified any selection criteria you may get an error if you specified an unknown {table item} or an invalid {relation} or {value}. .blank Assuming that the command can be parsed, SHOWTAB will format the screen to display the table. The table name, description and table file spec are displayed at the top right hand corner of the screen. Starting at the left column and proceeding across and downwards the table data item names are displayed with bars pointing to thier starting positions in the acual table entry display portion. Once the header information is completed the rest of screen is defined to be a scrolling region and the contents of the table that you have requested is displayed in it. Upon completion of the program the total number of entries in the table is displayed along with the total number that matched the selection criteria if you had specified any. Sample output from SHOWTAB can be found in Appendix C. .chapter THE TABLE LISTER PROGRAM .hl 1 WHAT IS IT? The remote table lister program, LISTTAB, generates a set of printable reports containing the contents of your table files. The output format is similar to that obtained with SHOWTAB. A separate report file is created for each table file and within each file the tables are sorted alphabetically by table name. Page breaks are done for each table and at the end of each page should a table have more entries than can fit on one page. .blank To run LISTTAB, assuming you have a symbol defined to point to it, is simply a matter of typing it's name at DCL command level. When it starts it first creates a work file which contains the table file ids as well as the table names that are contained within them. This is then sorted and used to produce the actual report files. The report files will have the same filename as the table file but with a file type of ".RPT". .chapter THE REMOTE TABLE FILE LIBRARY GENERATOR .hl 1 WHAT IS IT? The remote table file library generator program, REMTABLIB, provides a simplified means for keeping your remote table defintions and table files syncronized with your COBOL programs. It produces source code that can be included in the WORKING-STORAGE SECTION and PROCEDURE DIVISION of your program based on the tables you have selected to generate and the contents of REMOTE$TABLES:REMTAB.DEF. .hl 1 HOW TO RUN IT Assuming you have a DCL symbol defined as REMTABLIB that points to the executable you ran start it by simply typing REMTABLIB. When it starts it will open up REMOTE$TABLES:REMTAB.DEF and parse the table definitions for all of the tables in it. It will then prompt you for the names of the tables that you wish to generate the library files for. You should enter one table name on each line and enter "END" after you have entered them all. Typing "HELP" will produce the following text: .literal Enter the name of a table to generate library entries for Type ALL for all tables Type LIST for a list for table names Type END when done with selections Type HELP for this .end literal Additionally you can enter "ALL" to generate library files for all of the tables defined in REMTAB.DEF. You can also enter "LIST" to list the names of the tables in the definition files. .blank Once you have entered all of of the table names and have entered "END", the program will go off and generate the library files for all of the tables you have selected. Two files will be generated for each table which you have selected. The first, "{table name}TAB.TXT", is the WORKING-STORAGE SECTION entry that defines the table for your program. The other one, "{table name}LOD.TXT", is used in the PRODEDURE DIVISION to supply the necessary values to the LOADTABLE call to load the tables. Samples of these files can be found in Appendix B. .hl 1 KEEPING LIBRARY ENTRIES IN A TEXT LIBRARY At the same time as it is creating the actual library files, REMTABLIB also create a DCL command file called LIBUPD.COM which can be used to update the contents of a VMS text library with the new versions of the table definitions and load calls. To execute this command file after REMTABLIB has terminated you simply type: .literal $ @LIBUPD {text library file spec} .end literal Note that if you include the modules in a text library the format of COPY statements given in the following section must be altered to include IN or OF "{text library file spec}" following the COPY "{library entry}" phrase. .hl 1 COPYING LIBRARY ENTRIES INTO YOUR COBOL PROGRAM To include the generated libraries into your COBOL program you should place all of the COPY statements for the actual table definitions somewhere in your WORKING-STORAGE SECTION. For example: .literal WORKING-STORAGE SECTION. COPY "ACTCDTAB.TXT". COPY "CNTRYTAB.TXT". . . . .end literal You then have to format the LOADTABLE call as such to actually get the tables loaded in the PROCEDURE DIVISION. For example: .literal PROCEDURE DIVISION. 0000-MAIN-PROGRAM SECTION. 0001-INIT. CALL "LOADTABLE" USING BY DESCRIPTOR "TABLES.DAT" COPY "ACTCDLOD.TXT". COPY "CNTRYLOD.TXT". GIVING STAT. .end literal And that's all there is to it. The first parameter "TABLES.DAT" specifies the name of the table file to use to load the tables that follow it. You must specify this parameter yourself as it is only specified once and all of the following parameters apply to it. .appendix SAMPLE REMOTE$TABLES:REMTAB.DEF FILE .literal *ACTIVITY CODE TABLE,ACTCD,TABLES.DAT ACTIVITY_CODE C 3 KEY ACTIVITY_DESCRIPTION C 20 CUSTOMER_REQUIRED C 1 SYSTEM_REQUIRED C 1 SUPPORT_FLAG C 1 GROUP_FLAG C 1 ACTIVE_FLAG C 1 BILLABLE_FLAG C 1 *COUNTRY CODE TABLE,CNTRY,TABLES.DAT COUNTRY_CODE N 3 KEY COUNTRY_OFFICE C 4 COUNTRY_NAME C 15 CURRENCY_NAME C 15 EXCHANGE_RATE N 10 7 PRICE_LIST_EXCH_RATE N 10 7 PRICE_LIST_ZONE C 2 STD_EXCHANGE_NO C 10 STD_EXCHANGE_EXP_DATE N 6 EXPORT_WARRANTY_FLAG C 1 *CURRENCY CODE TABLE,CRNCY,TABLES.DAT CURRENCY_CODE C 2 KEY CURRENT_FUTURE_FLAG C 1 KEY CURRENCY_NAME C 20 EXCHANGE_RATE N 10 7 PRICE_ZONE C 2 ROUNDING_FACTOR N 4 2 *MENU SUBSYSTEM TABLE,SBSYS,TABLES.DAT MENU_SUBSYSTEM_SHORT C 5 KEY MENU_SUBSYSTEM_LONG C 30 MENU_SUBSYSTEM_CLASS C 3 *SERVICE TYPE TABLE,SERVI,TABLES.DAT SERVICE_TYPE C 4 KEY SERVICE_DESCRIPTION C 20 IMMEDIATE_SHIP_FLAG C 1 DUE_DAYS_FROM_CUST N 2 SERVICE_PRIORITY N 2 PACKING_SLIP_TYPE C 1 DEFAULT_SHIP_CARRIER C 6 DEFAULT_SHIP_SERVICE C 7 OBSOLETE_SERVICE_FLAG C 1 INSTALLED_BASE_REQUIRED C 1 REPLENISHMENT_TYPE C 1 .end literal .appendix SAMPLE LIBRARY FILES CREATED BY REMTABLIB .literal ----------------------- WORKING-STORAGE SECTION library ------------------------ ******************************************************************************** ** ** ** A C T I V I T Y C O D E T A B L E ** ** ** ******************************************************************************** 01 ACTCD-ENTRY-SIZE PICTURE 9(3), COMP, GLOBAL, VALUE 28. 01 ACTCD-MAX-ENTRY PICTURE 9(3), COMP, GLOBAL, VALUE 100. 01 ACTCD-TABLE, GLOBAL. 02 ACTCD-ENTRY OCCURS 100 TIMES INDEXED BY ACTCD-IDX. 03 ACTIVITY-CODE PICTURE X(3). 03 ACTIVITY-DESCRIPTION PICTURE X(20). 03 CUSTOMER-REQUIRED PICTURE X(1). 03 SYSTEM-REQUIRED PICTURE X(1). 03 SUPPORT-FLAG PICTURE X(1). 03 GROUP-FLAG PICTURE X(1). 03 ACTIVE-FLAG PICTURE X(1). 01 ACTCD-COUNT PICTURE S9(3), COMP, GLOBAL. 88 ACTCD-LOAD-FAILED VALUE -1. .end literal .literal -------------------------- PROCEDURE DIVISION library -------------------------- BY DESCRIPTOR "ACTCD", BY REFERENCE ACTCD-TABLE, ACTCD-ENTRY-SIZE, ACTCD-MAX-ENTRY, ACTCD-COUNT .end literal .page .literal ----------------------- WORKING-STORAGE SECTION library ------------------------ ******************************************************************************** ** ** ** C O U N T R Y C O D E T A B L E ** ** ** ******************************************************************************** 01 CNTRY-ENTRY-SIZE PICTURE 9(3), COMP, GLOBAL, VALUE 76. 01 CNTRY-MAX-ENTRY PICTURE 9(3), COMP, GLOBAL, VALUE 100. 01 CNTRY-TABLE, GLOBAL. 02 CNTRY-ENTRY OCCURS 100 TIMES INDEXED BY CNTRY-IDX. 03 COUNTRY-CODE PICTURE 9(3). 03 COUNTRY-OFFICE PICTURE X(4). 03 COUNTRY-NAME PICTURE X(15). 03 CURRENCY-NAME PICTURE X(15). 03 EXCHANGE-RATE PICTURE 9(3)V9(7). 03 PRICE-LIST-EXCH-RATE PICTURE 9(3)V9(7). 03 PRICE-LIST-ZONE PICTURE X(2). 03 STD-EXCHANGE-NO PICTURE X(10). 03 STD-EXCHANGE-EXP-DATE PICTURE 9(6). 03 EXPORT-WARRANTY-FLAG PICTURE X(1). 01 CNTRY-COUNT PICTURE S9(3), COMP, GLOBAL. 88 CNTRY-LOAD-FAILED VALUE -1. .end literal .literal -------------------------- PROCEDURE DIVISION library -------------------------- BY DESCRIPTOR "CNTRY", BY REFERENCE CNTRY-TABLE, CNTRY-ENTRY-SIZE, CNTRY-MAX-ENTRY, CNTRY-COUNT .end literal .appendix SAMPLE SHOWTAB OUTPUT .literal $ SHOWTAB SERVI -------------------------------------------------------------------------------- SERVICE_TYPE SERVI - SERVICE TYPE TABLE : TABLES.DAT | SERVICE_DESCRIPTION | | IMMEDIATE_SHIP_FLAG | | | DUE_DAYS_FROM_CUST | | | | SERVICE_PRIORITY | | | | | PACKING_SLIP_TYPE | | | | | | DEFAULT_SHIP_CARRIER | | | | | | | DEFAULT_SHIP_SERVICE | | | | | | | | OBSOLETE_SERVICE_FLAG | | | | | | | | | INSTALLED_BASE_REQUIRED | | | | | | | | | | REPLENISHMENT_TYPE | | | | | | | | | | | ECAL EMERG. CALIBRATION O 30 30 D EMERY N Y EMS EMERGENCY SERVICE O 14 10 D EMERY AM N Y S LABR ONSITE LABOR N Y P7 PLUS SEVEN R 30 20 D EMERY PM N Y S RR RETURN & REPAIR R 14 30 A U.P.S. N Y SCAL SCHED. CALIBRATION E 30 30 D EMERY N Y USL SALE @ U.S.LIST O 00 40 D EMERY N N 7 entries -------------------------------------------------------------------------------- .end literal .page .literal $ SHOWTAB CRNCY/SELECT=(CURRENT_FUTURE_FLAG,EQ,C) -------------------------------------------------------------------------------- CURRENCY_CODE CRNCY - CURRENCY CODE TABLE : TABLES.DAT | CURRENT_FUTURE_FLAG | | CURRENCY_NAME | | | EXCHANGE_RATE | | | | PRICE_ZONE | | | | | ROUNDING_FACTOR | | | | | | D C DOLLARS 001.0000000 US 01.00 F C FRANC 000.1060000 EU 01.00 K C KRONAS 000.1140000 EU 01.00 L C LIRA/1000 000.5000000 EU 01.00 M C MARKS 000.3240000 EU 01.00 P C POUNDS 001.2000000 EU 01.00 S C Singapore DOLLARS 001.0000000 AP 01.00 U C UNKNOWN 001.0000000 ** 00.00 W C WON 001.1900000 US 01.00 Y C YEN/100 000.6451612 JA 01.00 19 entries, 10 selected -------------------------------------------------------------------------------- .end literal .appendix DIRECTORIES, LOGICAL NAMES AND SYMBOLS In order for the system to be as simple to use as possible you should set up some logical names and symbols to point to the various pieces of it. First you should probably create a directory called [REMTAB] and put all of the necessary files into it. You should then use the DCL ASSIGN command to create the logical name REMOTE$TABLES to point to this directory: .literal $ ASSIGN/LOG DUA0:[REMTAB] REMOTE$TABLES .end literal Following that you should define symbols for REMTAB, SHOWTAB and REMTABLIB so that they can be executed simply by typing their names at DCL level. .literal $ REMTAB == "$REMOTE$TABLES:REMTAB" $ REMTABLIB == "$REMOTE$TABLES:REMTABLIB" $ SHOWTAB == "$REMOTE$TABLES:SHOWTAB" $ LISTTAB == "$REMOTE$TABLES:LISTTAB" .end literal Additionally you may want to install REMTAB itself with WORLD privileges so that it can check process names on the system. .literal $ INSTALL ADD REMOTE$TABLES:REMTAB/PRIV=WORLD .end literal