FAQs(46 to 60)

46) What is the mode in which you will OPEN a file for writing?


47) In the JCL, how do you define the files referred to in a subroutine ?

A) Supply the DD cards just as you would for files referred to in the main program.

48) Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?

A) Can rewrite (record length must be same), but not delete.

49) What is file status 92? 

A) Logic error. e.g., a file is opened for input and an attempt is made to write to it.

50) What is file status 39 ?

A) Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You

will get file status 39 on an OPEN.

51) What is Static and Dynamic linking ?

A) In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

52) What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? (applicable to only MVS/ESA Enterprise Server).

A) These are compile/link edit options. Basically AMODE stands for Addressing mode and RMODE for Residency mode.

AMODE(24) - 24 bit addressing;

AMODE(31) - 31 bit addressing

AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE.

RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs.

(OS/VS Cobol pgms use 24 bit addresses only).

RMODE(ANY) - Can reside above or below 16 Meg line.

53) What compiler option would you use for dynamic linking?



A) These are compiler options with respect to subscript out of range checking. NOSSRANGE is the default and if chosen,

no run time error will be flagged if your index or subscript goes out of the permissible range.

55) How do you set a return code to the JCL from a COBOL program?

A) Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

56) How can you submit a job from COBOL programs?

A) Write JCL cards to a dataset with //xxxxxxx SYSOUT= (A,INTRDR) where 'A' is output class, and dataset should be

opened for output in the program. Define a 80 byte record layout for the file.

57) What are the differences between OS VS COBOL and VS COBOL II?

A) OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit

addressing modes.

I. Report writer is supported only in OS/VS Cobol.

II. USAGE IS POINTER is supported only in VS COBOL II.

III. Reference modification e.g.: WS-VAR(1:2) is supported only in VS COBOL II.

IV. EVALUATE is supported only in VS COBOL II.

V. Scope terminators are supported only in VS COBOL II.

VI. OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.

VII. Under CICS Calls between VS COBOL II programs are supported.

58) What are the steps you go through while creating a COBOL program executable?

A) DB2 precompiler (if embedded SQL used), CICS translator (if CICS pgm), Cobol compiler, Link editor. If DB2

program, create plan by binding the DBRMs.

59) Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

A) In non-CICS environment, it is possible. In CICS, this is not possible.

60) What are the differences between COBOL and COBOL II?

A) 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.