6 Replies - 1818 Views - Last Post: 14 October 2010 - 02:21 AM Rate Topic: -----

#1 liferunsoncode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 29-August 10

COBOL program

Posted 27 September 2010 - 04:15 PM

Hello everyone,

I am writing this program and I am having issues getting it to compile right. I have 2 errors when I compile on lines 00332000, and 00378000. Its having an issue with the B-100-LOAD-CLERK-TALBLE. The error on line 00332000 says "Procedure name B-100-LOAD-CLERK-TABLE undeclared, line 339 (first usage)". And line 00378000 says "Not a data name" Does anyone have any ideas?

Here is the code:

       IDENTIFICATION DIVISION.                                         00001000
      ************************                                          00002000
                                                                        00003000
                                     00008000
      ***************************************************************** 00009000
      *                      PROGRAM NARRATIVE                        * 00010000
      *                                                               * 00011000
      *    THIS PROGRAM READS ALL THE RECORDS IN THE CUSTOMER FILE.   * 00012000
      *    ONE DETAIL LINE CONTAINING THE ACCOUNT NUMBER, CUSTOMER    * 00013000
      *    NAME, BALANCE, PURCHASES AND THE CALCULATED  MINIMUM       * 00014000
      *    PAYMENT, IS PRINTED FOR EACH CUSTOMER WITH A BALANCE       * 00015000
      *    GREATER THAN ZERO. THE NUMBER OF RECORD PROCESSED AND      * 00016000
      *    LISTED, THE TOTAL BALANCE AND THE AVERAGE BALANCE, THE     * 00017000
      *    TOTAL PURCHASES AND AVERAGE PURCHASES, AND THE TOTAL       * 00018000
      *    MINIUMUM PAYMENT AND THE AVERAGE MINIMUM PAYMENT ARE ALL   * 00019000
      *    PRINTED AT THE END OF THE REPORT. THE REPORT IS WRITTEN    * 00020000
      *    TO A DISK FILE.                                            * 00021000
      *                                                               * 00022000
      *        INPUT:      CUSTOMER.DAT - A CUSTOMER FILE             * 00023000
      *        OUTPUT:     EX7-2.RPT    - A CLERK NAME REPORT         * 00024000
      *                                                               * 00025000
      ***************************************************************** 00026000
                                                                      * 00027000
                                                                        00028000
       ENVIRONMENT DIVISION.                                            00029000
      *********************                                             00030000
                                                                        00031000
       INPUT-OUTPUT SECTION.                                            00032000
      *********************                                             00033000
                                                                        00034000
       FILE-CONTROL.                                                    00035000
                                                                        00036000
           SELECT CUSTOMER-FILE                                         00037000
            ASSIGN TO "C:\COBOLDATA\CUSTOMER.DAT"
            ORGANIZATION IS LINE SEQUENTIAL.
                                                                        00039000
                                                                        00040000
           SELECT CLERK-FILE                                            00041000
            ASSIGN TO "C:\COBOLDATA\CLRKNAME.DAT"                       00042000
            ORGANIZATION IS LINE SEQUENTIAL.                            00043000
                                                                        00044000
         SELECT REPORT-FILE                                             00045000
          ASSIGN TO "C:\COBOLDATA\EX7-2.RPT".                           00046000
      /                                                                 00047000
       DATA DIVISION.                                                   00048000
      **************                                                    00049000
                                                                        00050000
       FILE SECTION.                                                    00051000
      *************                                                     00052000
                                                                        00053000
      ******************************************************************00054000
      *                                                                *00055000
      *    INPUT-FILE  -  CUSTOMER DATA FILE                           *00056000
      *    CHARACTERISTICS: LAYOUT FOR FILE CUSTOMER.DAT               *00057000
      *    FILE ORGANIZATION - SEQUENTIAL                              *00058000
      *    RECORD LENGTH -  74 BYTES                                   *00059000
      *                                                                *00060000
      ******************************************************************00061000
                                                                        00062000
       FD  CUSTOMER-FILE.                                               00063000
                                                                        00064000
       01  INPUT-RECORD                        PIC X(74).               00065000
                                                                        00066000
      ******************************************************************00067000
      *                                                                *00068000
      *        CLERK FILE FOR LOADING NON-EMBEDDED TABLE               *00069000
      *                                                                *00070000
      ******************************************************************00071000
                                                                        00072000
       FD CLERK-FILE.                                                   00073000
                                                                        00074000
       01  NAME-RECORD.                                                 00075000
           02  NR-SALES-CLERK-ID               PIC XX.                  00076000
           02  NR-SALES-CLERK-NAME             PIC X(20).               00077000
                                                                        00078000
                                                                        00079000
      ******************************************************************00080000
      *                                                                *00081000
      *    REPORT-FILE  -  CLERK NAME REPORT                           *00082000
      *                                                                *00083000
      ******************************************************************00084000
                                                                        00085000
       FD  REPORT-FILE.                                                 00086000
                                                                        00087000
       01  LINE-OUT                            PIC X(90).               00088000
                                                                        00089000
      /                                                                 00090000
       WORKING-STORAGE SECTION.                                         00091000
      ************************                                          00092000
                                                                        00093000
      ******************************************************************00094000
      *                                                                *00095000
      *                        SWITCHES                                *00096000
      *                                                                *00097000
      ******************************************************************00098000
                                                                        00099000
       01  SWITCHES.                                                    00100000
           02  SW-END-OF-FILE                  PIC X.                   00101000
               88  END-OF-FILE                         VALUE "Y".       00102000
                                                                        00103000
                                                                        00104000
      ******************************************************************00105000
      *                                                                *00106000
      *                      ACCUMULATORS                              *00107000
      *                                                                *00108000
      ******************************************************************00109000
                                                                        00110000
       01  ACCUMULATORS.                                                00111000
                                                                        00112000
           02  AC-LINE-COUNT                   PIC 999.                 00113000
           02  AC-PAGE-COUNT                   PIC 999.                 00114000
           02  AC-RECORDS-PROCESSED            PIC 999.                 00115000
           02  AC-TOTAL-PURCHASES              PIC 9(5)V99.             00116000
      /                                                                 00117000
      ******************************************************************00118000
      *                                                                *00119000
      *                     WORK AREA FIELDS                           *00120000
      *                                                                *00121000
      ******************************************************************00122000
                                                                        00123000
       01  WORK-AREA.                                                   00124000
                                                                        00125000
           02  WA-TODAYS-DATE-TIME.                                     00126000
               03  WA-TODAYS-DATE.                                      00127000
                   04  WA-TODAYS-YEAR          PIC 9(4).                00128000
                   04  WA-TODAYS-MONTH         PIC 99.                  00129000
                   04  WA-TODAYS-DAY           PIC 99.                  00130000
               03  WA-TODAYS-TIME.                                      00131000
                   04  WA-TODAYS-HOUR          PIC 99.                  00132000
                   04  WA-TODAYS-MINUTES       PIC 99.                  00133000
               03                              PIC X(9).                00134000
                                                                        00135000
           02  WA-DATE.                                                 00136000
               03  WA-MONTH                    PIC 99.                  00137000
               03  WA-DAY                      PIC 99.                  00138000
               03  WA-YEAR                     PIC 9(4).                00139000
                                                                        00140000
           02  WA-RUN-DATE REDEFINES                                    00141000
               WA-DATE                         PIC 9(8).                00142000
                                                                        00143000
           02  WA-AM-PM                        PIC XX.                  00144000
           02  WA-HYPENS                       PIC X(25).
           02  WA-SALES-CLERK-NAME             PIC X(20).
                                                                        00146000
      ******************************************************************00147000
      *                                                                *00148000
      *        NON-EMBEDDED CLERK TABLE                                *00149000
      *                                                                *00150000
      ******************************************************************00151000
                                                                        00152000
       01  CLERK-TABLE.                                                 00153000
           02  CT-ENTRY        OCCURS 11 TIMES                          00154000
                           ASCENDING KEY CT-SALES-CLERK-ID              00155000
                           INDEXED BY CT-INDEX.                         00156000
               03  CT-SALES-CLERK-ID           PIC XX.                  00157000
               03  CT-SALES-CLERK-NAME         PIC X(20).               00158000
                                                                        00159000
      ******************************************************************00160000
      *                                                                *00161000
      *        EMBEDDED MONTH NAME TABLE                               *00162000
      *                                                                *00163000
      ******************************************************************00164000
                                                                        00165000
       01  MONTH-TABLE-DATA.                                            00166000
           02                                  PIC X(3) VALUE "JAN".    00167000
           02                                  PIC X(3) VALUE "FEB".    00168000
           02                                  PIC X(3) VALUE "MAR".    00169000
           02                                  PIC X(3) VALUE "APR".    00170000
           02                                  PIC X(3) VALUE "MAY".    00171000
           02                                  PIC X(3) VALUE "JUN".    00172000
           02                                  PIC X(3) VALUE "JUL".    00173000
           02                                  PIC X(3) VALUE "AUG".    00174000
           02                                  PIC X(3) VALUE "SEP".    00175000
           02                                  PIC X(3) VALUE "OCT".    00176000
           02                                  PIC X(3) VALUE "NOV".    00177000
           02                                  PIC X(3) VALUE "DEC".    00178000
                                                                        00179000
       01  MONTH-TABLE REDEFINES MONTH-TABLE-DATA.                      00180000
           02  MT-NAME OCCURS 12 TIMES         PIC X(3).                00181000
                                                                        00182000
      /                                                                 00183000
                                                                        00184000
                                                                        00185000
      ******************************************************************00186000
      *                                                                *00187000
      *    INPUT-FILE-         CUSTOMER DATA FILE RECORD LAYOUT        *00188000
      *                                                                *00189000
      *    CHARACTERISTICS:    LAYOUT FOR FILE CUSTOMER.DAT            *00190000
      *                        FILE ORGANIZATION - SEQUENTIAL          *00191000
      *                        RECORD LENGTH - 74 BYTES                *00192000
      *                                                                *00193000
      *                        DATE FORMAT     -YYYYMMDD               *00194000
      *                                                                *00195000
      ******************************************************************00196000
                                                                        00197000
      /                                                                 00198000
                                                                        00199000
       01  CUSTOMER-RECORD.                                             00200000
                                                                        00201000
           02  CR-PURCHASE-DATE                    PIC X(8).            00202000
           02  CR-ACCOUNT-NUMBER                   PIC X(6).            00203000
           02  CR-CUSTOMER-NAME                    PIC X(20).           00204000
           02  CR-ITEM-PURCHASED                   PIC X(20).           00205000
           02  CR-QUANTITY-PURCHASED               PIC 9.               00206000
           02  CR-BALANCE                          PIC 9(4)V99.         00207000
           02  CR-PURCHASES                        PIC 9(4)V99.         00208000
           02                                      PIC X(5).            00209000
           02  CR-CLERK-ID                         PIC XX.              00210000
                                                                        00211000
                                                                        00212000
      ******************************************************************00213000
      *                                                                *00214000
      *        REPORT HEADINGS FOR THE CLERK NAME REPORT               *00215000
      *                                                                *00216000
      ******************************************************************00217000
                                                                        00218000
       01  REPORT-HEADING.                                              00219000
                                                                        00220000
           02  RH-LINE-1.                                               00221000
               03                          PIC X(6)   VALUE "DATE: ".   00222000
               03  RH-DAY                  PIC Z9.
               03                          PIC X      VALUE "/".
               03  RH-MONTH                PIC X(3).
               03                          PIC X      VALUE "/".
               03  RH-YEAR                 PIC 9(4).
               03                          PIC X(9)   VALUE SPACES.     00224000
               03                          PIC X(20)  VALUE             00225000
                       "ABC DEPARTMENT STORE".                          00226000
               03                          PIC X(11)  VALUE SPACES.     00227000
               03                          PIC X(5)   VALUE "PAGE ".    00228000
               03  RH-PAGE-COUNT           PIC ZZ9.                     00229000
                                                                        00230000
           02  RH-LINE-2.                                               00231000
               03                          PIC X(6)   VALUE "TIME: ".   00232000
               03  RH-HOUR                 PIC Z9.                      00233000
               03                          PIC X      VALUE ":".        00234000
               03  RH-MINUTES              PIC XX.                      00235000
               03                          PIC X      VALUE SPACE.      00236000
               03  RH-AM-PM                PIC XX.                      00237000
               03                          PIC X(16)  VALUE SPACES.     00238000
               03                          PIC X(17)  VALUE             00239000
                       "CLERK NAME REPORT".                             00240000
               03                          PIC X(18)  VALUE SPACES.     00241000
               03                          PIC X(12)  VALUE
                       "***** ******".
                                                                        00243000
           02  RH-LINE-3.                                               00244000
               03                          PIC X(7)   VALUE "DATE OF".  00245000
               03                          PIC X(5)   VALUE SPACES.     00246000
               03                          PIC X(7)   VALUE "ACCOUNT".  00247000
               03                          PIC X(45)  VALUE SPACES.     00248000
               03                          PIC X(8)   VALUE "PURCHASE". 00249000
                                                                        00250000
           02  RH-LINE-4.                                               00251000
               03                          PIC X(8)   VALUE "PURCHASE". 00252000
               03                          PIC X(5)   VALUE SPACES.     00253000
               03                          PIC X(6)   VALUE             00254000
                       "NUMBER".                                        00255000
               03                          PIC X(3)   VALUE SPACES.     00256000
               03                          PIC X(13)  VALUE             00257000
                       "CUSTOMER NAME".                                 00258000
               03                          PIC X(8)   VALUE SPACES.     00259000
               03                          PIC X(10)  VALUE             00260000
                       "CLERK NAME".                                    00261000
               03                          PIC X(11)  VALUE SPACES.     00262000
               03                          PIC X(6)   VALUE "AMOUNT".   00263000
                                                                        00264000
           02  RH-LINE-5.                                               00265000
               03                          PIC X(11)  VALUE ALL "-".    00266000
               03                          PIC X(2)   VALUE SPACES.     00267000
               03                          PIC X(6)   VALUE ALL "-".    00268000
               03                          PIC X(2)   VALUE SPACES.     00269000
               03                          PIC X(20)  VALUE ALL "-".    00270000
               03                          PIC X      VALUE SPACES.     00271000
               03                          PIC X(20)  VALUE ALL "-".    00272000
               03                          PIC X      VALUE SPACES.     00273000
               03                          PIC X(9)   VALUE ALL "-".    00274000
                                                                        00275000
      ******************************************************************00276000
      *                                                                *00277000
      *        DETAIL LINE FOR THE CUSTOMER PURCHASES ANALYSIS REPORT  *00278000
      *                                                                *00279000
      ******************************************************************00280000
                                                                        00281000
       01  DETAIL-LINE.                                                 00282000
                                                                        00283000
           02  DL-PURCHASE-DATE            PIC X(11).                   00284000
           02                              PIC X(2)   VALUE SPACES.     00285000
           02  DL-ACCOUNT-NUMBER           PIC X(6).                    00286000
           02                              PIC X(2)   VALUE SPACES.     00287000
           02  DL-CUSTOMER-NAME            PIC X(20).                   00288000
           02                              PIC X      VALUE SPACES.     00289000
           02  DL-CLERK-NAME               PIC X(20).                   00290000
           02                              PIC X      VALUE SPACES.     00291000
           02  DL-PURCHASE-AMOUNT          PIC $Z,ZZ9.99.               00292000
                                                                        00293000
      ******************************************************************00294000
      *                                                                *00295000
      *    SUMMARY LINES FOR THE CUSTOMER PURCHASES ANALYSIS REPORT    *00296000
      *                                                                *00297000
      ******************************************************************00298000
                                                                        00299000
       01  SUMMARY-LINE.                                                00300000
                                                                        00301000
           02  SL-LINE-1.                                               00302000
               03                          PIC X(18)  VALUE SPACES.     00303000
               03                          PIC X(28)  VALUE             00304000
                   "TOTAL RECORDS PROCESSED   = ".                      00305000
               03  SL-RECORDS-PROCESSED    PIC ZZ9.                     00306000
                                                                        00307000
           02  SL-LINE-2.                                               00308000
               03                          PIC X(18)  VALUE SPACES.     00309000
               03                          PIC X(19)  VALUE             00310000
                   "TOTAL PURCHASES =  ".                               00311000
               03  SL-TOTAL-PURCHASES      PIC $ZZ,ZZ9.99.              00312000
                                                                        00313000
           02  SL-LINE-3.                                               00314000
               03                          PIC X(24)  VALUE SPACES.     00315000
               03                          PIC X(13)  VALUE             00316000
                   "END OF REPORT".                                     00317000
                                                                        00318000
                                                                        00319000
      /                                                                 00320000
       PROCEDURE DIVISION.                                              00321000
      *******************                                               00322000
      ******************************************************************00323000
      *                                                                *00324000
      *  MAIN-PROGRAM.  THIS IS THE MAIN PARAGRAPH OF THIS PROGRAM     *00325000
      *                                                                *00326000
      ******************************************************************00327000
                                                                        00328000
       MAIN-PROGRAM.                                                    00329000
                                                                        00330000
           PERFORM A-100-INITIALIZATION.                                00331000
           PERFORM B-100-LOAD-CLERK-TABLE.                              00332000
           PERFORM C-100-PROCESS-FILE.                                  00333000
           PERFORM D-100-WRAP-UP.                                       00334000
           STOP RUN.                                                    00335000
                                                                        00336000
      ******************************************************************00337000
      *                                                                *00338000
      *        The HOUSEKEEPING paragraph follows                      *00339000
      *                                                                *00340000
      ******************************************************************00341000
                                                                        00342000
       A-100-INITIALIZATION.                                            00343000
                                                                        00344000
           INITIALIZE ACCUMULATORS.
           OPEN OUTPUT REPORT-FILE.
                                                                        00346000
           MOVE FUNCTION CURRENT-DATE TO WA-TODAYS-DATE-TIME.           00347000
           MOVE WA-TODAYS-MONTH TO WA-MONTH.                            00348000
           MOVE WA-TODAYS-DAY TO WA-DAY.                                00349000
           MOVE WA-TODAYS-YEAR TO WA-YEAR.                              00350000
                                                                        00352000
                                                                        00353000
           EVALUATE TRUE                                                00354000
               WHEN WA-TODAYS-HOUR = 00                                 00355000
                   MOVE "AM" TO RH-AM-PM                                00356000
                   MOVE 12 TO WA-TODAYS-HOUR                            00357000
               WHEN WA-TODAYS-HOUR < 12                                 00358000
                   MOVE "AM" TO RH-AM-PM                                00359000
               WHEN WA-TODAYS-HOUR = 12                                 00360000
                   MOVE "PM" TO RH-AM-PM                                00361000
               WHEN WA-TODAYS-HOUR > 12                                 00362000
                   MOVE "PM" TO RH-AM-PM                                00363000
                   SUBTRACT 12 FROM WA-TODAYS-HOUR.                     00364000
           MOVE WA-TODAYS-HOUR TO RH-HOUR                               00365000
           MOVE WA-TODAYS-MINUTES TO RH-MINUTES                         00366000
                                                                        00367000
                                                                        00371000
      ******************************************************************00372000
      *                                                                *00373000
      *        TABLE LOADING PARAGRAPH                                 *00374000
      *                                                                *00375000
      ******************************************************************00376000
                                                                        00377000
       B-100-LOAD-CLERK-TABLE.                                          00378000
                                                                        00379000
           MOVE "N" TO SW-END-OF-FILE.                                  00380000
           OPEN INPUT CLERK-FILE.                                       00381000
                                                                        00382000
           READ CLERK-FILE                                              00383000
            AT END MOVE "Y" TO SW-END-OF-FILE.                          00384000
                                                                        00385000
           PERFORM B-200-LOAD-LOCATION                                  00386000
               VARYING CT-INDEX FROM 1 BY 1                             00387000
               UNTIL END-OF-FILE OR CT-INDEX > 11.                      00388000
                                                                        00389000
           CLOSE CLERK-FILE.                                            00390000
                                                                        00391000
      ******************************************************************00392000
      *                                                                *00393000
      *        MOVE CLERK FILE DATA TO CLERK TABLE                     *00394000
      *                                                                *00395000
      ******************************************************************00396000
                                                                        00397000
       B-200-LOAD-LOCATION.                                             00398000
                                                                        00399000
           MOVE NR-SALES-CLERK-ID TO CT-SALES-CLERK-ID (CT-INDEX).      00400000
           MOVE NR-SALES-CLERK-NAME TO CT-SALES-CLERK-NAME (CT-INDEX).  00401000
                                                                        00404000
           READ CLERK-FILE                                              00405000
               AT END MOVE "Y" TO SW-END-OF-FILE.                       00406000
                                                                        00407000
      /                                                                 00408000
      ******************************************************************00409000
      *                                                                *00410000
      *             FILE PROCESSING CONTROL PARAGRAPH                  *00411000
      *                                                                *00412000
      ******************************************************************00413000
                                                                        00414000
       C-100-PROCESS-FILE.                                              00415000
                                                                        00416000
           OPEN INPUT CUSTOMER-FILE.                                    00417000
           MOVE "N" TO SW-END-OF-FILE.                                  00418000
           READ CUSTOMER-FILE INTO CUSTOMER-RECORD                      00419000
               AT END MOVE "Y" TO SW-END-OF-FILE.                       00420000
                                                                        00421000
           PERFORM B-200-LOAD-LOCATION                                  00422000
               UNTIL END-OF-FILE.                                       00423000
           ADD 1 TO AC-LINE-COUNT.                                      00424000
           MOVE AC-RECORDS-PROCESSED TO SL-RECORDS-PROCESSED.           00425000
                                                                        00426000
           WRITE LINE-OUT FROM SL-LINE-1                                00427000
               AFTER ADVANCING 2 LINES.                                 00428000
           ADD 1 TO AC-LINE-COUNT.                                      00429000
           WRITE LINE-OUT FROM SL-LINE-2                                00430000
               AFTER ADVANCING 1 LINE.                                  00431000
                                                                        00432000
      ******************************************************************00433000
      *                                                                *00434000
      *        SEARCH TABLE AND DISPLAY DETAIL LINE                    *00435000
      *                                                                *00436000
      ******************************************************************00437000
                                                                        00438000
       C-200-PROCESS-RECORD.                                            00439000
                                                                        00440000
           IF AC-LINE-COUNT = 0                                         00441000
               ADD 1 TO AC-PAGE-COUNT                                   00442000
               MOVE WA-DAY TO RH-DAY                                    00443000
               MOVE WA-YEAR TO RH-YEAR                                  00444000
               MOVE MT-NAME(WA-TODAYS-MONTH) TO RH-MONTH                00445000
               MOVE AC-PAGE-COUNT TO RH-PAGE-COUNT                      00446000
               WRITE LINE-OUT FROM RH-LINE-1                            00447000
                   AFTER ADVANCING 2 LINES                              00448000
               MOVE WA-TODAYS-HOUR TO RH-HOUR                           00449000
               MOVE WA-TODAYS-MINUTES TO RH-MINUTES                     00450000
               MOVE WA-AM-PM TO RH-AM-PM                                00451000
               WRITE LINE-OUT FROM RH-LINE-2                            00452000
                   AFTER ADVANCING 1 LINE                               00453000
               WRITE LINE-OUT FROM RH-LINE-3                            00454000
                   AFTER ADVANCING 2 LINES                              00455000
               WRITE LINE-OUT FROM RH-LINE-4                            00456000
                   AFTER ADVANCING 1 LINE                               00457000
               MOVE 6 TO AC-LINE-COUNT.                                 00458000
                                                                        00459000
           SEARCH ALL CT-ENTRY                                          00460000
               WHEN CT-SALES-CLERK-ID (CT-INDEX) = CR-CLERK-ID          00463000
                   MOVE CT-SALES-CLERK-NAME (CT-INDEX) TO
                       WA-SALES-CLERK-NAME.
                                                                        00467000
           MOVE CR-PURCHASE-DATE TO DL-PURCHASE-DATE.                   00468000
           MOVE CR-ACCOUNT-NUMBER TO DL-ACCOUNT-NUMBER.                 00469000
           MOVE CR-CUSTOMER-NAME TO DL-CUSTOMER-NAME.                   00470000
           MOVE WA-SALES-CLERK-NAME TO DL-CLERK-NAME.                   00471000
           MOVE CR-PURCHASES TO DL-PURCHASE-AMOUNT.                     00472000
                                                                        00474000
           WRITE LINE-OUT FROM DETAIL-LINE                              00475000
               AFTER ADVANCING 1 LINE.                                  00476000
           ADD 1 TO AC-LINE-COUNT.                                      00477000
           ADD 1 TO AC-RECORDS-PROCESSED.                               00478000
                                                                        00479000
           IF AC-LINE-COUNT > 55                                        00480000
               MOVE ZERO TO AC-LINE-COUNT.                              00481000
                                                                        00482000
           READ CUSTOMER-FILE INTO INPUT-RECORD                         00483000
               AT END MOVE "Y" TO SW-END-OF-FILE.                       00484000
                                                                        00487000
           MOVE AC-RECORDS-PROCESSED TO SL-RECORDS-PROCESSED.           00488000
           MOVE AC-TOTAL-PURCHASES TO SL-TOTAL-PURCHASES.               00490000
                                                                        00499000
           WRITE LINE-OUT FROM SL-LINE-1                                00500000
               AFTER ADVANCING 2 LINES.                                 00501000
           WRITE LINE-OUT FROM SL-LINE-2                                00502000
               AFTER ADVANCING 1 LINE.                                  00503000
           WRITE LINE-OUT FROM SL-LINE-3                                00504000
               AFTER ADVANCING 1 LINE.                                  00511000
      /                                                                 00519000
      ******************************************************************00601000
      *                                                                *00602000
      *                    END OF JOB PARAGRAPH                        *00603000
      *                                                                *00604000
      ******************************************************************00605000
                                                                        00606000
                                                                        00607000
       D-100-WRAP-UP.                                                   00608000
                                                                        00609000
           CLOSE CUSTOMER-FILE                                          00610000
                 REPORT-FILE.                                           00611000
                                                                        00612000
      ******************************************************************00617000
      *                                                                *00618000
      *                    END OF PROGRAM                              *00619000
      *                                                                *00620000
      ******************************************************************00621000
      /                                                                 00622000



Is This A Good Question/Topic? 0
  • +

Replies To: COBOL program

#2 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: COBOL program

Posted 27 September 2010 - 05:08 PM

You are missing period(s):

...
MOVE WA-TODAYS-HOUR TO RH-HOUR                               00365000
MOVE WA-TODAYS-MINUTES TO RH-MINUTES
...


Was This Post Helpful? 0
  • +
  • -

#3 liferunsoncode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 29-August 10

Re: COBOL program

Posted 27 September 2010 - 05:22 PM

Ok that fixed that problem. Now I am getting an error on line 00400000. It says "153 Subscript out of range"?
Was This Post Helpful? 0
  • +
  • -

#4 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: COBOL program

Posted 27 September 2010 - 07:49 PM

Please attach your data files.
Was This Post Helpful? 0
  • +
  • -

#5 liferunsoncode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 29-August 10

Re: COBOL program

Posted 27 September 2010 - 08:10 PM

This is the customer file I am reading from:

08302001100101ALBERT, PETER A. SVGA MONITOR 1012021033089015000108252001100103ALLENSON, SHEILA M. OAK DESK 2023868087430015000309012001100105ANDERSON, ALENE T. SWIVEL DESK CHAIR 4013783053590015000508262001100107BILLINGS, BARBARA EXECUTIVE DESK CHAIR2003850017450015000608262001100110CANNON, FREDDY B.B. PLASTIC FLOOR MAT 1000000004060015001108292001100113CHAPMAN, CHARLES M. METAL COAT RACK 2014000016000020000208272001100125CLAFFLIN, WALTER E. 5 DRAWER CABINET 3012500023085021000308272001100127COMPANA, ESTER PRINTER TABLE 1011550010000015000608282001100141COOPER, BART B. CORRUGATED ORGANIZER1000000003089010000408282001100153CRAIG, BOBO B. 5" MESSAGE PADS 2001000002430015000508282001100166DOGGINS, CARL DELUXE LABEL MAKER 1009000015000015000408292001100169DOWNING, M. JR. OAK TABLE 3015550039550020000108272001100180DRIFT, ELWOOD G. #14 RUBBER BANDS 2000000000460025000608292001100193ERIKSON, LEAF E. SHIPPING TAPE 2000940000940030000608282001100225FREELAND, ROBERT A. 5 GB HARD DRIVE 2010000038790015000408262001100247FRONT, EDDIE CONST. ADHESIVE 3008050011450015000908302001100301GARCIA, JOSE I. RUBBER STATIC MAT 3004000006700010001109022001100313HATFIELD, BRADLEY DELUXE DESK PAD 5004500008450015000308302001100345HELLER, HELEN H. 3-HOLE PUNCH 2004760008590015000608302001100357HENDRIX, JAMES D. FLOOR LAMP 1000000007150015000509012001100360ISLANDER, JENNEY LEATHER ATTACHE CASE3020000024000010001109012001100383LADA, LAWRENCE STANDARD STAPLES 5000950000950015000209032001100385LADD, WALTER CORDLESS WALL CLOCK 3010220014520015000309012001100397LAMB, FREDRICK E. NO. 1 PRINT RIBBON 5009150011150015000509022001100440LEELAND, WESLEY CORRUGATED ORGANIZER1000000003089020000409022001100453LOFTIS, DOUGLAS L. RECYCLING BIN 4011000019000025000609022001100461MILLER, SUSAN S. METAL STORAGE CLOSET1007880010450015000409032001100469MUDGLEY, BRENDA WORK ROOM TABLE 3012550021000015000309032001100480NICKELS, KATHY 6' BOOK SHELF 2005000012060015000609012001100493NOWAKOWSKI, WILLIAM 3-1/2" DISK HOLDER 4000000002440015000209032001100535PATTERSON, PATRICK 56K FAX MODEM 2004000014000015000109032001100547PETERSON, ROBERT A. MARKER BOARD 3009225009250015000908262001100551POTTER, WINFRED I. LARGE BINDERS 4001025003025015000109042001100563PUCKETT, CHARLIE M. OAK DESK 2023868087430015000309042001100605PYLE, G. ALFRED SWIVEL DESK CHAIR 2010050030500010000508252001100617RASKIN, RUTH ANN EXECUTIVE DESK CHAIR1000950012400015000609042001100710RAYMOND, RONALD RUBBER FLOOR MAT 8023000023000015001109012001100713REYNOLDS, LARRY STAINLESS COAT RACK 3023500035000015000209042001100735RICHMOND, RICHARD 2 DRAWER CABINET 4010000026095015000309042001100787ROAMES, RICHARD CD HEADSET 1009550095500010000609052001100811SANDERSON, PAULETTE GENERAL LEDGER CARDS2000500000602010000409052001100843SINGER, ALEXIS E. 4" MESSAGE PADS 4001500000430015000509052001100886SUMMERS, SUSAN STANDARD LABELS 4007550009050015000409052001100909SWEET, VIRGIL 6' OAK TABLE 2010050025550015000109042001100940SWIFT, RANDOLPH GENERAL LEDGER CARDS1000000000240015000609032001100993TANDY, SANDI RED SHIPPING TAPE 6001045001245015000609022001200025TERRY, LARRY M. 7 GB HARD DRIVE 2053000065000015000409012001200047THOMPSON, RODNEY GENERAL LEDGER CARDS4018000023460020000908302001200111TONEY, ANTHONY A. RUBBER STATIC MAT 6012000013000015001108302001200123TOYOTA, SEMINEW 75 WATT DESK LAMP 3010500014050015000308262001200245TYLANDI, SHONI STANDARD OAK DESK 5045000006500015000608272001200357UPLAND, JILL O. FLOOR LAMP 2009500013150010000509012001200360UZUBELL, RINGA INSULATED BRIEF CASE1011000016000015001108252001200383VANBUREN, WINSTON STANDARD STAPLES 2000350000450015000209022001200485VANWINKLE, RALPH CORDLESS WALL CLOCK 5031250039550020000309022001200557VONRYAN, ERICK NO. 7 PRINT RIBBON 7014050017250015000508292001200646VYLASTIC, JAYLAND CORRUGATED ORGANIZER1002000003095015000409052001200753WALLACE, MICHAEL RECYCLING BIN 6022000038000015000609012001200871WALTON, JOHN B. GENERAL LEDGER CARDS3016080015450015000408252001300069WILLIAMS, RONDA METAL WORK TABLE 3022500031000015000308272001300281WYMAN, JANE 4' BOOK SHELF 4025000032000015000608282001300333YULANE, WANDA 3-1/2" DISK HOLDER 2006000001440020000209032001300415ZIPPO, ARTHUR 56 K FAX MODEM 1007000012000015000109042001300444ZOONEY, WILLIAM DESK SET W/CLOCK 30450000030000150009



This is the Clerk table that I am reading from:

01ROGER CARTER 02SAM STONE 03SUSAN ANTON 04ANNA SANCHEZ 05ROY KELSEY 06BETTY MEYERSON 07RICHARD SAMPSON 08KARLA KAZMIRE 09JOHN ADAMS 10CONNIE YOUNG 11RODNEY ALLEN
Was This Post Helpful? 0
  • +
  • -

#6 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: COBOL program

Posted 27 September 2010 - 09:10 PM

Please attach your data files.

What you have posted has the same problem your other data file posting had: the contents are not padded to defined field sizes and are thus useless.

This post has been edited by n8wxs: 27 September 2010 - 09:10 PM

Was This Post Helpful? 0
  • +
  • -

#7 Guest_Amator*


Reputation:

Re: COBOL program

Posted 14 October 2010 - 02:21 AM

....
PERFORM B-200-LOAD-LOCATION 00422000
....

This should probably refer to C-200-PROCESS-RECORD ?
(I think you have already found it by now;)
Was This Post Helpful? 0

Page 1 of 1