🎴 Flashcard Mode
COBOL and JCL Fundamentals
Card1 / 20
Mastered0
Review0
QuestionClick to flip
Which of the following are syntactically correct? (1) 01 REC-1 PIC SX(4). (2) 01 REC-2 PIC S9(4). (3) 01 REC-1 PIC V99. (4) 01 REC-1 PIC P99. (5) 01 REC-1 PIC 9(4)S. (6) 01 REC 1 PIC X(4).
AnswerClick to flip back
A
2, 3 and 4
💡 Explanation:
Valid COBOL PICTURE clauses: (2) PIC S9(4) - signed numeric with 4 digits, (3) PIC V99 - implicit decimal point, (4) PIC P99 - scaling with 2 decimal places assumed. Invalid: (1) SX(4) - S prefix only for numeric, not X (alphanumeric), (5) 9(4)S - S must precede the 9, not follow it, (6) REC 1 - hyphen in data name is invalid, must be REC-1.