Here is cobol tough questions:
Q1) Program-id. Program-name IS INITIAL PROGRAM.
By giving initial every time the called program will be restored to initial state, means all working storage values contain original values ,as before-and after the call.
If the ‘initial’ program calls any sub-program, and passes the values, those will not be restored if we mention ‘By content’.
Call ‘sub’ using by content a1=> main program
Procedure division using A1==>sub program
Q2) String pointer==> if we mention POINTER with string, the identifier will have ‘the number of non-blank chars moved’
Move 1 to WC-count
String first-name delimited by ‘ ‘
WIth POINTER WC-count.
Q3) The last statement in the called program is ‘EXIT PROGRAM’ or ‘GO BACK’.
Q) Read my previous post here for index and subscript
Q5) Array within the array
01 Table occurs 10.
03 field-1 pic xxx.
03 sub1table pic 9(5) occurs 5.
03 field-2 pic 99.
It is then possible to refer to an entire record:
or a field in it:
or a field in a sub-table:
sub-table (idx1, idx2)