Cobol Qa
Cobol Qa
Q1. What are the differences between COBOL and COBOL II?
A1. There are at least five differences: COBOL II supports structured
programming by using in line
PERFORMs and explicit scope terminators, it introduces new
features (EVALUATE, SET .. TO TRUE,
CALL .. BY CONTEXT, etc), it permits programs to be loaded and
addressed above the 16 megabyte line,
it does not support many old features (READY TRACE, REPORT-WRITER,
ISAM, etc.), and it offers
enhanced CICS support.
Q2. What is an explicit scope terminator?
A2. A scope terminator brackets its preceding verb, eg. IF .. END-IF,
so that all statements between the
verb and its scope terminator are grouped together. Other common
COBOL II verbs are READ, PERFORM,
EVALUATE, SEARCH and STRING.
Q3. What is an in line PERFORM? When would you use it? Anything
else to say about it?
A3. The PERFORM and END-PERFORM statements bracket all COBOL II
statements between them. The
COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In
line PERFORMs work as long as
there are no internal GO TOs, not even to an exit. The in line PERFORM
for readability should not exceed a
page length - often it will reference other PERFORM paragraphs.
Q4. What is the difference between NEXT SENTENCE and CONTINUE?
A4. NEXT SENTENCE gives control to the verb following the next
period. CONTINUE gives control to
the next verb after the explicit scope terminator. (This is not one of
COBOL II's finer implementations). It's
safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.