CFPRIME BEGREC                                                          BEGREC      1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*               Output Analysis Program for ETMSP (OAP)               *RIGHTE      4
C*               =======================================               *RIGHTE      5
C*                                                                     *RIGHTE     11
C*        copyright @(1993) Electric Power Research Institute          *RIGHTE     12
C*                                                                     *RIGHTE     13
C* EPRI reserves all rights in the software and associated             *RIGHTE     14
C* documentation as delivered. The software and its associated         *RIGHTE     15
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     16
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     17
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     18
C* of any changes or modifications to the software within two (2)      *RIGHTE     19
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     20
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     21
C* new designation sufficiently different from its then current        *RIGHTE     22
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     23
C* the current software as changed or modified.                        *RIGHTE     24
C*                                                                     *RIGHTE     25
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     26
C* directly from EPRI.                                                 *RIGHTE     27
C*                                                                     *RIGHTE     28
C* This program and supporting materials may be independently available*RIGHTE     29
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     30
C* distribution fee. The EPSC is a service of                          *RIGHTE     31
C*                                                                     *RIGHTE     32
C*                    Power Computing Company                          *RIGHTE     33
C*                    1930 Hi Line                                     *RIGHTE     34
C*                    Dallas, Tx 75207                                 *RIGHTE     35
C*                                                                     *RIGHTE     36
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     37
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     38
C*                                                                     *RIGHTE     39
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     40
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     41
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     42
C*    DOCUMENTATION; OR                                                *RIGHTE     43
C*                                                                     *RIGHTE     44
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     45
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     46
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     47
C*                                                                     *RIGHTE     48
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     49
C* THEREOF.                                                            *RIGHTE     50
C*                                                                     *RIGHTE     51
C***********************************************************************RIGHTE     52
      SUBROUTINE BEGREC(FILENA,LENF)                                    BEGREC      3
CD                                                                      BEGREC      4
CD                                                                      BEGREC      5
CD           THIS ROUTINE OPENS/CLOSES  THE RECORD FILE  WHERE          BEGREC      6
CD           THE USER'S INPUT KEY STROKES DURING AN INTERACTIVE         BEGREC      7
CD           OAP RUN SESSION ARE BEING RECORDED.                        BEGREC      8
CD                                                                      BEGREC      9
CD                                                                      BEGREC     10
CD           CALLING PARAMETERS :                                       BEGREC     11
CD                                                                      BEGREC     12
CD                     FILENA : CHARACTER STRING STORING THE RECORD FILEBEGREC     13
CD                     LENF   : LENGTH OF THE CHARACTER STRING          BEGREC     14
CD                                                                      BEGREC     15
C                                                                       BEGREC     16
      CHARACTER*50 FILENA                                               BEGREC     17
      INCLUDE 'SOAPC1.INS'                                              BEGREC     18
      CHARACTER*80 STRING,MSG                                           BEGREC     19
      CHARACTER*9 CDATE                                                 BEGREC     20
      CALL YYMMDD(CDATE)                                                BEGREC     21
C    .................................................................  BEGREC     22
C    : START RECORDING                                               :  BEGREC     23
C    :                                                               :  BEGREC     24
      IF(RECORD) THEN                                                   BEGREC     25
          WRITE(LOUT,5006)                                              BEGREC     26
      ELSE                                                              BEGREC     27
          IF(FILENA(1:1).EQ.' ') THEN                                   BEGREC     28
             MSG='Enter Name Of Recording File'                         BEGREC     29
             CALL PMTRED(LOUT,LIN,JERR,28,MSG,'REC',STRING)             BEGREC     30
             IF(JERR.LT.0)GOTO 1100                                     BEGREC     31
             LENFIL=LENS(STRING)                                        BEGREC     32
             FILENA(1:50)=STRING(1:50)                                  BEGREC     33
             IF(LENFIL.LE.0) GOTO 1100                                  BEGREC     34
          ELSE                                                          BEGREC     35
            LENFIL=LENF                                                 BEGREC     36
            STRING(1:LENFIL)=FILENA(1:LENFIL)                           BEGREC     37
          ENDIF                                                         BEGREC     38
          IREC=20                                                       BEGREC     39
                                                                        BEGREC     40
C  ...............................................................      BEGREC     41
C  : Parse parameter for a logical unit number                   :      BEGREC     42
      CALL PARSIU(FILENA,LENFIL,IU,LO)                                  BEGREC     43
      IF(IU.GT.0)THEN                                                   BEGREC     44
         STRING(1:LENFIL)=FILENA(1:LENFIL)                              BEGREC     45
         IREC=IU                                                        BEGREC     46
         LENFIL=LO                                                      BEGREC     47
      ENDIF                                                             BEGREC     48
C  :.............................................................:      BEGREC     49
                                                                        BEGREC     50
                                                                        BEGREC     51
          CALL OPENFI(IREC,STRING,LENFIL,IERR,'NEW',1)                  BEGREC     52
          IF(IERR.LT.0) GOTO 1100                                       BEGREC     53
C          OPEN(UNIT=IREC,FILE=STRING(1:LENFIL),ERR=1100,STATUS='NEW')  BEGREC     54
          WRITE(LOUT,5105)IREC                                          BEGREC     55
          RECORD=.TRUE.                                                 BEGREC     56
          WRITE(IREC,1111) CDATE,IREC                                   BEGREC     57
 1111     FORMAT('????????????????????????????????????????????????',/,  BEGREC     58
     1           '?     OAP KEYBOARD RESPONSE OUTPUT FILE        ?',/,  BEGREC     59
     1           '?     DATE : ',A9,/,                                  BEGREC     60
     1           '?     LOGICAL UNIT NUMBER : ',I2,/,                   BEGREC     61
     1           '????????????????????????????????????????????????',/,  BEGREC     62
     1           '?')                                                   BEGREC     63
          PROMPT='(ITOAP)'                                              BEGREC     64
          GOTO 1120                                                     BEGREC     65
C         ...................................                           BEGREC     66
C         ERROR ON OPENING RECORDING FILE :                             BEGREC     67
 1100     CONTINUE                                                      BEGREC     68
          RECORD=.FALSE.                                                BEGREC     69
          WRITE(LOUT,5120)                                              BEGREC     70
C         :................................:                            BEGREC     71
 1120     CONTINUE                                                      BEGREC     72
      ENDIF                                                             BEGREC     73
      RETURN                                                            BEGREC     74
C    :..................................................................BEGREC     75
      ENTRY ENDREC                                                      BEGREC     76
CD                                                                      BEGREC     77
CD     THIS ENTRY WRITES OUT MESSAGES ABOUT THE STATUS OF               BEGREC     78
CD     THE RECORDING SESSION                                            BEGREC     79
CD                                                                      BEGREC     80
      IF(RECORD) THEN                                                   BEGREC     81
         CLOSE(IREC)                                                    BEGREC     82
         RECORD=.FALSE.                                                 BEGREC     83
         PROMPT=' ITOAP '                                               BEGREC     84
         WRITE(LOUT,5110)                                               BEGREC     85
      ELSE                                                              BEGREC     86
         WRITE(LOUT,5100)                                               BEGREC     87
      ENDIF                                                             BEGREC     88
      RETURN                                                            BEGREC     89
C    :................................:                                 BEGREC     90
C 5001 FORMAT(//,1X,'ENTER NAME OF RECORDING FILE --> ',$)              BEGREC     91
 5006 FORMAT(/,                                                         BEGREC     92
     1  10X,'................................................',/,       BEGREC     93
     1  10X,':  -- RECORDING SESSION IS ALREADY ACTIVE --   :',/,       BEGREC     94
     1  10X,':..............................................:',/)       BEGREC     95
 5100 FORMAT(/,                                                         BEGREC     96
     1  10X,'................................................',/,       BEGREC     97
     1  10X,':    -- RECORDING SESSION IS NOT ACTIVE --     :',/,       BEGREC     98
     1  10X,':..............................................:',/)       BEGREC     99
 5105 FORMAT(/,                                                         BEGREC    100
     1  10X,'................................................',/,       BEGREC    101
     1  10X,':    -- RECORDING SESSION IS NOW ACTIVE --     :',/,       BEGREC    102
     1  10X,':            LOGICAL UNIT NUMBER = ',I2,'          :',/,   BEGREC    103
     1  10X,':..............................................:',/)       BEGREC    104
 5110 FORMAT(/,                                                         BEGREC    105
     1  10X,'................................................',/,       BEGREC    106
     1  10X,':        -- CLOSING RECORDING SESSION--        :',/,       BEGREC    107
     1  10X,':..............................................:',/)       BEGREC    108
 5120 FORMAT(/,                                                         BEGREC    109
     1  10X,'************************************************',/,       BEGREC    110
     1  10X,'*          ERROR OPENING RECORDING FILE        *',/,       BEGREC    111
     1  10X,'*          RECORDING SESSION NOT ACTIVE        *',/,       BEGREC    112
     1  10X,'************************************************',/)       BEGREC    113
          END                                                           BEGREC    114
