Error: "TALLYING clause is incomplete", how to fix it?
Error: "TALLYING clause is incomplete", how to fix it?
我的程序
******************************************************************
* Author:
* Date:
* Purpose:
* Tectonics: cobc
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. YOUR-PROGRAM-NAME.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-CNT1 PIC 9(2) VALUE 0.
01 WS-CNT2 PIC 9(2) VALUE 0.
01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'.
PROCEDURE DIVISION.
INSPECT WS-STRING TALLYING WS-CNT1 FOR CHARACTER.
DISPLAY "WS-CNT1 : "WS-CNT1.
INSPECT WS-STRING TALLYING WS-CNT2 FOR ALL 'A'.
DISPLAY "WS-CNT2 : "WS-CNT2
STOP RUN.
END PROGRAM YOUR-PROGRAM-NAME.
错误:“TALLYING 子句不完整”和“语法错误,意外字符。”,如何解决?
语法是 INSPECT identifier-1 TALLYING identifier-2 FOR CHARACTERS
,您漏掉了“S”。
我的程序
******************************************************************
* Author:
* Date:
* Purpose:
* Tectonics: cobc
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. YOUR-PROGRAM-NAME.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-CNT1 PIC 9(2) VALUE 0.
01 WS-CNT2 PIC 9(2) VALUE 0.
01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'.
PROCEDURE DIVISION.
INSPECT WS-STRING TALLYING WS-CNT1 FOR CHARACTER.
DISPLAY "WS-CNT1 : "WS-CNT1.
INSPECT WS-STRING TALLYING WS-CNT2 FOR ALL 'A'.
DISPLAY "WS-CNT2 : "WS-CNT2
STOP RUN.
END PROGRAM YOUR-PROGRAM-NAME.
错误:“TALLYING 子句不完整”和“语法错误,意外字符。”,如何解决?
语法是 INSPECT identifier-1 TALLYING identifier-2 FOR CHARACTERS
,您漏掉了“S”。