I am getting the following error when I try to compile my code in microfocus
5-S User-name SALES-NO-HOLD not unique
Can anyone tell me why I am getting this? SALES-NO-HOLD is defined and it unique. I have some weird syntax error somewhere or I left something out. Please help.
The output file will not print the SALES-N0-HOLD or
SP-NAME-IN
----------------------------------------------------------
ID DIVISION.
PROGRAM-ID. HW6.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO 'C:\IS050\HW6\HW6IN.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
SELECT OUTPUT-FILE ASSIGN TO 'C:\IS050\HW6\HW6OUT.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE.
01 SALES-HEADER-IN.
05 SALESP-NO-IN PIC X(5).
05 SP-NAME-IN PIC X(20).
05 NO-OF-REC-IN PIC 9(3).
01 SALES-RECORD-IN.
05 PIC X(25).
05 SALES-AMT-IN PIC 9(5).
FD OUTPUT-FILE.
01 PRINT-REC PIC X(50).
WORKING-STORAGE SECTION.
01 WORK-AREAS.
05 NO-OF-REC-HOLD PIC 9(3).
05 SALES-NO-HOLD PIC X(5).
05 VARIABLE1 PIC 9(5).
05 SALES-AMT-HOLD PIC 9(5).
01 WORK-AREAS-2.
05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE 'YES'.
88 MORE-RECORDS VALUE 'YES'.
88 NO-MORE-RECORDS VALUE 'NO'.
05 WS-DATE.
10 WS-YEAR PIC 9999.
10 WS-MONTH PIC 99.
10 WS-DAY PIC 99.
01 HEADING-1.
05 PIC X(17) VALUE SPACES.
05 PIC X(13) VALUE 'SALES REPORT'.
05 PIC X(8) VALUE SPACES.
05 DATE-OUT.
10 MONTH-OUT PIC 99.
10 PIC X VALUE '/'.
10 DAY-OUT PIC 99.
10 PIC X VALUE '/'.
10 YEAR-OUT PIC 9999.
05 PIC X(50) VALUE SPACES.
01 HEADING-2.
05 PIC X VALUE SPACES.
05 PIC X(11) VALUE 'SALESPERSON'.
05 PIC X(9) VALUE SPACES.
05 PIC X(4) VALUE 'NAME'.
05 PIC X(11) VALUE SPACES.
05 PIC X(11) VALUE 'TOTAL SALES'.
05 PIC X(3) VALUE SPACES.
01 HEADING-3.
05 PIC X(5) VALUE SPACES.
05 PIC X(3) VALUE 'NO.'.
05 PIC X(42) VALUE SPACES.
05 PIC X(50) VALUE SPACES.
05 PIC X(50) VALUE SPACES.
01 DETAIL-LINE.
05 PIC X(4) VALUE SPACES.
05 SALES-NO-HOLD PIC X(5).
05 PIC X(4) VALUE SPACES.
05 SP-NAME-IN PIC X(20).
05 PIC X(4) VALUE SPACES.
05 RUNNING-TOTAL-OUT PIC $ZZ,ZZZ.99.
05 PIC X(3) VALUE SPACES.
PROCEDURE DIVISION.
MAIN-PROG.
OPEN INPUT INPUT-FILE
OUTPUT OUTPUT-FILE.
PERFORM 500-PRINT-HEADER-PROCESS
.
100-MAIN-MODULE.
PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'
READ INPUT-FILE
AT END
MOVE 'NO' TO ARE-THERE-MORE-RECORDS
NOT AT END
PERFORM 200-DO-SALESPERSON-PROCESS
END-READ
END-PERFORM
PERFORM 600-TERMINATION-PROCESS
STOP RUN.
200-DO-SALESPERSON-PROCESS.
INITIALIZE VARIABLE1
INITIALIZE SALES-NO-HOLD
MOVE NO-OF-REC-IN TO NO-OF-REC-HOLD
MOVE SALESP-NO-IN TO SALES-NO-HOLD
PERFORM NO-OF-REC-HOLD TIMES
READ INPUT-FILE
ADD SALES-AMT-IN TO VARIABLE1
END-PERFORM
MOVE VARIABLE1 TO RUNNING-TOTAL-OUT
PERFORM 300-DETAIL-PRINT.
300-DETAIL-PRINT.
WRITE PRINT-REC FROM DETAIL-LINE.
500-PRINT-HEADER-PROCESS.
MOVE FUNCTION CURRENT-DATE TO WS-DATE.
MOVE WS-MONTH TO MONTH-OUT
MOVE WS-DAY TO DAY-OUT
MOVE WS-YEAR TO YEAR-OUT
WRITE PRINT-REC FROM HEADING-1
WRITE PRINT-REC FROM HEADING-2
WRITE PRINT-REC FROM HEADING-3.
600-TERMINATION-PROCESS.
CLOSE INPUT-FILE
OUTPUT-FILE.
5-S User-name SALES-NO-HOLD not unique
Can anyone tell me why I am getting this? SALES-NO-HOLD is defined and it unique. I have some weird syntax error somewhere or I left something out. Please help.
The output file will not print the SALES-N0-HOLD or
SP-NAME-IN
----------------------------------------------------------
ID DIVISION.
PROGRAM-ID. HW6.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO 'C:\IS050\HW6\HW6IN.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
SELECT OUTPUT-FILE ASSIGN TO 'C:\IS050\HW6\HW6OUT.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE.
01 SALES-HEADER-IN.
05 SALESP-NO-IN PIC X(5).
05 SP-NAME-IN PIC X(20).
05 NO-OF-REC-IN PIC 9(3).
01 SALES-RECORD-IN.
05 PIC X(25).
05 SALES-AMT-IN PIC 9(5).
FD OUTPUT-FILE.
01 PRINT-REC PIC X(50).
WORKING-STORAGE SECTION.
01 WORK-AREAS.
05 NO-OF-REC-HOLD PIC 9(3).
05 SALES-NO-HOLD PIC X(5).
05 VARIABLE1 PIC 9(5).
05 SALES-AMT-HOLD PIC 9(5).
01 WORK-AREAS-2.
05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE 'YES'.
88 MORE-RECORDS VALUE 'YES'.
88 NO-MORE-RECORDS VALUE 'NO'.
05 WS-DATE.
10 WS-YEAR PIC 9999.
10 WS-MONTH PIC 99.
10 WS-DAY PIC 99.
01 HEADING-1.
05 PIC X(17) VALUE SPACES.
05 PIC X(13) VALUE 'SALES REPORT'.
05 PIC X(8) VALUE SPACES.
05 DATE-OUT.
10 MONTH-OUT PIC 99.
10 PIC X VALUE '/'.
10 DAY-OUT PIC 99.
10 PIC X VALUE '/'.
10 YEAR-OUT PIC 9999.
05 PIC X(50) VALUE SPACES.
01 HEADING-2.
05 PIC X VALUE SPACES.
05 PIC X(11) VALUE 'SALESPERSON'.
05 PIC X(9) VALUE SPACES.
05 PIC X(4) VALUE 'NAME'.
05 PIC X(11) VALUE SPACES.
05 PIC X(11) VALUE 'TOTAL SALES'.
05 PIC X(3) VALUE SPACES.
01 HEADING-3.
05 PIC X(5) VALUE SPACES.
05 PIC X(3) VALUE 'NO.'.
05 PIC X(42) VALUE SPACES.
05 PIC X(50) VALUE SPACES.
05 PIC X(50) VALUE SPACES.
01 DETAIL-LINE.
05 PIC X(4) VALUE SPACES.
05 SALES-NO-HOLD PIC X(5).
05 PIC X(4) VALUE SPACES.
05 SP-NAME-IN PIC X(20).
05 PIC X(4) VALUE SPACES.
05 RUNNING-TOTAL-OUT PIC $ZZ,ZZZ.99.
05 PIC X(3) VALUE SPACES.
PROCEDURE DIVISION.
MAIN-PROG.
OPEN INPUT INPUT-FILE
OUTPUT OUTPUT-FILE.
PERFORM 500-PRINT-HEADER-PROCESS
.
100-MAIN-MODULE.
PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'
READ INPUT-FILE
AT END
MOVE 'NO' TO ARE-THERE-MORE-RECORDS
NOT AT END
PERFORM 200-DO-SALESPERSON-PROCESS
END-READ
END-PERFORM
PERFORM 600-TERMINATION-PROCESS
STOP RUN.
200-DO-SALESPERSON-PROCESS.
INITIALIZE VARIABLE1
INITIALIZE SALES-NO-HOLD
MOVE NO-OF-REC-IN TO NO-OF-REC-HOLD
MOVE SALESP-NO-IN TO SALES-NO-HOLD
PERFORM NO-OF-REC-HOLD TIMES
READ INPUT-FILE
ADD SALES-AMT-IN TO VARIABLE1
END-PERFORM
MOVE VARIABLE1 TO RUNNING-TOTAL-OUT
PERFORM 300-DETAIL-PRINT.
300-DETAIL-PRINT.
WRITE PRINT-REC FROM DETAIL-LINE.
500-PRINT-HEADER-PROCESS.
MOVE FUNCTION CURRENT-DATE TO WS-DATE.
MOVE WS-MONTH TO MONTH-OUT
MOVE WS-DAY TO DAY-OUT
MOVE WS-YEAR TO YEAR-OUT
WRITE PRINT-REC FROM HEADING-1
WRITE PRINT-REC FROM HEADING-2
WRITE PRINT-REC FROM HEADING-3.
600-TERMINATION-PROCESS.
CLOSE INPUT-FILE
OUTPUT-FILE.