CFPRIME BEGREC                                                          BEGREC      1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*        Extended Transient-Midterm Stability Program (ETMSP)         *RIGHTE      3
C*        ====================================================         *RIGHTE      4
C*                                                                     *RIGHTE      5
C*       Copyright (C) (1993) Electric Power Research Institute        *RIGHTE      6
C*                                                                     *RIGHTE      7
C* EPRI reserves all rights in the software and associated             *RIGHTE      8
C* documentation as delivered. The software and its associated         *RIGHTE      9
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     10
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     11
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     12
C* of any changes or modifications to the software within two (2)      *RIGHTE     13
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     14
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     15
C* new designation sufficiently different from its then current        *RIGHTE     16
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     17
C* the current software as changed or modified.                        *RIGHTE     18
C*                                                                     *RIGHTE     19
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     20
C* directly from EPRI.                                                 *RIGHTE     21
C*                                                                     *RIGHTE     22
C* This program and supporting materials may be independently available*RIGHTE     23
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     24
C* distribution fee. The EPSC is a service of                          *RIGHTE     25
C*                                                                     *RIGHTE     26
C*                    Power Computing Company                          *RIGHTE     27
C*                    1930 Hi Line                                     *RIGHTE     28
C*                    Dallas, Tx 75207                                 *RIGHTE     29
C*                                                                     *RIGHTE     30
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     31
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     32
C*                                                                     *RIGHTE     33
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     34
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     35
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     36
C*    DOCUMENTATION; OR                                                *RIGHTE     37
C*                                                                     *RIGHTE     38
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     39
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     40
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     41
C*                                                                     *RIGHTE     42
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     43
C* THEREOF.                                                            *RIGHTE     44
C*                                                                     *RIGHTE     45
C***********************************************************************RIGHTE     46
      SUBROUTINE BEGREC(FILENA,LENF)                                    BEGREC      3
CD                                                                      BEGREC      4
CD    TO OPEN THE RESPONSE FILE FOR RECORDING USER INPUTS.              BEGREC      5
CD                                                                      BEGREC      6
      INCLUDE 'CNLSTA.INS'                                              BEGREC      7
      INCLUDE 'CNLUN.INS'                                               BEGREC      8
      INCLUDE 'CNUNIT.INS'                                              BEGREC      9
C                                                                       BEGREC     10
      CHARACTER*50 FILENA                                               BEGREC     11
      CHARACTER*80 MSG,EMSG                                             BEGREC     12
      CHARACTER*9 CDATE                                                 BEGREC     13
      CHARACTER*7 SUBPMT                                                BEGREC     14
C                                                                       BEGREC     15
      CALL DATEXX(CDATE)                                                BEGREC     16
      SUBPMT='RECORD '                                                  BEGREC     17
C    .................................................................  BEGREC     18
C    : START RECORDING                                               :  BEGREC     19
C    :                                                               :  BEGREC     20
      IF(RECORD) THEN                                                   BEGREC     21
          WRITE(LOUT,5000)                                              BEGREC     22
      ELSE                                                              BEGREC     23
          IREC=0                                                        BEGREC     24
      MSG='ENTER THE RECORDING FILE NAME:'                              BEGREC     25
      EMSG='ERROR IN OPENING RECORDING FILE'                            BEGREC     26
      LMSG=30                                                           BEGREC     27
      LEMSG=31                                                          BEGREC     28
      IKEY=6                                                            BEGREC     29
      JLENG=0                                                           BEGREC     30
      WRITE(LOUT,*)                                                     BEGREC     31
      CALL FILEMG(IU35,LMSG,MSG,LEMSG,EMSG,SUBPMT,IKEY,JLENG,IEBK)      BEGREC     32
      IF(IEBK.NE.0)GOTO 1100                                            BEGREC     33
          IREC=IU35                                                     BEGREC     34
          WRITE(LOUT,5110)IREC                                          BEGREC     35
          WRITE(IREC,5140) CDATE,IREC                                   BEGREC     36
          PROMPT='(ETMSP)'                                              BEGREC     37
          RECORD=.TRUE.                                                 BEGREC     38
          GOTO 1120                                                     BEGREC     39
C         ...................................                           BEGREC     40
C         ERROR ON OPENING RECORDING FILE :                             BEGREC     41
 1100     CONTINUE                                                      BEGREC     42
          RECORD=.FALSE.                                                BEGREC     43
          WRITE(LOUT,5120)                                              BEGREC     44
C         :................................:                            BEGREC     45
 1120     CONTINUE                                                      BEGREC     46
      ENDIF                                                             BEGREC     47
      RETURN                                                            BEGREC     48
C    :..................................................................BEGREC     49
C    ..................................                                 BEGREC     50
C    : ENTRY POINT FOR STOP RECORDING :                                 BEGREC     51
C    :                                :                                 BEGREC     52
      ENTRY ENDREC                                                      BEGREC     53
CD                                                                      BEGREC     54
CD    TO CLOSE THE RESPONSE FILE FOR RECORDING USER INPUTS.             BEGREC     55
CD                                                                      BEGREC     56
      IF(RECORD) THEN                                                   BEGREC     57
         BACKSPACE IREC                                                 BEGREC     58
         ENDFILE (IREC)                                                 BEGREC     59
         CALL CLOSEF(IREC)                                              BEGREC     60
         RECORD=.FALSE.                                                 BEGREC     61
         PROMPT=' ETMSP '                                               BEGREC     62
         WRITE(LOUT,5130)                                               BEGREC     63
      ELSE                                                              BEGREC     64
         WRITE(LOUT,5100)                                               BEGREC     65
      ENDIF                                                             BEGREC     66
      RETURN                                                            BEGREC     67
C    :................................:                                 BEGREC     68
 5000 FORMAT(/,                                                         BEGREC     69
     1  10X,'................................................',/,       BEGREC     70
     1  10X,':  -- RECORDING SESSION IS ALREADY ACTIVE --   :',/,       BEGREC     71
     1  10X,':..............................................:',/)       BEGREC     72
 5100 FORMAT(/,                                                         BEGREC     73
     1  10X,'................................................',/,       BEGREC     74
     1  10X,':    -- RECORDING SESSION IS NOT ACTIVE --     :',/,       BEGREC     75
     1  10X,':          REQUEST HAS BEEN IGNORED            :',/,       BEGREC     76
     1  10X,':..............................................:',/)       BEGREC     77
 5110 FORMAT(/,                                                         BEGREC     78
     1  10X,'................................................',/,       BEGREC     79
     1  10X,':    -- RECORDING SESSION IS NOW ACTIVE --     :',/,       BEGREC     80
     1  10X,':          LOGICAL UNIT NUMBER = ',I2,'            :',/,   BEGREC     81
     1  10X,':..............................................:',/)       BEGREC     82
 5120 FORMAT(/,                                                         BEGREC     83
     1  10X,'................................................',/,       BEGREC     84
     1  10X,':       -- ERROR OPENING RECORDING FILE --     :',/,       BEGREC     85
     1  10X,':          RECORDING SESSION NOT ACTIVE        :',/,       BEGREC     86
     1  10X,':..............................................:',/)       BEGREC     87
 5130 FORMAT(/,                                                         BEGREC     88
     1  10X,'................................................',/,       BEGREC     89
     1  10X,':        -- CLOSING RECORDING SESSION--        :',/,       BEGREC     90
     1  10X,':..............................................:',/)       BEGREC     91
 5140     FORMAT('????????????????????????????????????????????????',/,  BEGREC     92
     1           '?     ETMSP KEYBOARD RESPONSE OUTPUT FILE      ?',/,  BEGREC     93
     1           '?     DATE : ',A9,25X,'?',/,                          BEGREC     94
     1           '?     LOGICAL UNIT NUMBER : ',I2,17X,'?',/,           BEGREC     95
     1           '????????????????????????????????????????????????',/,  BEGREC     96
     1           '?')                                                   BEGREC     97
          END                                                           BEGREC     98
