C
C     **************************************************
C     **                                              **
C     **        フ  ァ  イ  ル  Ｏ  Ｐ  Ｅ  Ｎ        **
C     **                                              **
C     **************************************************
C
C
      SUBROUTINE      FOPN
C
      IMPLICIT INTEGER(A-Z)
      INCLUDE 'seps.inc'
C
      INTEGER SYUTSUERR
C
      CHARACTER CNAME*4, CWNAME*4, CECON*4
      CHARACTER SAIMUSHU*2
      CHARACTER CYR*2, CXX*1
      CHARACTER CSEID*3
      CHARACTER OFLNAME*100
C
C-----------------------------------------------------------
C     試算番号の設定
C-----------------------------------------------------------
C
      WRITE(CNAME ,1000) INAME
      WRITE(CWNAME,1000) IWNAME
      WRITE(CECON ,1000) IECON
C
      WRITE(CYR, '(I2.2)') KIJUN+12
C
 1000 FORMAT(I4.4)
C
      IF(PSEID.EQ.0) CSEID='kou'
      IF(PSEID.EQ.1) CSEID='kok'
      IF(PSEID.EQ.2) CSEID='jnr'
      IF(PSEID.EQ.3) CSEID='tob'
      IF(PSEID.EQ.4) CSEID='ren'
      IF(PSEID.EQ.5) CSEID='sig'
      IF(PSEID.EQ.6) CSEID='nou'
      IF(PSEID.EQ.7) CSEID='oku'
C
C-----------------------------------------------------------
C     ダミーの結果ファイル(推計結果)
C-----------------------------------------------------------
C
      OPEN(01,FILE='/rev26/emp/rslt/u-rev/PRTFIL_1_0')
C
C-----------------------------------------------------------
C     ダミーの結果ファイル(ファイルチェック用)
C-----------------------------------------------------------
C
      OPEN(02,FILE='/rev26/emp/rslt/u-rev/PRTFLCK_1_0')
C
C-----------------------------------------------------------
C
      IF(PSEID.EQ.7) GO TO 2100
C
C-----------------------------------------------------------
C     基礎率ファイル
C-----------------------------------------------------------
C  ---------------------------------------------------------
C     基礎率ファイル(全体) 
C  ---------------------------------------------------------
C
      IF(KONEN.EQ.1) THEN
        KISORFILE(PSEID)
     &    ='/rev26/emp/data/u-rev/kisor/kisor_kou26-01.csv'
      ELSE
        KISORFILE(PSEID)
     &    ='/rev26/emp/data/u-rev/kisor/kisor_'//CSEID//'26-02.csv'
      END IF
      OPEN(10,FILE=KISORFILE(PSEID),STATUS='OLD')
C
C  ---------------------------------------------------------
C     報酬用基礎率ファイル
C  ---------------------------------------------------------
C
      IF(KONEN.EQ.1) THEN
        HOUFILE
     &    ='/rev26/emp/data/u-rev/kisor/hou_kou23-04.csv'
      ELSE
        HOUFILE
     &    ='/rev26/emp/data/u-rev/kisor/hou_'//CSEID//'23-00.csv'
      END IF
      OPEN(11,FILE=HOUFILE,STATUS='OLD')
C
C  ---------------------------------------------------------
C     支給率
C  ---------------------------------------------------------
C
      IF(KONEN.EQ.1) THEN
        SIKFILE='/rev26/emp/data/u-rev/kisor/sikur_kou26-7.csv'
      ELSE
        SIKFILE='/rev26/emp/data/u-rev/kisor/sikur_'//CSEID//'26-7.csv'
      END IF
      OPEN(12,FILE=SIKFILE,STATUS='OLD')
C
C  ---------------------------------------------------------
C     有遺族率ファイル
C  ---------------------------------------------------------
C
      IF(KONEN.EQ.1) THEN
        YUIZOFILE='/rev26/emp/data/u-rev/kisor/yuizor_kou26-2.csv'
      ELSE
        YUIZOFILE='/rev26/emp/data/u-rev/kisor/yuizor_'
     &             //CSEID//'26-2.csv'
      END IF
      OPEN(14,FILE=YUIZOFILE,STATUS='OLD')
C
C  ---------------------------------------------------------
C     死亡率ファイル
C  ---------------------------------------------------------
C
C
C     平成24年1月新人口推計から得られる将来生命表
      IF(SEIMEI.EQ.5) THEN
        QXFILE='/rev26/emp/data/u-sinj/QXPROJ-M24z.csv'
      ELSE IF(SEIMEI.EQ.6) THEN
        QXFILE='/rev26/emp/data/u-sinj/QXPROJ-H24z.csv'
      ELSE IF(SEIMEI.EQ.7) THEN
        QXFILE='/rev26/emp/data/u-sinj/QXPROJ-L24z.csv'
      END IF
C
      OPEN(25,FILE=QXFILE,STATUS='OLD')
C
C--------------------------------
C     基礎数ファイル(被保険者 全体)
C--------------------------------
C
      IF(PSEID.EQ.0) THEN
        HIHOFILE(0,1)='/rev26/emp/data/u-rev/kisos/kou/hk'
     &                                    //CYR//'-01.csv'
        HIHOFILE(0,2)='/rev26/emp/data/u-rev/kisos/kou/hk'
     &                                    //CYR//'-02.csv'
        HIHOFILE(0,3)='/rev26/emp/data/u-rev/kisos/kou/hk'
     &                                    //CYR//'-03.csv'
      ELSE
       HIHOFILE(PSEID,1)
     &       ='/rev26/emp/data/u-rev/kisos/'
     &         //CSEID//'/hk'//CYR//'-1.csv'
       HIHOFILE(PSEID,2)
     &       ='/rev26/emp/data/u-rev/kisos/'
     &         //CSEID//'/hk'//CYR//'-2.csv'
      END IF
      OPEN(30,FILE=HIHOFILE(PSEID,1),STATUS='OLD')
      OPEN(31,FILE=HIHOFILE(PSEID,2),STATUS='OLD')
      IF(PSEID.EQ.0) OPEN(32,FILE=HIHOFILE(PSEID,3),STATUS='OLD')
C
C--------------------------------
C     基礎数ファイル(受給者)
C--------------------------------
C
      DO 2000 XX=0,5
        IF(XX.GT.0 .AND. KONEN.NE.1) GO TO 2000
C
        WRITE(CXX, '(I1.1)') XX
C
        JUKFILE(0,1) ='/rev26/emp/data/u-rev/kisos/kou/jk'
     &                          //CYR//'-20-'//CXX//'.csv'
        JUKFILE(0,2) ='/rev26/emp/data/u-rev/kisos/kou/jk'
     &                          //CYR//'-21-'//CXX//'.csv'
        JUKFILE(0,3) ='/rev26/emp/data/u-rev/kisos/kou/jk'
     &                            //CYR//'-22-'//CXX//'.csv'
C
        JUKFILE(1,1)='/rev26/emp/data/u-rev/kisos/kok/jk'
     &                                    //CYR//'-1.csv'
        JUKFILE(1,2)='/rev26/emp/data/u-rev/kisos/kok/jk'
     &                                    //CYR//'-2.csv'
        JUKFILE(2,1)='/rev26/emp/data/u-rev/kisos/jnr/jk'
     &                           //CYR//'-1'//CXX//'.csv'
        JUKFILE(2,2)='/rev26/emp/data/u-rev/kisos/jnr/jk'
     &                           //CYR//'-2'//CXX//'.csv'
        JUKFILE(3,1)='/rev26/emp/data/u-rev/kisos/tob/jk'
     &                           //CYR//'-3'//CXX//'.csv'
        JUKFILE(3,2)='/rev26/emp/data/u-rev/kisos/tob/jk'
     &                           //CYR//'-4'//CXX//'.csv'
        JUKFILE(4,1)='/rev26/emp/data/u-rev/kisos/ren/jk'//CYR//'-1.csv'
        JUKFILE(4,2)='/rev26/emp/data/u-rev/kisos/ren/jk'//CYR//'-2.csv'
        JUKFILE(5,1)='/rev26/emp/data/u-rev/kisos/sig/jk'//CYR//'-1.csv'
        JUKFILE(5,2)='/rev26/emp/data/u-rev/kisos/sig/jk'//CYR//'-2.csv'
        JUKFILE(6,1)='/rev26/emp/data/u-rev/kisos/nou/jk'
     &                                          //CYR//'-5'//CXX//'.csv'
        JUKFILE(6,2)='/rev26/emp/data/u-rev/kisos/nou/jk'
     &                                          //CYR//'-6'//CXX//'.csv'
C
        OPEN(35+XX*5,FILE=JUKFILE(PSEID,1),STATUS='OLD')
        OPEN(36+XX*5,FILE=JUKFILE(PSEID,2),STATUS='OLD')
        IF(PSEID.EQ.0) OPEN(37+XX*5,FILE=JUKFILE(PSEID,3),STATUS='OLD')
C
 2000 CONTINUE
C
C--------------------------------
C     外枠ファイル
C--------------------------------
C
      WAKUFILE(0)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-01.csv'
      WAKUFILE(8)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-02.csv'
      WAKUFILE(10)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-30.csv'
      WAKUFILE(11)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-31.csv'
      WAKUFILE(12)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-32.csv'
      WAKUFILE(13)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-36.csv'
      WAKUFILE(14)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-49.csv'
      WAKUFILE(15)='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-50.csv'
      WAKUFILE(1) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-03.csv'
      WAKUFILE(2) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-06.csv'
      WAKUFILE(3) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-07.csv'
      WAKUFILE(4) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-04.csv'
      WAKUFILE(5) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-05.csv'
      WAKUFILE(6) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-08.csv'
      OPEN(70,FILE=WAKUFILE(PSEID),STATUS='OLD')
      IF(PSEID.EQ.0) OPEN(71,FILE=WAKUFILE( 8),STATUS='OLD')
      IF(PSEID.EQ.0) OPEN(73,FILE=WAKUFILE(10),STATUS='OLD')
C
      IF(FLG_PART.GE.1 .AND. PSEID.EQ.0) THEN
        OPEN(75,FILE=WAKUFILE(11),STATUS='OLD')
        OPEN(76,FILE=WAKUFILE(12),STATUS='OLD')
        OPEN(77,FILE=WAKUFILE(13),STATUS='OLD')
        IF(FLG_PART.GE.3) THEN
          OPEN(78,FILE=WAKUFILE(14),STATUS='OLD')
          OPEN(79,FILE=WAKUFILE(15),STATUS='OLD')
        END IF
      END IF
C
C     人口ファイル
      WAKUFILE(9) ='/rev26/wakuc/rslt/ver_5/rslt'//CWNAME//'/waku'
     &                                            //CWNAME//'-26.csv'
      OPEN(72,FILE=WAKUFILE(9),STATUS='OLD')
C
 2100 CONTINUE
C
C-------------------------------------------
C     経済的要素ファイルのオープン
C-------------------------------------------
C
      ECONFILE='/rev26/emp/data/u-rev/econ/econ-'//CECON//'.csv'
      OPEN(20,FILE=ECONFILE,STATUS='OLD')
C
C--------------------------------------------
C     出力
C--------------------------------------------
      SYUTSUERR=0
C
      IF(KEY.EQ.4  .OR. KEY.EQ.5  .OR. KEY.EQ.12 .OR.
     &   KEY.EQ.14 .OR. KEY.EQ.22                   ) THEN
        IF(PSLSI.EQ.2 .AND. PSLSI2.EQ.1) THEN
          IF(PSLY.EQ.15 .AND. KZN.EQ.3                      ) THEN
            SAIMUSHU='AK'
          ELSE IF(PSLY.EQ.15 .AND. KZN.EQ.5 .AND. KZNY.EQ.15) THEN
            SAIMUSHU='BK'
          ELSE
            SYUTSUERR=1
          END IF
        ELSE
          SYUTSUERR=1
        END IF
      END IF
      IF(KEY.EQ.7 .OR. KEY.EQ.8 .OR. KEY.EQ.13 .OR. KEY.EQ.23) THEN
        IF(PSLSI.EQ.0 .AND. PSLSI2.EQ.1) THEN
          IF(PSLY.EQ.12 .AND. KZN.EQ.3 ) THEN
            SAIMUSHU='CJ'
          ELSE
            SYUTSUERR=1
          END IF
        ELSE IF(PSLSI.EQ.2 .AND. PSLSI2.EQ.1) THEN
          IF(PSLY.EQ.15 .AND. KZN.EQ.3                      ) THEN
            SAIMUSHU='AJ'
          ELSE IF(PSLY.EQ.15 .AND. KZN.EQ.5 .AND. KZNY.EQ.15) THEN
            SAIMUSHU='BJ'
          ELSE
            SYUTSUERR=1
          END IF
        ELSE
          SYUTSUERR=1
        END IF
      END IF
C
      IF(SYUTSUERR.EQ.1) THEN
        WRITE(6,*) '現在設定外の組合わせです PSLY=', PSLY,
     &             ' KZN=', KZN,' KZNY=', KZNY
        STOP
      END IF
C
C----------------------------------
C     Ａシステムへの出力ファイル
C----------------------------------
      IF(KEY.EQ.1 .OR. KEY.EQ.11) THEN
        IF(NENBEEX.EQ.0) THEN
          SFILE(0)='/rev26/emp/rslt/u-rev/shus/shus.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_kou'
          SFILE(1)='/rev26/emp/rslt/u-rev/shus/shus.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_kok'
          SFILE(4)='/rev26/emp/rslt/u-rev/shus/shus.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_ren'
          SFILE(5)='/rev26/emp/rslt/u-rev/shus/shus.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_sig'
          IF(OLDFLG.EQ.0 .AND. (SEIDN.EQ.0 .OR. SEIDN.EQ.8)) THEN
            SFILE(2)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_jnr'
            SFILE(3)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_tob'
            SFILE(6)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_nou'
          ELSE
            SFILE(2)='/rev26/emp/rslt/u-rev/shus/shus.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_jnr'
            SFILE(3)='/rev26/emp/rslt/u-rev/shus/shus.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_tob'
            SFILE(6)='/rev26/emp/rslt/u-rev/shus/shus.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_nou'
            SFILE(7)='/rev26/emp/rslt/u-rev/shus/shus.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_oku'
          END IF
        ELSE IF(NENBEEX.EQ.1) THEN
          SFILE(0)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                 //CNAME//'-'//CECON//'-'
     &                             //CWNAME//'_kou-ex'
          SFILE(1)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                 //CNAME//'-'//CECON//'-'
     &                             //CWNAME//'_kok-ex'
          SFILE(4)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                 //CNAME//'-'//CECON//'-'
     &                             //CWNAME//'_ren-ex'
          SFILE(5)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                 //CNAME//'-'//CECON//'-'
     &                             //CWNAME//'_sig-ex'
          IF(OLDFLG.EQ.0 .AND. (SEIDN.EQ.0 .OR. SEIDN.EQ.8)) THEN
            SFILE(2)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_jnr-ex'
            SFILE(3)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_tob-ex'
            SFILE(6)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_nou-ex'
          ELSE
            SFILE(2)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_jnr-ex'
            SFILE(3)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_tob-ex'
            SFILE(6)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_nou-ex'
            SFILE(7)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                                   //CNAME//'-'//CECON//'-'
     &                               //CWNAME//'_oku-ex'
          END IF
        END IF
        OPEN(80,FILE=SFILE(PSEID))
      ELSE IF(KEY.EQ.4  .OR. KEY.EQ.7  .OR. KEY.EQ.12 .OR.
     &        KEY.EQ.13 .OR. KEY.EQ.14                   ) THEN
        SFILE(0)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_kou'
        SFILE(1)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_kok'
        SFILE(4)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_ren'
        SFILE(5)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_sig'
        IF(OLDFLG.EQ.0 .AND. (SEIDN.EQ.0 .OR. SEIDN.EQ.8)) THEN
          SFILE(2)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_jnr'
          SFILE(3)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_tob'
          SFILE(6)='/rev26/emp/rslt/u-rev/shhi/shhi.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_nou'
        ELSE
          SFILE(2)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_jnr'
          SFILE(3)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_tob'
          SFILE(6)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_nou'
          SFILE(7)='/rev26/emp/rslt/u-rev/shus/shus.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_oku'
        END IF
        OPEN(80,FILE=SFILE(PSEID))
      END IF
C
C------------------------------------------------
C     基礎年金給付費ファイル(基礎年金システムへ )
C------------------------------------------------
      IF((KEY.EQ.2 .OR. KEY.EQ.11) .AND. PSEID.NE.7) THEN
        KFILE(0)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_kou'
        KFILE(1)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_kok'
        KFILE(4)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_ren'
        KFILE(5)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &        //CNAME//'-'//CECON//'-'//CWNAME//'_sig'
        IF(OLDFLG.EQ.1) THEN
          KFILE(2)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_jnr'
          KFILE(3)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_tob'
          KFILE(6)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_nou'
        END IF
        IF(PSEID.EQ.0 .OR. KONEN.NE.1 .OR. OLDFLG.EQ.1) THEN
          OPEN(90,FILE=KFILE(PSEID))
        END IF
      ELSE IF((KEY.EQ.5  .OR. KEY.EQ.8  .OR.
     &         KEY.EQ.12 .OR. KEY.EQ.13 .OR. KEY.EQ.14)
     &                                 .AND. PSEID.NE.7) THEN
        KFILE(0)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_kou'
        KFILE(1)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_kok'
        KFILE(4)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_ren'
        KFILE(5)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                      //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                //CWNAME//'_sig'
        IF(OLDFLG.EQ.1) THEN
          KFILE(2)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_jnr'
          KFILE(3)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_tob'
          KFILE(6)='/rev26/emp/rslt/u-rev/kiso/kiso.'
     &                        //SAIMUSHU//''//CNAME//'-'//CECON//'-'
     &                                  //CWNAME//'_nou'
        END IF
        IF(PSEID.EQ.0 .OR. KONEN.NE.1 .OR. OLDFLG.EQ.1) THEN
          OPEN(90,FILE=KFILE(PSEID))
        END IF
      END IF
C
C-------------------------------------------
C     改定率ファイル
C-------------------------------------------
C
      IF(FLG_KAISHO.EQ.2) THEN
        KAITEAFILE='/rev26/emp/rslt/u-rev/kaite/kaitea-'//CECON//'e'
        KAITEBFILE='/rev26/emp/rslt/u-rev/kaite/kaiteb-'//CECON//'e'
      ELSE IF(FLG_KAISHO.EQ.1) THEN
        KAITEAFILE='/rev26/emp/rslt/u-rev/kaite/kaitea-'//CECON//'d'
        KAITEBFILE='/rev26/emp/rslt/u-rev/kaite/kaiteb-'//CECON//'d'
      ELSE
        KAITEAFILE='/rev26/emp/rslt/u-rev/kaite/kaitea-'//CECON
        KAITEBFILE='/rev26/emp/rslt/u-rev/kaite/kaiteb-'//CECON
      END IF
      IF(KAITE.EQ.1 .AND.
     &   ((SEIDN.LE.6 .AND. SEIDN.NE.0) .OR.
     &    ((SEIDN.EQ.0 .OR. SEIDN.GE.7) .AND. PSEID.EQ.0))) THEN
        OPEN(22,FILE=KAITEAFILE)
        OPEN(23,FILE=KAITEBFILE)
      END IF
C
C
C------------------------------------------------
C     足下年報比較用ファイル
C------------------------------------------------
C
      IF((KEY.EQ.1 .OR. KEY.EQ.11) .AND.
     &   NENBEEX.EQ.0 .AND. PSEID.NE.7 ) THEN
        HIKAKUFILE='/rev26/emp/rslt/u-rev/hikaku/hikaku.'
     &                //CNAME//'-'//CECON//'-'//CWNAME
        OPEN(92,FILE=HIKAKUFILE)
        ASHIMOTOFILE='/rev26/emp/rslt/u-rev/ashimoto/ashimoto.'
     &                //CNAME//'-'//CECON//'-'//CWNAME
        OPEN(95,FILE=ASHIMOTOFILE)
        ASHIMOTOFILES='/rev26/emp/rslt/u-rev/ashimoto/ashimotos.'
     &                //CNAME//'-'//CECON//'-'//CWNAME
        OPEN(96,FILE=ASHIMOTOFILES)
      ELSE IF(KEY.EQ.13 .AND. NENBEEX.EQ.0 .AND. PSEID.NE.7 ) THEN
        HIKAKUFILE='/rev26/emp/rslt/u-rev/hikaku/hikaku.'//SAIMUSHU//
     &              ''//CNAME//'-'//CECON//'-'//CWNAME
        OPEN(92,FILE=HIKAKUFILE)
      END IF
C
      IF((KEY.EQ.1 .OR. KEY.EQ.11) .AND.
     &   ((SEIDN.EQ.8 .AND. PSEID.NE.7) .OR. PSEID.EQ.SEIDN) .AND.
     &   NENBEEX.EQ.0) THEN
C       ------------------------------------------------
C         基礎率出力ファイル
C       ------------------------------------------------
        OFLNAME='/rev26/emp/rslt/u-rev/kisor/kisor.'
     &          //CNAME//'-'//CECON//'-'//CWNAME//'_'//CSEID//'.csv'
        OPEN(93,FILE=OFLNAME)
      END IF
C
C
      RETURN
C
      END
C
