          SUBROUTINE
** Version# 43 - 10/25/2010 - 12:17pm - KRIVERA - main

*** Subroutine - OPEN.STANDARD.FILES
*-------------------------------------------------------------------------*
*** This subroutine opens all of our "standard" files to the equated
*** variables as defined in the AOFILES array in CC~EQUATES.  If the
*** variable FILES.ARE.OPEN$ is set to YES, it means we have already
*** loaded the file handles and we will simply return out.
***
*** NOTE: If a change is made to any file, make sure to run
*** UT.SETUP.OPEN.FILES.CTRL to get the most current list of open files
*** loaded into CONTROL~OPEN.FILES.AS.NAME.
*-------------------------------------------------------------------------*
*** There are no variables passed in or out of this routine
*-------------------------------------------------------------------------*
*** Common Variables: COMMON.INIT is called from this program
*-------------------------------------------------------------------------*

          IF FILES.ARE.OPEN$ THEN RETURN

          OPEN 'ABC.CODES'        TO ABCCFILE    ELSE
             FLNM = 'ABC.CODES'
             GOSUB EXIT.OPN
          END
          OPEN 'ABC.LOG'          TO ABCLFILE    ELSE
             FLNM = 'ABC.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'ABC.TRX'          TO ABCTFILE    ELSE
             FLNM = 'ABC.TRX'
             GOSUB EXIT.OPN
          END
          OPEN 'AD'               TO ADFILE      ELSE
             FLNM = 'AD'
             GOSUB EXIT.OPN
          END
          OPEN 'AD.DIR'           TO ADDIRFILE   ELSE
             FLNM = 'AD.DIR'
             GOSUB EXIT.OPN
          END
          OPEN 'AR'               TO ARFILE      ELSE
             FLNM = 'AR'
             GOSUB EXIT.OPN
          END
          OPEN 'BUY.GROUP'        TO BGRPFILE    ELSE
             FLNM = 'BUY.GROUP'
             GOSUB EXIT.OPN
          END
          OPEN 'BUY.LINE'         TO BLNEFILE    ELSE
             FLNM = 'BUY.LINE'
             GOSUB EXIT.OPN
          END
          OPEN 'BUY.LINE.BR'      TO BLBRFILE    ELSE
             FLNM = 'BUY.LINE.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'CHECK.XREF'       TO CHKXFILE    ELSE
             FLNM = 'CHECK.XREF'
             GOSUB EXIT.OPN
          END
          OPEN 'COMBO.GROUP'      TO CMBOFILE    ELSE
             FLNM = 'COMBO.GROUP'
             GOSUB EXIT.OPN
          END
          OPEN 'CONTROL'          TO CTRLFILE    ELSE
             FLNM = 'CONTROL'
             GOSUB EXIT.OPN
          END
          OPEN 'CONTROL.BR'       TO CTRBFILE    ELSE
             FLNM = 'CONTROL.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'DOCUMENTS'        TO DPAFILE     ELSE
             FLNM = 'DOCUMENTS'
             GOSUB EXIT.OPN
          END
          OPEN 'EDICT'            TO EDICTFILE   ELSE
             FLNM = 'EDICT'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY'           TO CUSFILE     ELSE
             FLNM = 'ENTITY'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY.BR.AUTH'   TO EBRAFILE    ELSE
             FLNM = 'ENTITY.BR.AUTH'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY.DYNAM'     TO ENTDFILE    ELSE
             FLNM = 'ENTITY.DYNAM'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY.LOG'       TO ELOGFILE    ELSE
             FLNM = 'ENTITY.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY.PN.IDS'    TO EPNFILE     ELSE
             FLNM = 'ENTITY.PN.IDS'
             GOSUB EXIT.OPN
          END
          OPEN 'ENTITY.TRX'       TO ETFILE      ELSE
             FLNM = 'ENTITY.TRX'
             GOSUB EXIT.OPN
          END
          OPEN 'EPID'             TO EPIDFILE    ELSE
             FLNM = 'EPID'
             GOSUB EXIT.OPN
          END
          OPEN 'ERR.LOGGER'       TO ERRFILE     ELSE
             FLNM = 'ERR.LOGGER'
             GOSUB EXIT.OPN
          END
          OPEN 'FILE.DEFINE'      TO FDFILE      ELSE
             FLNM = 'FILE.DEFINE'
             GOSUB EXIT.OPN
          END
          OPEN 'GENLED'           TO GLFILE      ELSE
             FLNM = 'GENLED'
             GOSUB EXIT.OPN
          END
          OPEN 'GENLED.TRANS'     TO GLTFILE     ELSE
             FLNM = 'GENLED.TRANS'
             GOSUB EXIT.OPN
          END
          OPEN 'GL.SYNC'          TO SYNCFILE    ELSE
             FLNM = 'GL.SYNC'
             GOSUB EXIT.OPN
          END
          OPEN 'HELP.DOC'         TO HDOCFILE    ELSE
             FLNM = 'HELP.DOC'
             GOSUB EXIT.OPN
          END
          OPEN 'HELP.INFO'        TO HELPFILE    ELSE
             FLNM = 'HELP.INFO'
             GOSUB EXIT.OPN
          END
          OPEN 'INITIALS'         TO INIFILE     ELSE
             FLNM = 'INITIALS'
             GOSUB EXIT.OPN
          END
          OPEN 'LEDGER'           TO LEDFILE     ELSE
             FLNM = 'LEDGER'
             GOSUB EXIT.OPN
          END
          OPEN 'LEDGER.CLOG'      TO LEDCLFILE   ELSE
             FLNM = 'LEDGER.CLOG'
             GOSUB EXIT.OPN
          END
          OPEN 'LEDGER.LOG'       TO LEDLFILE    ELSE
             FLNM = 'LEDGER.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'LEDGER.RENTAL'    TO RLEDFILE    ELSE
             FLNM = 'LEDGER.RENTAL'
             GOSUB EXIT.OPN
          END
          OPEN 'LPRICE.INDEX'     TO LPIFILE     ELSE
             FLNM = 'LPRICE.INDEX'
             GOSUB EXIT.OPN
          END
          OPEN 'MAINT.LOG'        TO MLOGFILE    ELSE
             FLNM = 'MAINT.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'MATRIX'           TO MXFILE      ELSE
             FLNM = 'MATRIX'
             GOSUB EXIT.OPN
          END
          OPEN 'MATRIX.DATES'     TO MXDFILE     ELSE
             FLNM = 'MATRIX.DATES'
             GOSUB EXIT.OPN
          END
          OPEN 'MD'               TO MDFILE      ELSE
             FLNM = 'MD'
             GOSUB EXIT.OPN
          END
          OPEN 'MENUS'            TO MENFILE     ELSE
             FLNM = 'MENUS'
             GOSUB EXIT.OPN
          END
          OPEN 'MESSAGES'         TO MSGFILE     ELSE
             FLNM = 'MESSAGES'
             GOSUB EXIT.OPN
          END
          OPEN 'MISC.DATA'        TO MISCFILE    ELSE
             FLNM = 'MISC.DATA'
             GOSUB EXIT.OPN
          END
          OPEN 'MISC.INDEX'       TO MIDXFILE    ELSE
             FLNM = 'MISC.INDEX'
             GOSUB EXIT.OPN
          END
          OPEN 'ORDER.QUEUE'      TO OQFILE      ELSE
             FLNM = 'ORDER.QUEUE'
             GOSUB EXIT.OPN
          END
          OPEN 'OVERRIDES.LOG'    TO OVRFILE     ELSE
             FLNM = 'OVERRIDES.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'PHANTOM.LOG'      TO PHLOGFILE   ELSE
             FLNM = 'PHANTOM.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'PHANTOM.STATUS'   TO PHSTFILE    ELSE
             FLNM = 'PHANTOM.STATUS'
             GOSUB EXIT.OPN
          END
          OPEN 'PLINE.BRCH'       TO PLNBFILE    ELSE
             FLNM = 'PLINE.BRCH'
             GOSUB EXIT.OPN
          END
          OPEN 'PRICE-GRP'        TO PGRPFILE    ELSE
             FLNM = 'PRICE-GRP'
             GOSUB EXIT.OPN
          END
          OPEN 'PRICE.LINE'       TO PLNEFILE    ELSE
             FLNM = 'PRICE.LINE'
             GOSUB EXIT.OPN
          END
          OPEN 'PRICE.LINE.BR'    TO PLBRFILE    ELSE
             FLNM = 'PRICE.LINE.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'PRICE.STEP'       TO PSTEPFILE   ELSE
             FLNM = 'PRICE.STEP'
             GOSUB EXIT.OPN
          END
          OPEN 'PRINT.LOG'        TO PLOGFILE    ELSE
             FLNM = 'PRINT.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'PRINT.QUEUE'      TO PQFILE      ELSE
             FLNM = 'PRINT.QUEUE'
             GOSUB EXIT.OPN
          END
          OPEN 'PRINT.REVIEW'     TO PRVWFILE    ELSE
             FLNM = 'PRINT.REVIEW'
             GOSUB EXIT.OPN
          END
          OPEN 'PRINTER.DEFINE'   TO PDFNFILE    ELSE
             FLNM = 'PRINTER.DEFINE'
             GOSUB EXIT.OPN
          END
          OPEN 'PROCURE.GROUP'    TO PROCFILE    ELSE
             FLNM = 'PROCURE.GROUP'
             GOSUB EXIT.OPN
          END
          OPEN 'PROCURE.GROUP.BR' TO PGBRFILE    ELSE
             FLNM = 'PROCURE.GROUP.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'PROCURE.QUEUE'    TO PROCQFILE   ELSE
             FLNM = 'PROCURE.QUEUE'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.BR'          TO PRDBFILE    ELSE
             FLNM = 'PROD.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.CALC.BR'     TO PRDCFILE    ELSE
             FLNM = 'PROD.CALC.BR'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.DYNAM'       TO PRDDFILE    ELSE
             FLNM = 'PROD.DYNAM'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.LOCS'        TO PLOCFILE    ELSE
             FLNM = 'PROD.LOCS'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.PRICE'       TO PPFILE      ELSE
             FLNM = 'PROD.PRICE'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.SERIAL'      TO PRDSFILE    ELSE
             FLNM = 'PROD.SERIAL'
             GOSUB EXIT.OPN
          END
          OPEN 'PROD.TRX'         TO PTXFILE     ELSE
             FLNM = 'PROD.TRX'
             GOSUB EXIT.OPN
          END
          OPEN 'PRODUCT'          TO PRDFILE     ELSE
             FLNM = 'PRODUCT'
             GOSUB EXIT.OPN
          END
          OPEN 'PRODUCT.RENTAL'   TO RENTFILE    ELSE
             FLNM = 'PRODUCT.RENTAL'
             GOSUB EXIT.OPN
          END
          OPEN 'PSUB'             TO PSUBFILE    ELSE
             FLNM = 'PSUB'
             GOSUB EXIT.OPN
          END
          OPEN 'PU.IDX'           TO PUIFILE     ELSE
             FLNM = 'PU.IDX'
             GOSUB EXIT.OPN
          END
          OPEN 'QUAL.CODES'       TO QCFILE      ELSE
             FLNM = 'QUAL.CODES'
             GOSUB EXIT.OPN
          END
          OPEN 'QUAL.LOG'         TO QLFILE      ELSE
             FLNM = 'QUAL.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'RECORD.LOCKS'     TO RLOCKFILE   ELSE
             FLNM = 'RECORD.LOCKS'
             GOSUB EXIT.OPN
          END
          OPEN 'REPORTS'          TO RPTFILE     ELSE
             FLNM = 'REPORTS'
             GOSUB EXIT.OPN
          END
          OPEN 'SPRC.PRICES'      TO SPPRCFILE   ELSE
             FLNM = 'SPRC.PRICES'
             GOSUB EXIT.OPN
          END
          OPEN 'SALES.TAX'        TO STAXFILE    ELSE
             FLNM = 'SALES.TAX'
             GOSUB EXIT.OPN
          END
          OPEN 'SHIP.VIAS'        TO SVIAFILE    ELSE
             FLNM = 'SHIP.VIAS'
             GOSUB EXIT.OPN
          END
          OPEN 'STATE.TAXES'      TO STATFILE    ELSE
             FLNM = 'STATE.TAXES'
             GOSUB EXIT.OPN
          END
          OPEN 'SVIEW'            TO SVIEWFILE   ELSE
             FLNM = 'SVIEW'
             GOSUB EXIT.OPN
          END
          OPEN 'SYNC.SERVERS'     TO SSVRFILE    ELSE
             FLNM = 'SYNC.SERVERS'
             GOSUB EXIT.OPN
          END
          OPEN 'TAX.CODES'        TO TAXFILE     ELSE
             FLNM = 'TAX.CODES'
             GOSUB EXIT.OPN
          END
          OPEN 'TERMS'            TO TERMSFILE   ELSE
             FLNM = 'TERMS'
             GOSUB EXIT.OPN
          END
          OPEN 'TERRITORY'        TO TERRFILE    ELSE
             FLNM = 'TERRITORY'
             GOSUB EXIT.OPN
          END
          OPEN 'TRACKING.LOG'     TO CLOGFILE    ELSE
             FLNM = 'TRACKING.LOG'
             GOSUB EXIT.OPN
          END
          OPEN 'WHSE.QUEUE'       TO WHQFILE     ELSE
             FLNM = 'WHSE.QUEUE'
             GOSUB EXIT.OPN
          END
          OPEN 'WORK.MISC'        TO WORKFILE    ELSE
             FLNM = 'WORK.MISC'
             GOSUB EXIT.OPN
          END
          OPEN 'XCH.RATES'        TO RATEFILE    ELSE
             FLNM = 'XCH.RATES'
             GOSUB EXIT.OPN
          END
          OPEN 'XFER.DATES'       TO XFDFILE     ELSE
             FLNM = 'XFER.DATES'
             GOSUB EXIT.OPN
          END
          OPEN 'ZIP'              TO ZIPFILE     ELSE
             FLNM = 'ZIP'
             GOSUB EXIT.OPN
          END

          * need to set PHANTOM.PROC before calling COMMON.INIT
          PHANTOM.PROC = NO
          IF (@TTY='phantom' OR @TTY='console') AND NOT(JAVA.PROC$) THEN
             PHANTOM.PROC = YES
          END

          COMMON.INIT

          IF NOT(PHANTOM.PROC) AND NOT(JAVA.PROC$) THEN
             IF OS.TYPE$#'NT' THEN
                GET.TTY.ID TTY.ID
                OPENSEQ TTY.ID TO DEVTTY ELSE
IN$$1:             INP.PROMPT '','Cannot Open : ':TTY.ID
                   OFF
                END
             END
          END

          FILES.ARE.OPEN$ = YES

          RETURN
*-------------------------------------------------------------------------*
EXIT.OPN: *** Error out from file opens

          PRINT
          PRINT
          PRINT
          PRINT "Error Opening File : ":FLNM
          PRINT "Call Eclipse Support Immediately!"
          PRINT

          VAR = ''
          PRINT HOLDOFF$
IN$$2:    INPUT VAR

          BEGIN CASE
          CASE VAR = 'DEBUG'
             DEBUG
          CASE VAR = 'CONT'
             PRINT BELL:; RETURN
          CASE OTHERWISE
             * end this session
             LOGOFF.ECLIPSE
          END CASE

          RETURN
!KRIVERA~10/25/10~12:17
