IF 语句检查条件。如果条件为真,则执行 IF 块;如果条件为假,则执行 ELSE 块。 END-IF用于结束 IF 块。要结束 IF 块,可以使用句点代替 END-IF。但是对于多个 IF 块总是最好使用 END-IF。 嵌套IF− 出现在另一个 IF 块内的 IF 块。嵌套 IF 语句的深度没有限制。 句法 以下是 IF 条件语句的语法...
IF NOT [CONDITION] COBOL StatementsEND-IF. 示例 IDENTIFICATION DIVISION.PROGRAM-ID. HELLO.DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NUM1 PIC 9(2) VALUE 20. 01 WS-NUM2 PIC 9(9) VALUE 25.PROCEDURE DIVIS...
IF GENDER = 'MALE' DISPLAY “HE IS A MALE” END-IF. IF ELSE: IF ELSE statement is used when a certain set of statements needed to be executed by two conditions. This statement is mainly used to execute the condition-specific code. ...
条件语句(conditional statement)是⽤于根据程序员指定的某些条件更改执⾏流。条件语句将始终计算为true或false。条件被使⽤在IF, Evaluate 和 Perform语句。不同类型的条件语句如下:IF条件语句 关系(·)条件 符号(sign)条件 类(class)条件 条件名称(Condition-Name)条件 否定(negated)条件 组合(...
IF WS-NUM3 = WS-NUM4 THEN DISPLAY 'IN LOOP 2 - IF BLOCK' ELSE DISPLAY 'IN LOOP 2 - ELSE BLOCK' END-IF ELSE DISPLAY 'IN LOOP 1 - ELSE BLOCK' END-IF. STOP RUN. JCL执行上述COBOL程序 - //SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C ...
IF A-ON... 若开关在开位置,则IF A-ON返回TRUE。 IF A IS [NOT] POSITIVE 判断是否大于0 IF A IS [NOT] NEGATIVE 判断是否小于0 IF A IS [NOT] ZERO 判断是否等于0 COBOL支持NOT ,AND ,OR 操作。 PERFORM(执行语句和循环控制语句) 过程调用,但是不传递参数。
8-53 CODE-SET Clause (File Control Entry or File Description Entry)... 8-53 WITH NO LOCK Phrase (READ Statement)... 8-53 Indexed Files ...
SECTION will have all the paragraphs that are part of the section, to be performed. PARAGRAPH will have only that paragraph to be performed.5) What is the difference between CONTINUE & NEXT SENTENCE?CONTINUE is like a null statement and it continues execution, while NEXT SENTENCE transfers ...
IF A-ON... 若开关在开位置,则IF A-ON返回TRUE。 IF A IS [NOT] POSITIVE 判断是否大于0 IF A IS [NOT] NEGATIVE 判断是否小于0 IF A IS [NOT] ZERO 判断是否等于0 COBOL支持NOT ,AND ,OR 操作。 PERFORM(执行语句和循环控制语句) 过程调用,但是不传递参数。
If you wished to take a file of unordered records and produce a new file of these records sorted into ascending or descending order of a field you would use SORT. Input and Output Procedure The SORT statement above sorted all the records in the file into a new file. ...