2017-01-15 19 views
0

У меня проблема с программой в cobol. Im использование открытого COBOL в убунту, как это:COBOL конец файла open-cobol

cobc -бесплатно -x -o HRM hrm_backup.cbl

, когда я пытаюсь скомпилировать код я получаю это:

hrm_backup.cbl: In paragraph 'EMPPERSONAL-PARA': hrm_backup.cbl:1293: Error: syntax error, unexpected "end of file", expecting "END PROGRAM" or "PROGRAM-ID"

код из Программа является такой (сокращенной):

 IDENTIFICATION DIVISION. 
    PROGRAM-ID. MAINHRMS. 

    DATA DIVISION. 
    WORKING-STORAGE SECTION. 
    77 CHOICE PIC 9. 

    PROCEDURE DIVISION. 
    MAIN-PARA. 
     DISPLAY " " WITH BLANK SCREEN. 
     DISPLAY "*******************************************" LINE 3 COL 15. 
     DISPLAY "  HUMAN RESOURCE MANAGEMENT SYSTEM  " LINE 5 COL 15. 
     DISPLAY "*******************************************" LINE 7 COL 15. 
     DISPLAY "1. HRMS WRITE" LINE 10 COL 25. 
     DISPLAY "2. HRMS READ" LINE 12 COL 25. 
     DISPLAY "3. LIST BRANCH FILE" LINE 14 COL 25. 
     DISPLAY "4. EXIT" LINE 16 COL 25. 
     DISPLAY "ENTER YOUR CHOICE :" LINE 18 COL 25. 
     ACCEPT CHOICE LINE 18 COL 46. 
     IF CHOICE = 1 
      CALL "EMPWRITE" 
      CANCEL "EMPWRITE" 
      GO TO MAIN-PARA 
     ELSE 
     IF CHOICE = 2 
      CALL "EMPREAD" 
      CANCEL "EMPREAD" 
      GO TO MAIN-PARA 
     ELSE 
      STOP RUN. 

    IDENTIFICATION DIVISION. 
    PROGRAM-ID. EMPREAD. 

    ENVIRONMENT DIVISION. 
    INPUT-OUTPUT SECTION. 
    FILE-CONTROL. 
     SELECT EMPFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS EEMPID 
     FILE STATUS IS FSE. 

     SELECT LEAVEFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS LEMPID 
     FILE STATUS IS FSL. 

     SELECT BRANCHFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS BBRID 
     FILE STATUS IS FSB. 

     SELECT DESIGNATIONFILE ASSIGN TO DISK 
     ORGANIZATION IS SEQUENTIAL 
     ACCESS MODE IS SEQUENTIAL 
     FILE STATUS IS FSDES. 

     SELECT DEPARTMENTFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS DEPCODE 
     FILE STATUS IS FSDEP. 

     SELECT REVISIONFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS RREVID 
     ALTERNATE RECORD KEY IS REMPID 
     FILE STATUS IS FSR. 

     SELECT PAYMENTFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS PEMPID 
     FILE STATUS IS FSP. 

     SELECT CONFIRMATIONFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS CCONID 
     ALTERNATE RECORD KEY IS CEMPID 
     FILE STATUS IS FSC. 

     SELECT GRADEFILE ASSIGN TO DISK 
     ORGANIZATION IS SEQUENTIAL 
     ACCESS MODE IS SEQUENTIAL 
     FILE STATUS IS FSG. 

     SELECT TRANSFERFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS TTRFID 
     FILE STATUS IS FST. 

     SELECT EMPPERSONALFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS EPEMPID 
     FILE STATUS IS FSEP. 

    DATA DIVISION. 
    FILE SECTION. 
    FD EMPFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "EMP.DAT". 
    01 EMPREC. 
     02 EEMPID PIC X(6). 
     02 EEMPNAME PIC X(25). 
     02 EEMPADDR PIC X(30). 
     02 EPHONE PIC X(10). 
     02 EDOJ  PIC X(10). 
     02 EDIP  PIC X(10). 
     02 EUG  PIC X(4). 
     02 EPG  PIC X(4). 
     02 EPROFQ PIC X(4). 
     02 ESKILL PIC X(10). 
     02 EGRDNO PIC 99. 
     02 EBRNID PIC X(6). 
     02 EDESID PIC X(6). 

    FD LEAVEFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "LEAVE.DAT". 
    01 LEAVEREC. 
     02 LEMPID PIC X(6). 
     02 LFMDATE PIC X(10). 
     02 LTODATE PIC X(10). 
     02 LLEVCAT PIC X(3). 

    FD BRANCHFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "BRANCH.DAT". 
    01 BRANCHREC. 
     02 BBRID PIC X(6). 
     02 BBRNAME PIC X(15). 
     02 BBRADD PIC X(30). 
     02 BBRPH PIC X(10). 
     02 BEMAIL PIC X(20). 
     02 BMGRNAME PIC X(25). 

    FD DESIGNATIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "DESIG.DAT". 
    01 DESIGNATIONREC. 
     02 DESID PIC X(6). 
     02 DESIGN PIC X(15). 
     02 DESHRT PIC X(4). 

    FD DEPARTMENTFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "DEPART.DAT". 
    01 DEPARTMENTREC. 
     02 DEPCODE PIC X(6). 
     02 DEPNAME PIC X(20). 

    FD REVISIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "REVISION.DAT". 
    01 REVISIONREC. 
     02 RREVID PIC X(6). 
     02 REMPID PIC X(6). 
     02 RDESCODE PIC X(6). 
     02 RBASIC PIC 9(6)V99. 
     02 RHRA  PIC 9(6)V99. 
     02 RDPA  PIC 9(6)V99. 
     02 RPPA  PIC 9(6)V99. 
     02 REDUA PIC 9(6)V99. 
     02 RTECHJR PIC 9(6)V99. 
     02 RLUNCHA PIC 9(6)V99. 
     02 RCONVEY PIC 9(6)V99. 
     02 RBUSATR PIC 9(6)V99. 
     02 RLTA  PIC 9(6)V99. 
     02 RPF  PIC 9(6)V99. 
     02 RESI  PIC 9(6)V99. 
     02 RREVDATE PIC X(10). 

    FD PAYMENTFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "PAYMENT.DAT". 
    01 PAYMENTREC. 
     02 PEMPID PIC X(6). 
     02 PBASIC PIC 9(6)V99. 
     02 PDA  PIC 9(6)V99. 
     02 PCCA  PIC 9(6)V99. 
     02 PHRA  PIC 9(6)V99. 
     02 PDPA  PIC 9(6)V99. 
     02 PPPA  PIC 9(6)V99. 
     02 PEDUA PIC 9(6)V99. 
     02 PTECHJR PIC 9(6)V99. 
     02 PLUNCHA PIC 9(6)V99. 
     02 PCONVEY PIC 9(6)V99. 
     02 PBUSATR PIC 9(6)V99. 
     02 PLTA  PIC 9(6)V99. 
     02 PPF  PIC 9(6)V99. 
     02 PESI  PIC 9(6)V99. 
     02 PGRTY PIC 9(6)V99. 
     02 PPTAX PIC 9(6)V99. 
     02 PITAX PIC 9(6)V99. 
     02 PLOAN PIC 9(8)V99. 
     02 PLOANDA PIC 9(8)V99. 
     02 POTHERD PIC 9(6)V99. 
     02 PPERINC PIC 9(6)V99. 
     02 PMEDI PIC 9(6)V99. 
     02 PBOOK PIC 9(6)V99. 
     02 PENTER PIC 9(6)V99. 
     02 PTPH  PIC 9(6)V99. 
     02 PHOUSE PIC 9(6)V99. 
     02 PVEHMAN PIC 9(6)V99. 
     02 PCREDIT PIC 9(6)V99. 
     02 PCLUB PIC 9(6)V99. 
     02 PCL  PIC 99. 
     02 PSL  PIC 99. 
     02 PPL  PIC 99. 
     02 PLLOP PIC 999. 
     02 POTHERL PIC 999. 

    FD CONFIRMATIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "CONFIRM.DAT". 
    01 CONFIRMATIONREC. 
     02 CCONID PIC X(6). 
     02 CEMPID PIC X(6). 
     02 CCDATE PIC X(6). 

    FD GRADEFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "GRADE.DAT". 
    01 GRADEREC. 
     02 GGRADE PIC 99. 
     02 GDESIGN PIC X(25). 

    FD TRANSFERFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "TRANSFER.DAT". 
    01 TRANSFERREC. 
     02 TTRFID PIC X(6). 
     02 TEMPID PIC X(6). 
     02 TOBRID PIC X(6). 
     02 TTRFDT PIC X(10). 

    FD EMPPERSONALFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "EMPPER.DAT". 
    01 EMPPERSONALREC. 
     02 EPEMPID PIC X(6). 
     02 EPTADD PIC X(30). 
     02 EPTPH PIC X(10). 
     02 EPDOB PIC X(10). 
     02 EPPOB PIC X(10). 
     02 EPLANG PIC X(15). 
     02 EPBLOOD PIC X(4). 
     02 EPWEIGHT PIC 999. 
     02 EPHEIGHT PIC 999. 
     02 EPVISION PIC X(15). 
     02 EPFATHER PIC X(25). 
     02 EPDOBF PIC X(10). 
     02 EPMOTHER PIC X(25). 
     02 EPDOBM PIC X(10). 
     02 EPSPOUSE PIC X(25). 
     02 EPCHILD PIC X(25). 
     02 EPDOBC PIC X(10). 

    WORKING-STORAGE SECTION. 
    77 FSE PIC XX. 
    77 FSL PIC XX. 
    77 FSB PIC XX. 
    77 FSDES PIC XX. 
    77 FSDEP PIC XX. 
    77 FSR PIC XX. 
    77 FSP PIC XX. 
    77 FSC PIC XX. 
    77 FSG PIC XX. 
    77 FST PIC XX. 
    77 FSEP PIC XX. 
    77 DES PIC X(6). 
    77 GR PIC 99. 
    77 CHOICE PIC 99. 

    PROCEDURE DIVISION. 
    MAIN-PARA. 
     DISPLAY " " WITH BLANK SCREEN. 
     DISPLAY "*******************************************" LINE 3 COL 10. 
     DISPLAY "  HUMAN RESOURCE MANAGEMENT SYSTEM  " LINE 5 COL 10. 
     DISPLAY "*******************************************" LINE 7 COL 10. 
     DISPLAY " 1. EMPLOYEE FILE" LINE 11 COL 5. 
     DISPLAY " 2. LEAVE FILE" LINE 12 COL 5. 
     DISPLAY " 3. BRANCH FILE" LINE 13 COL 5. 
     DISPLAY " 4. DESIGNATION FILE" LINE 14 COL 5. 
     DISPLAY " 5. DEPARTMENT FILE" LINE 15 COL 5. 
     DISPLAY " 6. REVISION FILE" LINE 16 COL 5. 
     DISPLAY " 7. PAYMENT FILE" LINE 17 COL 5. 
     DISPLAY " 8. CONFIRMATION FILE" LINE 18 COL 5. 
     DISPLAY " 9. GRADE FILE" LINE 19 COL 5. 
     DISPLAY "10. TRANSFER FILE" LINE 20 COL 5. 
     DISPLAY "11. EMPLOYEE PERSONAL FILE" LINE 21 COL 5. 
     DISPLAY "12. EXIT" LINE 22 COL 5. 
     DISPLAY "ENTER U R CHOICE :" LINE 23 COL 5. 
     ACCEPT CHOICE LINE 23 COL 45. 
     IF CHOICE = 1 
      GO TO EMP-PARA 
     ELSE 
     IF CHOICE = 2 
      GO TO LEAVE-PARA 
     ELSE 
      IF CHOICE = 3 
       GO TO BRANCH-PARA 
      ELSE 
      IF CHOICE = 4 
       GO TO DESIGNATION-PARA 
      ELSE 
       IF CHOICE = 5 
        GO TO DEPARTMENT-PARA 
       ELSE 
       IF CHOICE = 6 
        GO TO REVISION-PARA 
       ELSE 
        IF CHOICE = 7 
         GO TO PAYMENT-PARA 
        ELSE 
         IF CHOICE = 8 
         GO TO CONFIRMATION-PARA 
         ELSE 
         IF CHOICE = 9 
          GO TO GRADE-PARA 
         ELSE 
          IF CHOICE = 10 
          GO TO TRANSFER-PARA 
          ELSE 
          IF CHOICE = 11 
           GO TO EMPPERSONAL-PARA 
          ELSE 
           EXIT PROGRAM. 

    ... 

    ERROR-EMPPERSONAL-PARA. 
     CLOSE EMPPERSONALFILE. 
     DISPLAY " " WITH BLANK SCREEN. 
     DISPLAY "INVALID CODE" LINE 12 COL 30. 
     DISPLAY 
     "PRESS ENTER TO RETURN TO HRMS READ MENU" LINE 20 COL 10. 
     STOP ' '. 
     GO TO MAIN-PARA. 

    IDENTIFICATION DIVISION. 
    PROGRAM-ID. EMPWRITE. 

    ENVIRONMENT DIVISION. 
    INPUT-OUTPUT SECTION. 
    FILE-CONTROL. 
     SELECT EMPFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS EEMPID 
     FILE STATUS IS FSO. 

     SELECT LEAVEFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS LEMPID 
     FILE STATUS IS FSL. 

     SELECT BRANCHFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS BBRID 
     FILE STATUS IS FSB. 

     SELECT DESIGNATIONFILE ASSIGN TO DISK 
     ORGANIZATION IS SEQUENTIAL 
     ACCESS MODE IS SEQUENTIAL 
     FILE STATUS IS FSDES. 

     SELECT DEPARTMENTFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS DEPCODE 
     FILE STATUS IS FSDEP. 

     SELECT REVISIONFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS RREVID 
     ALTERNATE RECORD KEY IS REMPID 
     FILE STATUS IS FSR. 

     SELECT PAYMENTFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS PEMPID 
     FILE STATUS IS FSP. 

     SELECT CONFIRMATIONFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS CCONID 
     ALTERNATE RECORD KEY IS CEMPID 
     FILE STATUS IS FSC. 

     SELECT GRADEFILE ASSIGN TO DISK 
     ORGANIZATION IS SEQUENTIAL 
     ACCESS MODE IS SEQUENTIAL 
     FILE STATUS IS FSG. 

     SELECT TRANSFERFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS TTRFID 
     FILE STATUS IS FST. 

     SELECT EMPPERSONALFILE ASSIGN TO DISK 
     ORGANIZATION IS INDEXED 
     ACCESS MODE IS DYNAMIC 
     RECORD KEY IS EPEMPID 
     FILE STATUS IS FSEP. 

    DATA DIVISION. 
    FILE SECTION. 
    FD EMPFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "EMP.DAT". 
    01 EMPREC. 
     02 EEMPID PIC X(6). 
     02 EEMPNAME PIC X(25). 
     02 EEMPADDR PIC X(30). 
     02 EPHONE PIC X(10). 
     02 EDOJ  PIC X(10). 
     02 EDIP  PIC X(10). 
     02 EUG  PIC X(4). 
     02 EPG  PIC X(4). 
     02 EPROFQ PIC X(4). 
     02 ESKILL PIC X(10). 
     02 EGRDNO PIC 99. 
     02 EBRNID PIC X(6). 
     02 EDESID PIC X(6). 

    FD LEAVEFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "LEAVE.DAT". 
    01 LEAVEREC. 
     02 LEMPID PIC X(6). 
     02 LFMDATE PIC X(10). 
     02 LTODATE PIC X(10). 
     02 LLEVCAT PIC X(3). 

    FD BRANCHFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "BRANCH.DAT". 
    01 BRANCHREC. 
     02 BBRID PIC X(6). 
     02 BBRNAME PIC X(15). 
     02 BBRADD PIC X(30). 
     02 BBRPH PIC X(10). 
     02 BEMAIL PIC X(20). 
     02 BMGRNAME PIC X(25). 

    FD DESIGNATIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "DESIG.DAT". 
    01 DESIGNATIONREC. 
     02 DESID PIC X(6). 
     02 DESIGN PIC X(15). 
     02 DESHRT PIC X(4). 

    FD DEPARTMENTFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "DEPART.DAT". 
    01 DEPARTMENTREC. 
     02 DEPCODE PIC X(6). 
     02 DEPNAME PIC X(20). 

    FD REVISIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "REVISION.DAT". 
    01 REVISIONREC. 
     02 RREVID PIC X(6). 
     02 REMPID PIC X(6). 
     02 RDESCODE PIC X(6). 
     02 RBASIC PIC 9(6)V99. 
     02 RHRA  PIC 9(6)V99. 
     02 RDPA  PIC 9(6)V99. 
     02 RPPA  PIC 9(6)V99. 
     02 REDUA PIC 9(6)V99. 
     02 RTECHJR PIC 9(6)V99. 
     02 RLUNCHA PIC 9(6)V99. 
     02 RCONVEY PIC 9(6)V99. 
     02 RBUSATR PIC 9(6)V99. 
     02 RLTA  PIC 9(6)V99. 
     02 RPF  PIC 9(6)V99. 
     02 RESI  PIC 9(6)V99. 
     02 RREVDATE PIC X(10). 

    FD PAYMENTFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "PAYMENT.DAT". 
    01 PAYMENTREC. 
     02 PEMPID PIC X(6). 
     02 PBASIC PIC 9(6)V99. 
     02 PDA  PIC 9(6)V99. 
     02 PCCA  PIC 9(6)V99. 
     02 PHRA  PIC 9(6)V99. 
     02 PDPA  PIC 9(6)V99. 
     02 PPPA  PIC 9(6)V99. 
     02 PEDUA PIC 9(6)V99. 
     02 PTECHJR PIC 9(6)V99. 
     02 PLUNCHA PIC 9(6)V99. 
     02 PCONVEY PIC 9(6)V99. 
     02 PBUSATR PIC 9(6)V99. 
     02 PLTA  PIC 9(6)V99. 
     02 PPF  PIC 9(6)V99. 
     02 PESI  PIC 9(6)V99. 
     02 PGRTY PIC 9(6)V99. 
     02 PPTAX PIC 9(6)V99. 
     02 PITAX PIC 9(6)V99. 
     02 PLOAN PIC 9(8)V99. 
     02 PLOANDA PIC 9(8)V99. 
     02 POTHERD PIC 9(6)V99. 
     02 PPERINC PIC 9(6)V99. 
     02 PMEDI PIC 9(6)V99. 
     02 PBOOK PIC 9(6)V99. 
     02 PENTER PIC 9(6)V99. 
     02 PTPH  PIC 9(6)V99. 
     02 PHOUSE PIC 9(6)V99. 
     02 PVEHMAN PIC 9(6)V99. 
     02 PCREDIT PIC 9(6)V99. 
     02 PCLUB PIC 9(6)V99. 
     02 PCL  PIC 99. 
     02 PSL  PIC 99. 
     02 PPL  PIC 99. 
     02 PLLOP PIC 999. 
     02 POTHERL PIC 999. 

    FD CONFIRMATIONFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "CONFIRM.DAT". 
    01 CONFIRMATIONREC. 
     02 CCONID PIC X(6). 
     02 CEMPID PIC X(6). 
     02 CCDATE PIC X(6). 

    FD GRADEFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "GRADE.DAT". 
    01 GRADEREC. 
     02 GGRADE PIC 99. 
     02 GDESIGN PIC X(25). 

    FD TRANSFERFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "TRANSFER.DAT". 
    01 TRANSFERREC. 
     02 TTRFID PIC X(6). 
     02 TEMPID PIC X(6). 
     02 TOBRID PIC X(6). 
     02 TTRFDT PIC X(10). 

    FD EMPPERSONALFILE 
     LABEL RECORDS ARE STANDARD 
     VALUE OF FILE-ID IS "EMPPER.DAT". 
    01 EMPPERSONALREC. 
     02 EPEMPID PIC X(6). 
     02 EPTADD PIC X(30). 
     02 EPTPH PIC X(10). 
     02 EPDOB PIC X(10). 
     02 EPPOB PIC X(10). 
     02 EPLANG PIC X(15). 
     02 EPBLOOD PIC X(4). 
     02 EPWEIGHT PIC 999. 
     02 EPHEIGHT PIC 999. 
     02 EPVISION PIC X(15). 
     02 EPFATHER PIC X(25). 
     02 EPDOBF PIC X(10). 
     02 EPMOTHER PIC X(25). 
     02 EPDOBM PIC X(10). 
     02 EPSPOUSE PIC X(25). 
     02 EPCHILD PIC X(25). 
     02 EPDOBC PIC X(10). 

    WORKING-STORAGE SECTION. 
    77 FSO PIC XX. 
    77 FSL PIC XX. 
    77 FSB PIC XX. 
    77 FSDES PIC XX. 
    77 FSDEP PIC XX. 
    77 FSR PIC XX. 
    77 FSP PIC XX. 
    77 FSC PIC XX. 
    77 FSG PIC XX. 
    77 FST PIC XX. 
    77 FSEP PIC XX. 
    77 CHOICE PIC 99. 

    PROCEDURE DIVISION. 
    MAIN-PARA. 
     DISPLAY " " WITH BLANK SCREEN. 
     DISPLAY "*******************************************" LINE 3 COL 10. 
     DISPLAY "  HUMAN RESOURCE MANAGEMENT SYSTEM  " LINE 5 COL 10. 
     DISPLAY "*******************************************" LINE 7 COL 10. 
     DISPLAY " 1. EMPLOYEE FILE" LINE 11 COL 5. 
     DISPLAY " 2. LEAVE FILE" LINE 12 COL 5. 
     DISPLAY " 3. BRANCH FILE" LINE 13 COL 5. 
     DISPLAY " 4. DESIGNATION FILE" LINE 14 COL 5. 
     DISPLAY " 5. DEPARTMENT FILE" LINE 15 COL 5. 
     DISPLAY " 6. REVISION FILE" LINE 16 COL 5. 
     DISPLAY " 7. PAYMENT FILE" LINE 17 COL 5. 
     DISPLAY " 8. CONFIRMATION FILE" LINE 18 COL 5. 
     DISPLAY " 9. GRADE FILE" LINE 19 COL 5. 
     DISPLAY "10. TRANSFER FILE" LINE 20 COL 5. 
     DISPLAY "11. EMPLOYEE PERSONAL FILE" LINE 21 COL 5. 
     DISPLAY "12. EXIT" LINE 22 COL 5. 
     DISPLAY "ENTER U R CHOICE :" LINE 23 COL 25. 
     ACCEPT CHOICE LINE 23 COL 45. 
     IF CHOICE = 1 
      GO TO EMP-PARA 
     ELSE 
     IF CHOICE = 2 
      GO TO LEAVE-PARA 
     ELSE 
      IF CHOICE = 3 
       GO TO BRANCH-PARA 
      ELSE 
      IF CHOICE = 4 
       GO TO DESIGNATION-PARA 
      ELSE 
       IF CHOICE = 5 
        GO TO DEPARTMENT-PARA 
       ELSE 
       IF CHOICE = 6 
        GO TO REVISION-PARA 
       ELSE 
        IF CHOICE = 7 
         GO TO PAYMENT-PARA 
        ELSE 
         IF CHOICE = 8 
         GO TO CONFIRMATION-PARA 
         ELSE 
         IF CHOICE = 9 
          GO TO GRADE-PARA 
         ELSE 
          IF CHOICE = 10 
          GO TO TRANSFER-PARA 
          ELSE 
          IF CHOICE = 11 
           GO TO EMPPERSONAL-PARA 
          ELSE 
           EXIT PROGRAM. 

    ...... 

    TRANSFER-PARA. 
     DISPLAY " " WITH BLANK SCREEN. 
     OPEN I-O TRANSFERFILE. 
     IF FST = 30 
      OPEN OUTPUT TRANSFERFILE. 
     DISPLAY "ENTER TRANSFER CODE :" LINE 1 COL 1. 
     ACCEPT TTRFID LINE 1 COL 35. 
     DISPLAY "ENTER EMP CODE :" LINE 2 COL 1. 
     ACCEPT TEMPID LINE 2 COL 35. 
     DISPLAY "ENTER OLD BRANCH CODE :" LINE 3 COL 1. 
     ACCEPT TOBRID LINE 3 COL 35. 
     DISPLAY "ENTER TRANSFER DATE :" LINE 4 COL 1. 
     ACCEPT TTRFDT LINE 4 COL 35. 
     WRITE TRANSFERREC. 
     CLOSE TRANSFERFILE. 
     GO TO MAIN-PARA. 

    EMPPERSONAL-PARA. 
     DISPLAY " " WITH BLANK SCREEN. 
     OPEN I-O EMPPERSONALFILE. 
     IF FSEP = 30 
      OPEN OUTPUT EMPPERSONALFILE. 
     DISPLAY "ENTER EMP CODE :" LINE 1 COL 1. 
     ACCEPT EPEMPID LINE 1 COL 35. 
     DISPLAY "ENTER TEMP ADDRESS :" LINE 2 COL 1. 
     ACCEPT EPTADD LINE 2 COL 35. 
     DISPLAY "ENTER PHONE :" LINE 3 COL 1. 
     ACCEPT EPTPH LINE 3 COL 35. 
     DISPLAY "ENTER DOB :" LINE 4 COL 1. 
     ACCEPT EPDOB LINE 4 COL 35. 
     DISPLAY "ENTER POB :" LINE 5 COL 1. 
     ACCEPT EPPOB LINE 5 COL 35. 
     DISPLAY "ENTER LANGUAGE KNOWN :" LINE 6 COL 1. 
     ACCEPT EPLANG LINE 6 COL 35. 
     DISPLAY "ENTER BLOOD GROUP :" LINE 7 COL 1. 
     ACCEPT EPBLOOD LINE 7 COL 35. 
     DISPLAY "ENTER WEIGHT :" LINE 8 COL 1. 
     ACCEPT EPWEIGHT LINE 8 COL 35. 
     DISPLAY "ENTER HEIGHT :" LINE 9 COL 1. 
     ACCEPT EPHEIGHT LINE 9 COL 35. 
     DISPLAY "ENTER VISION :" LINE 10 COL 1. 
     ACCEPT EPVISION LINE 10 COL 35. 
     DISPLAY "ENTER FATHER'S NAME :" LINE 11 COL 1. 
     ACCEPT EPFATHER LINE 11 COL 35. 
     DISPLAY "ENTER DOB OF FATHER :" LINE 12 COL 1. 
     ACCEPT EPDOBF LINE 12 COL 35. 
     DISPLAY "ENTER MOTHER'S NAME :" LINE 13 COL 1. 
     ACCEPT EPMOTHER LINE 13 COL 35. 
     DISPLAY "ENTER DOB OF MOTHER :" LINE 14 COL 1. 
     ACCEPT EPDOBM LINE 14 COL 35. 
     DISPLAY "ENTER SPOUSE NAME :" LINE 15 COL 1. 
     ACCEPT EPSPOUSE LINE 15 COL 35. 
     DISPLAY "ENTER CHILD NAME :" LINE 16 COL 1. 
     ACCEPT EPCHILD LINE 16 COL 35. 
     DISPLAY "ENTER DOB OF CHILD :" LINE 17 COL 1. 
     ACCEPT EPDOBC LINE 17 COL 35. 
     WRITE EMPPERSONALREC. 
     CLOSE EMPPERSONALFILE. 
     GO TO MAIN-PARA. 

Есть идеи? Благодаря!!

+1

Независимо от проблемы (решение Саймона Собича), я хотел бы указать, что те встроенные IFs являются очень плохой практикой и должны быть заменены методом ОЦЕНКИ ВЫБОР /// КОГДА 1 ...../// END-EVALUATE – gazzz0x2z

+0

, используя EVALUATE для таблицы decison, являются хорошей техникой Cobol вместо использования нескольких IF :-) – schlebe

ответ

6

компилятор на самом деле говорит вам, что проблема заключается в:

hrm_backup.cbl:1293: Error: syntax error, unexpected "end of file", expecting "END PROGRAM" or "PROGRAM-ID"

У вас есть несколько PROGRAM-ID сек, но не один END-PROGRAM. Исправьте это, и программа, вероятно, работает.

Справочная информация: В COBOL вы либо несколько программ, содержащиеся в одном источнике (все программы можно вызывать все другие и не разделяющие, отличных EXTERNAL и PROCEDURE DIVISION USING элементов данных) или быть вложенными, где точки входа и, возможно, все остальные элементы, когда отмеченные фраза GLOBAL являются общими. Единственный способ рассказать компилятору, если он один, а другой - использовать END-PROGRAM. См. Gary Cutlers GnuCOBOL Programmer's Guide раздел «Вложенные подпрограммы» для получения более подробной информации.

Я взял вашу программу и удалить часть из IF CHOICE в .... (я предполагаю, что ваш источник на самом деле имеет это с действительным кодом, включая абзацы GO TO

КСТАТИ:. Это выход из тока версия компилятора (GnuCOBOL 2,0 RC2):

hrm_backup.cbl:1293: multiple PROGRAM-ID's without matching END PROGRAM

Я высоко предлагают не использовать устаревшие OpenCOBOL 1,1 пакет (февраль-2009) от Ubuntu, но текущий релиз-кандидат от GnuCOBOL 2,0 (конец 2016 года, следующий будет скоро ava или, по крайней мере, выпуск GnuCOBOL 1.1 (январь-2014).

В настоящее время пакетов в системе Ubuntu для более новых версий в настоящее время нет, поэтому вам придется создавать их из источника, но это не должно быть большой проблемой.

+0

СПАСИБО !! im полностью новичок с Cobol, вы означаете, что мне нужно добавить «КОНЕЦ ПРОГРАММЫ (имя-идентификатор программы)» в конце каждого идентификатора PROGRAM? – Patatas91

+0

полностью работает: D Спасибо !!! – Patatas91

+2

@ Patatas91 Предложите принять ответ, если он является решением –

 Смежные вопросы

  • Нет связанных вопросов^_^