Cobol Tough Questions (1 of 3)

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 ‘  ‘

Into Name-out

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:

table (idx)

or a field in it:

field-1 (idx)

or a field in a sub-table:

sub-table (idx1, idx2)

Related posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.