VSAM Section1

SECTION 1

Fill in the blanks:

1. A logical record is a unit of information used to store data in a VSAM data set.

2. A CI is a unit of information that VSAM transfers between virtual storage and disk storage.

3. The minimum size of a CI is 512 bytes.

4. 512 bytes is the minimum size of a CI.

5. The maximum size of a CI is 32K.

6. A CI consists of Logical Records, Free Space and Control Information.

7. A Control Interval Definition Field (CIDF) is of 4 Bytes long.

8. A Record Definition Field (RDF) is of 3 Bytes long.

9. In a CI if two or more adjacent records have the same length, only two RDf’s are used.

10. The minimum size of a CA is 1 track.

11. 1 track is the minimum size of a CA.

12. The maximum size of a CA is 1 cylinder.

13. 1 cylinder is the maximum size of a CA.

14. LDS is VSAM data set with a CI size of 4096Bytes.

15. LDS has no imbedded control information in its CI.

16. LDS has only a data component.

17. LDS cannot have an alternate index.

18. RRDS consists of a number of preformatted fixed-length slots.

19. RRDS has only a data component.

20. For an RRDS the relative record number is used as a search argument.

21. RRDS supports only fixed length records.

22. ESDS has only a data component.

23. Spanned records must be accessed in MOVE mode.

24. Alternate Index is a special type of KSDS.

25. The Master Catalog (MCAT) is identified at IPL.

26. The Master Catalog (MCAT) contains pointers to system data sets and user catalogs.

27. VTOC (Volume Table Of Contents) describes the type and location of data sets on the volume.

28. VTOC (Volume Table Of Contents) is a data set created at volume initialization.

29. JOBCAT identifies a default catalog for an entire job.

30. STEPCAT identifies a default catalog for a single job step.

31. The two types of AMS commands are functional commands and modal commands.

32. INDEXED is the default cluster type.

33. 4089 is the default maximum record length.

34. One cluster can have a maximum of 123 extents for all volumes together.

35. Record Size cannot be coded for LDS.

36. INDEX information appears on a LISTCAT listing for KSDS.

37. A Data Class is a description of data set characteristics under control of SMS.

38. JCL parameters override the specifications from a Data Class.

39. The names and contents of the Data Classes can be displayed through ISMF.

40. REPRO provides an easy to use copy utility.

41. REPRO copies or merges an alternate index as a KSDS.

42. REPRO converts a sequential or indexed-sequential data set into a VSAM data set.

43. The PRINT command prints VSAM data sets, non-VSAM data sets and catalogs.

44. The default print format for output is DUMP.

45. If a KSDS cluster with name BMDUSER.KSDS1 is created, the default data component name would be BMDUSER.KSDS1.DATA .

46. ALTER modifies the cataloged attributes of a VSAM data set.

47. ALTER can be used to change an ESDS into an LDS.

48. An LDS cannot be changed to any other VSAM data set format.

49. IMBED and REPLICATE options are applicable to KSDS cluster.

50. Parameters specified in the JCL override the appropriate parameters specified in the Data Class.

51. VSAM clusters can be accessed in Sequential, Direct and Skip sequential .

52. VSAM data can be processed by Logical Record or by Control Interval access.

53. After software-end-of-file is written, the file is in Recovery mode.

54. VERIFY cannot be used for an Empty Dataset or an LDS .

55. Password verification is done during OPEN processing.

56. Strings allow concurrent positioning within a data set. ()

57. The minimum buffer space for a cluster is STRNO index buffers and STRNO+1 data buffers.

58. The default buffer space for a cluster is STRNO index buffers and STRNO+1 data buffers.

59. Sequential processing is overlapped when at least STRNO+3 data buffers are allocated.

60. For Sequential processing, larger data CI sizes are desirable.

61. For Random or Direct processing, smaller data CIs are desirable.

62. Free Space is used to reduce the number of CI and CA splits.

63. ICI access cannot be used to Load or Extend a data set.

64. Space allocations made in RECORDs are converted to TRKS by VSAM. ()

65. Key compression applies to the Index component.

66. An alternate index cannot be defined for an RRDS or LDS .

67. Each AIX data record contains System Header Information, the Alternate Key, and Pointer to the data set.

68. A Path Path provides a way to gain access to the base data through its AIX.

69. Base Cluster must not be empty for BLDINDEX.

70. Length of the alternate keys must not exceed 255 .

71. Records larger than 32760 cause REPRO to terminate.

72. When exporting a data set, we specify TEMPORARY to preserve the original data set.

JCL Questions

1.What is primary allocation for a dataset?

The space allocated when the     dataset is first created.

2.What is the difference between primary and secondary allocations for a dataset?

Secondary allocation is done when more space is required than what has already been allocated.

3.How many extents are possible for a sequential file ? For a VSAM file?

16 extents on a volume for a sequential file and 123 for a VSAM file.

4.What does a disposition of (NEW,CATLG,DELETE) mean? –

That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to delete the dataset if the step abends.

5.What does a disposition of (NEW,CATLG,KEEP) mean? –

That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset would not be catalogued and we would need to supply the vol. ser the next time we refer to it.

6.How do you access a file that had a disposition of KEEP? –

Need to supply volume serial no. VOL=SER=xxxx.

7.What does a disposition of (MOD,DELETE,DELETE) mean ?

The MOD will cause the dataset to be created (if it does not exist), and then the two DELETEs will cause the dataset to be deleted whether the step abends or not. This disposition is used to clear out a dataset at the beginning of a job.

8.What is the DD statement for a output file?

Unless allocated earlier, will have the foll parameters: DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB .

9.What do you do if you do not want to keep all the space allocated to a dataset? –

Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)

10.What is DISP=(NEW,PASS,DELETE)?

This is a new file and create it, if the step terminates normally, pass it to the subsequent steps and if step abends, delete it. This dataset will not exist beyond the JCL.

11.How do you create a temporary dataset? Where will you use them?

Temporary datasets can be created either by not specifying any DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP.

We use them to carry the output of one step to another step in the same job. The dataset will not be retained once the job completes.

12.How do you restart a proc from a particular step? –

In job card, specify RESTART=procstep.stepname

where procstep = name of the jcl step that invoked the proc

and stepname = name of the proc step where you want execution to start

13.How do you skip a particular step in a proc/JOB? –

Can use either condition codes or use the jcl control statement IF (only in ESA JCL)

14.A PROC has five steps. Step 3 has a condition code. How can you override/nullify this condition code? –

Provide the override on the EXEC stmt in the JCL as follows:

//STEP001 EXEC procname,COND.stepname=value

All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like this.

15.How do you override a specific DDNAME/SYSIN in PROC from a JCL?

//<stepname.dd> DSN=…

16.What is NOTCAT 2 –

This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you already have a dataset with dsn = ‘xxxx.yyyy’ and u try to create one with disp new,catlg, you would get this error. the program open and write would go through and at the end of the step the system would try to put it in the system catalog. at this point since an entry already exists the catlg would fail and give this message. you can fix the problem by deleting/uncataloging the first data set and going to the volume where the new dataset exists(this info is in the msglog of the job) and cataloging it.

17.What is ‘S0C7′ abend? –

Caused by invalid data in a numeric field.

18.What is a S0C4 error ? –

Storage violation error – can be due to various reasons. e.g.: READING a file that is not open, invalid address referenced due to subscript error.

19.What are SD37, SB37, SE37 abends?

All indicate dataset out of space. SD37 – no secondary allocation was specified. SB37 – end of vol. and no further volumes specified. SE37 – Max. of 16 extents already allocated.

20.What is S322 abend ?

Indicates a time out abend. Your program has taken more CPU time than the default limit for the job class. Could indicate an infinite loop.

21.Why do you want to specify the REGION parameter in a JCL step? –

To override the REGION defined at the JOB card level.

REGION specifies the max region size. REGION=0K or 0M or omitting REGION means no limit will be applied.

22.What does the TIME parameter signify ? What does TIME=1440 mean ?

TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time. TIME=1440 means no CPU time limit is to be applied to this step.

23.What is COND=EVEN ?

Means execute this step even if any of the previous steps, terminated abnormally.

24.What is COND=ONLY ?

Means execute this step only if any of the previous steps, terminated abnormally.

25.How do you check the syntax of a JCL without running it?

TYPERUN=SCAN on the JOB card or use JSCAN.

26.What does IEBGENER do?

Used to copy one QSAM file to another. Source dataset should be described using SYSUT1 ddname. Destination dataset should be decribed using SYSUT2. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.

27.How do you send the output of a COBOL program to a member of a PDS?

Code the DSN as pds(member) with a DISP of SHR. The disp applies to the pds and not to a specific member.

28.I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I submit it?

Multiple jobs are submitted (as many jobs as the number of JOB cards).

29.I have a COBOL program that ACCEPTs some input data. How do you code the JCL statment for this? ( How do you code instream data in a JCL? )

//SYSIN DD*

input data

input data

/*

30.Can you code instream data in a PROC ?

No.

31. How do you overcome this limitation ?

One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.

32.How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

To run a non DB2 program,

//STEP001 EXEC PGM=MYPROG

To run a DB2 program,

//STEP001 EXEC PGM=IKJEFT01

//SYSTSIN DD *

DSN SYSTEM(….)

RUN PROGRAM(MYPROG)

PLAN(…..) LIB(….) PARMS(…)

/*

33.What is STEPLIB, JOBLIB? What is it used for? –

Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed.

STEPLIB applies only to the particular step, JOBLIB to all steps in the job.

34.What is order of searching of the libraries in a JCL? –

First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The system libraries are specified in the linklist.

35.What happens if both JOBLIB & STEPLIB is specified ?

JOBLIB is ignored.

36.When you specify mutiple datasets in a JOBLIB or STEPLIB, what factor determines the order? –

The library with the largest block size should be the first one.

37.How to change default proclib ?

//ABCD JCLLIB ORDER=(ME.MYPROCLIB,SYS1.PROCLIB)

38.The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

Records will be written to end of file (append) when a WRITE is done in both cases.

39.What are the valid DSORG values ?

PS – QSAM, PO – Partitioned, IS – ISAM

40.What are the differences between JES2 & JES3 ?

JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step executes.

JCL Interview questions

1) What is the function of DD DISP parameter? – JCL
(1) Tells the system what to do with the dataset following normal termination of the step
(2) Describes the status of the dataset
(3) Tells the system what to do with the dataset following abnormal termination of the step
(4) All of the above

2) How is the record format of an output dataset specified?
(1) RECORG parameter
(2) STORCLAS parameter
(3) RECFM parameter
(4) None of the above

3) What is the purpose of DD * statement in JCL?
(1) Begins an input data prompt at the system console
(2) Begins an in-stream dataset
(3) Marks the end of a command stream
(4) Includes all datasets within a naming pattern

4) A DD statement has 2 types of parameters. Name them ?
(1) Positional, Keyword
(2) Keyword, Control
(3) Dynamic, Static
(4) Named, Dynamic

5) What is the function of JOB statement in JCL ?
(1) Marks the end of a job
(2) Marks the beginning of an instream procedure
(3) Marks the beginning of a job & assigns a name to the job
(4) Assigns an execution priority to a job

6) How can a job send a status message to a TSO user at the completion of a job ?
(1) STATUS
(2) NOTIFY
(3) ENDMSG
(4) USER

7) What is the function of a DD statement ?
(1) Identifies & describes a dataset
(2) Delimits a DO loop
(3) Marks the start of a declarative section
(4) Delimits the start of an inline include section

8) When output dataset space is required, what quantity categories are used ?
(1) Primary, Secondary, Directory
(2) Address, Units, CONTIG or ALS
(3) Displacement and length
(4) Megabytes, Kilobytes and Bytes

9) What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step ?
(1) START
(2) RUN
(3) EXEC
4. GO

10) How can unused space allocation be returned to the system when a dataset is closed ?
(1) RETURN
(2) RLSE
(3) CONTIG
(4) CLOSE

11) Can an individual step be restricted from using all the job’s allowed CPU time ?
(1) Yes
(2) No
(3) Only in Catalogued Procedure
(4) Through the STEPTIME parameter

12) Where can program checkpoints be stored for use in a restart ?
(1) CHCKPOINT DD statement
(2) SYSCHK DD statement
(3) CHKOUT DD statement
(4) CHECK or DD statement

13) How can the disposition of sysout datasets be set for an entire jobstream ?
(1) SYSOUT parameter
(2) OUTPUT parameter
(3) DEFAULT parameter
(4) DEST keyword

14) What statement marks the end of an in-stream or Catalogued procedure ?
(1) STREAM
(2) SET
(3) PROC
(4) PEND

15) What is the function of DD name parameter with a 2 part structure; Audit.Report ?
(1) Override the Audit DD statement in the report
(2) Override the Report DD statement in the Audit procedure
(3) Concatenate a dataset onto a DD statement in a called module
(4) Delete the Audit DD statement in the Report

16) Which DD parameters are required ?
(1) All parameters & Keywords are optional
(2) Dsname, SPACE, RECFM
(3) Dsname, SPACE, UNIT
(4) Dsname, DISP, SPACE

17) How can an in-stream dataset be terminated?
(1) //
(2) //*
(3) /*
(4) None of the above

18) What is the function of the DD DCB keyword?
(1) Begins the subparameters of the DCB
(2) Begins the DASD control block
(3) Marks the close of the DCB
(4) Modifies the record type parameters

19) What is the maximum length of a single line of JCL ?
(1) 71 bytes
(2) 60 bytes
(3) 55 bytes
(4 ) 80 bytes

20) What is the purpose of DD DUMMY statement ?
(1) Marks a deleted DD statement
(2) Begins an interpreted command stream
(3) Specifies no space allocation & no disposition processing
(4) Suppress command processing

21) Many JCL statements contain specific values designed to direct & control the execution of the statement. What are these fields called ?
(1) Linkage Variables
(2) Parameters
(3) Control Libraries
(4) Includes

22) When space is allocated for an output dataset, what units can be used?
(1) Disks
(2) Megabytes
(3) Cylinders, Tracks, Blocks
(4) Bytes

23) What is the format of comment statement ?
(1) //
(2) //*
(3) /*
(4 ) None of the above

24) A DD statement consists of 4 fields. Name them :-
(1) Name, DD, Space, Device
(2) Format, Name, DD, Space
(3) DD, parameter, device, format
(4) Name, DD, parameter, comments

25) What DD statement is used to supply the name of a dataset ?
(1) Name
(2) Dsname
(3) Label
(4) File

26. What is the purpose of the ‘DD KEYLEN’ parameter?
(1) Specify the length of a data set key in bytes
(2) Override the key length of an SMS defined VSAM dataset
(3) Override the key length specified in the dataset label
All of the above

27. What is the function of the STEPLIB DD statement?
(1) Identify a library to be searched for programs named in the EXEC statement
(2) Identify a library containing executable job steps
(3) Override the system step library within a job stream
(4) All of the above

28. How can return codes be tested before execution of a job step?
(1) Through the RC keyword
(2) Through the CODE keyword
(3) Through the COND keyword
(4) Through the RETURNCD keyword

29. What is concatenating?
(1) Overriding or adding procedures
(2) Logically connecting input datasets
(3) Overriding a called PROC dsname
(4) All of the above

COBOL interview questions

  1. Name the divisions in a COBOL program.

IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE
DIVISION.

  1. 2. What are the different data types available in COBOL?

Alpha-numeric (X), alphabetic (A) and numeric (9).

  1. 3. What does the INITIALIZE verb do? �

Alphabetic, Alphanumeric fields & alphanumeric edited items are set to
SPACES.

Numeric, Numeric edited items set to ZERO.

FILLER , OCCURS DEPENDING ON items left untouched.

  1. 4. What is 77 level used for ?

Elementary level item. Cannot be subdivisions of other items (cannot be
qualified), nor can they be subdivided themselves.

  1. 5. What is 88 level used for ?

For condition names.

  1. 6. What is level 66 used for ?

For RENAMES clause.

  1. 7. What does the IS NUMERIC clause establish ?

IS NUMERIC can be used on alphanumeric items, signed numeric & packed
decimal items and usigned numeric & packed decimal items. IS NUMERIC
returns TRUE if the item only consists of 0-9. However, if the item being
tested is a signed item, then it may contain 0-9, + and – .

  1. 8. How do you define a table/array in COBOL?

01 ARRAYS.

05 ARRAY1 PIC X(9) OCCURS 10 TIMES.

05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.

  1. 9. Can the OCCURS clause be at the 01 level?

No.

10. What is the difference between index and subscript?

Subscript refers to the array occurrence while index is the displacement
(in no of bytes) from the beginning of the array. An index can only be
modified using PERFORM, SEARCH & SET.

Need to have index for a table in order to use SEARCH, SEARCH ALL.

11. What is the difference between SEARCH and SEARCH ALL?

SEARCH – is a serial search.

SEARCH ALL – is a binary search & the table must be sorted (
ASCENDING/DESCENDING KEY clause to be used & data loaded in this order)
before using SEARCH ALL.

12. What should be the sorting order for SEARCH ALL?

It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want
the search to be done on an array sorted in descending order, then while
defining the array, you should give DESCENDING KEY clause. (You must load the
table in the specified order).

13. What is binary search?

Search on a sorted array. Compare the item to be searched with the item at
the center. If it matches, fine else repeat the process with the left half or
the right half depending on where the item lies.

14. My program has an array defined to have 10 items. Due to a bug, I find
that even if the program access the 11th item in this array, the program does
not abend. What is wrong with it?

Must use compiler option SSRANGE if you want array bounds checking. Default
is NOSSRANGE.

15. How do you sort in a COBOL program? Give sort file definition, sort
statement syntax and meaning.

Syntax:

SORT file-1 ON ASCENDING/DESCENDING KEY key….

USING file-2

GIVING file-3.

USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2

GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.

file-1 is the sort workfile and must be described using SD entry in FILE
SECTION.

file-2 is the input file for the SORT and must be described using an FD
entry in FILE SECTION and SELECT clause in FILE CONTROL.

file-3 is the outfile from the SORT and must be described using an FD entry
in FILE SECTION and SELECT clause in FILE CONTROL.

file-1, file-2 & file-3 should not be opened explicitly.

INPUT PROCEDURE is executed before the sort and records must be RELEASEd to
the sort work file from the input procedure.

OUTPUT PROCEDURE is executed after all records have been sorted. Records
from the sort work file must be RETURNed one at a time to the output
procedure.

16. How do you define a sort file in JCL that runs the COBOL program?

Use the SORTWK01, SORTWK02,….. dd names in the step. Number of sort
datasets depends on the volume of data being sorted, but a minimum of 3 is
required.

17. What are the two ways of doing sorting in a COBOL program? Give the
formats.

See question 16.

18. Give the format of USING and GIVING in SORT statement. What are the
restrictions with it?

See question 16. Restrictions – Cannot massage records, canot select
records to be sorted.

19. What is the difference between performing a SECTION and a PARAGRAPH?

Performing a SECTION will cause all the paragraphs that are part of the
section, to be performed.

Performing a PARAGRAPH will cause only that paragraph to be
performed.

20. What is the use of EVALUATE statement?

Evaluate is like a case statement and can be used to replace nested Ifs.
The difference between EVALUATE and case is that no ‘break’ is required for
EVALUATE i.e. control comes out of the EVALUATE as soon as one match is
made.

21. What are the different forms of EVALUATE statement?

EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS

WHEN A=B AND C=D WHEN 100 ALSO ‘00′

imperative stmt imperative stmt

WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32′

imperative stmt imperative stmt

WHEN OTHER WHEN OTHER

imperative stmt imperative stmt

END-EVALUATE END-EVALUATE

EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE

WHEN 100 ALSO TRUE WHEN 100 ALSO A=B

imperative stmt imperative stmt

WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)

imperative stmt imperative stmt

END-EVALUATE END-EVALUATE

22. How do you come out of an EVALUATE statement?

After the execution of one of the when clauses, the control is
automatically passed on to the next sentence after the EVALUATE statement.
There is no need of any extra code.

23. In an EVALUATE statement, can I give a complex condition on a when clause?

Yes.

24. What is a scope terminator? Give examples.

Scope terminator is used to mark the end of a verb e.g. EVALUATE,
END-EVALUATE; IF, END-IF.

25. How do you do in-line PERFORM?

PERFORM … …

END PERFORM

26. When would you use in-line perform?

When the body of the perform will not be used in other paragraphs. If the
body of the perform is a generic type of code (used from various other places in
the program), it would be better to put the code in a separate para and use
PERFORM paraname rather than in-line perform.

27. What is the difference between CONTINUE & NEXT SENTENCE ?

CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE
transfers control to the next sentence (!!) (A sentence is terminated by a
period)

28. What does EXIT do ?

Does nothing ! If used, must be the only sentence within a
paragraph.

29. Can I redefine an X(100) field with a field of X(200)?

Yes. Redefines just causes both fields to start at the same location. For
example:

01 WS-TOP PIC X(1)

01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).

If you MOVE ‘12′ to WS-TOP-RED,

DISPLAY WS-TOP will show 1 while

DISPLAY WS-TOP-RED will show 12.

30. Can I redefine an X(200) field with a field of X(100) ?

Yes.

31. What do you do to resolve SOC-7 error?

Basically you need to correcting the offending data.

Many times the reason for SOC7 is an un-initialized numeric item. Examine
that possibility first.

Many installations provide you a dump for run time abends ( it can be
generated also by calling some subroutines or OS services thru assembly
language). These dumps provide the offset of the last instruction at which the
abend occurred. Examine the compilation output XREF listing to get the verb
and the line number of the source code at this offset. Then you can look at
the source code to find the bug. To get capture the runtime dumps, you will
have to define some datasets (SYSABOUT etc ) in the JCL.

If none of these are helpful, use judgement and DISPLAY to localize the
source of error.

Some installtion might have batch program debugging tools. Use them.

32. How is sign stored in Packed Decimal fields and Zoned Decimal fields?

Packed Decimal fields: Sign is stored as a hex value in the last nibble (4
bits ) of the storage.

Zoned Decimal fields: As a default, sign is over punched with the numeric
value stored in the last bite.

33. How is sign stored in a comp-3 field?

It is stored in the last nibble. For example if your number is +100, it
stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your
number is 102, hex 1D if the number is -101, hex 2D if the number is -102
etc…

34. How is sign stored in a COMP field ?

In the most significant bit. Bit is on if -ve, off if +ve.

35. What is the difference between COMP & COMP-3 ?

COMP is a binary storage format while COMP-3 is packed decimal
format.

36. What is COMP-1? COMP-2?

COMP-1 – Single precision floating point. Uses 4 bytes.

COMP-2 – Double precision floating point. Uses 8 bytes.

37. How do you define a variable of COMP-1? COMP-2?

No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.

38. How many bytes does a S9(7) COMP-3 field occupy ?

Will take 4 bytes. Sign is stored as hex value in the last nibble.

General formula is INT((n/2) + 1)), where n=7 in this example.

39. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?

Will occupy 8 bytes (one extra byte for sign).

40. How many bytes will a S9(8) COMP field occupy ?

4 bytes.

41. What is the maximum value that can be stored in S9(8) COMP?

99999999

42. What is COMP SYNC?

Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED
LEFT or RIGHT.

For binary data items, the address resolution is faster if they are located
at word boundaries in the memory. For example, on main frame the memory word
size is 4 bytes. This means that each word will start from an address
divisible by 4. If my first variable is x(3) and next

one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP
will start from byte 3 ( assuming that it starts from 0 ). If you specify
SYNC, then the binary data item will start from address 4. You might see some
wastage of memory, but the access to this

computational field is faster.

43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?

In COBOL II: 16777215

44. How do you reference the following file formats from COBOL programs:

Fixed Block File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,
BLOCK CONTAINS 0 .

Fixed Unblocked – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,
do not use BLOCK CONTAINS

Variable Block File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS
V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL
rec length will be max rec length in pgm + 4

Variable Unblocked – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS
V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie
JCL rec length will be max rec length in pgm + 4.

ESDS VSAM file – Use ORGANISATION IS SEQUENTIAL.

KSDS VSAM file – Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE
RECORD KEY IS

RRDS File – Use ORGANISATION IS RELATIVE, RELATIVE KEY IS

Printer File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,
BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).

45. What are different file OPEN modes available in COBOL?

Open for INPUT, OUTPUT, I-O, EXTEND.

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

OUTPUT, EXTEND

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

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?

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

49. What is file status 92?

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 ?

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,Dynamic linking ?

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

These are compile/link edit options.

AMODE – Addressing mode. RMODE – 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?

DYNAM.

54. What is SSRANGE, NOSSRANGE ?

These are compiler options w.r.t 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?

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?

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?

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.

Report writer is supported only in OS/VS Cobol.

USAGE IS POINTER is supported only in VS COBOL II.

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

EVALUATE is supported only in VS COBOL II.

Scope terminators are supported only in VS COBOL II.

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

Under CICS Calls between VS COBOL II programs are supported.

Gifts2DOOR.com’s blog

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

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 ?
  • In non-CICS environment, it is possible. In CICS, this is not possible.