IBM-JCL&VSAM Interview Questions & Answers

  1. Question 1. What Do You Mean By Include Statement In Jcl?

    Answer :

    An INCLUDE statement identifies a member of a PDS that contains this set of JCL statements is called an INCLUDE group. The system replaces the INCLUDE statement with the statements in the INCLUDE group.

  2. Question 2. What Are S0c1, S0c4, S0c5, S0c7 Abends?

    Answer :

    • S0C1 (Operation Exception Error) – May be due to Missing or misspelled DD name ,Read/Write to unopened dataset ,Reading a dataset opened output mode Writing into a dataset opened input mode ,Called subprogram not found.
    • S0C4 may be due to Missing Select statement (during compile) ,Bad Subscript/index ,Protection Exception Missing parameters on called subprogram ,Read/Write to unopened file ,Move data from/to unopened file;
    • S0C5 May be due to Bad Subscript/index ,Close an unopened dataset ,Bad exit from a perform ,Access to I/O area (FD) before read;
    • S0C7 may be due to Numeric operation on non-numeric data ,Un-initialized working storage ,Coding past the maximum allowed subscript
    • S0CB might be due to 1.Division by Zero.
  3. VSAM Interview Questions

  4. Question 3. Why Do You Use A Control Card?

    Answer :

    A CONTROL CARD can be a member of a PDS or a sequential dataset and is used for storing the date fields, definitions of VSAM files etc., We use CONTROL CARD because we cannot use an in-stream procedure in a procedure. Generally you will be calling a PROC from your JCL and you cannot code instream procedure in the PROC and so you will point to the dataset, which is called controlcard.

  5. Question 4. How Do You Submit Jcl Via A Cobol Program?

    Answer :

    In your JCL define as:

    //JOBA JOB 1111,JOB1 //STEP01 EXEC PGM=PROG1 //ddname DD SYSOUT=
    (*,INTRDR)….and your COBOL (PROG1) should look like this: SELECT JCL-FILE ASSIGN TO ddname.
    Open this file and write the JCL statements into this file.

    PGM=IEFBR14′ TO JCL-REC.and close this file. Then TESTJOB will be submitted.

  6. VSAM Tutorial

  7. Question 5. How Do You Submit A Jcl Under Cics Environment?

    Answer :

    Pass all the JCL codes to a COBOL variable (should be declared using OCCURS clause) and then write the line one by one to the spool using CICS commands like SPOOLClose, SPOOLOpen and SPOOLWrite. For more help refer CECI of CICS or CICS manual.

  8. IBM – VSAM Interview Questions

  9. Question 6. What Is The Parameter To Be Passed In The Job Card For The Unlimited Time, Irrespective Of The Job Class?

    Answer :


  10. Question 7. Define Cond Parameter In Jcl?

    Answer :

    COND is a condition parameter, consists of 2 subparameters, 1st – return code from the previous step, 2nd – condition. If COND is true, the step on which COND is coded will be BYPASSED. It is compared with system return code of previous step //STEP1 EXEC PGM=ABCD //STEP2 EXEC PGM=XYZ, cond=(4,lt) STEP 2 will be executed when system return code of step1 is less than 4.

  11. IBM-CICS Tutorial
    IBM-CICS Interview Questions

  12. Question 8. What Is Meant By S0c-07 System Abend Codes?

    Answer :

    S0C7 – Data exception error – you will get it whenever you are trying to move the low values or spaces into the numeric field, or compare the numeric fields with low values, or try to do some arithmetic operations on the low values. To avoid this you have to always initialize the numeric fields otherwise they will contain the low values.

  13. Question 9. How To Pass The Temp Dataset Form One Job Step To Another?

    Answer :

    By specifying the DISP as PASS for the temp dataset.


  14. JCL Interview Questions

  15. Question 10. Write A Jcl To Execute A Job By 7:00 Am On Jan 20,1986?

    Answer :

    The code is: //*MAIN DEADLINE=(0700,B,012086)

  16. IBM DB2 Tutorial

  17. Question 11. How Many Types Of Libraries Are There In Jcl?

    Answer :

    Libraries are of three types: System

    1. Libraries:- such as SYS1.LINKLIB Private 
    2. Libraries:- Specified in a JOBLIB or STEPLIB DD STATEMENTS.
    3. Temporary Libraries:- Created in a previous step of the Job.
  18. IBM DB2 Interview Questions

  19. Question 12. What Do You Mean By The Repro Command?

    Answer :

    Whenever a new cluster is created using IDCAMS, the cluster will be empty. By the use of REPRO command, we are able to load records into the cluster. REPRO is used to:

    • Copy Datasets (VSAM or NON-VSAM), copy catalogs.
    • Conversion of sequential and index sequential Datasets to VSAM format.
    • Backup VSAM catalog
    • Conversion of VSAM and Index sequential Datasets to sequential format
    • Read a backup copy of VSAM catalogs.
  20. VSAM Interview Questions

  21. Question 13. What Do You Mean By Recovery And Speed Parameters In Define Cluster Command?

    Answer :

    The parameters RECOVERY (default) and SPEED are mutually exclusive. Recovery is used to pre-format the control areas during the initial DataSet load, if the job fails, you can restart but you must have a recovery routine already written to restart the job. SPEED does not pre-format the CAs. It is advisable that you specify SPEED to speed up your initial data load.

  22. COBOL Tutorial

  23. Question 14. Is It Slower If You Access A Record Through Alternative Index As Compared To Primary Index?

    Answer :

    Yes it slower because the alternate Key would first locate the primary Key, which in turn locates the actual record. It requires twice the number of I/Os.

  24. Question 15. What Do You Mean By A Shareoptions Parameter (shr) In Define Cluster Command?

    Answer :

    It is used to define the cross-region and cross-system sharing capabilities of the DataSet. Syntax is SHR (CRvalue CSvalue)

    1. means multiple read OR single write (read integrity).
    2. means multiple read AND single write (Write integrity).
    3. means Multiple read AND multiple write.
    4. is same as 3, which refreshes the buffer with every random access. Default is SHR(1 3).
  25. COBOL Interview Questions

  26. Question 16. Explain What Are The Optional Parameters To The Input Dataset While Loading The Empty Cluster With The Data Records?

    Answer :

    i) Skip and Count :

    In this case, the first two records are skipped and the next four records are printed. The default for SKIP is 0, and for COUNT will be printing records from beginning to end.

    ii) FromKey and ToKey :
    PRINT –
    FROMKEY (111111) –
    TOKEY (444444)
    Will print all records with Key value ranging from 111111 to 444444.

  27. DB2 Using SQL Tutorial

  28. Question 17. Is Delete Operation Supported In An Esds? Is Rewrite Operation Possible In Esds?

    Answer :

    The delete operation is not supported. Delete operation is not possible in VSAM ESDS. Yes, rewrite operation is possible in an ESDS.

  29. DB2 Using SQL Interview Questions

  30. Question 18. Can You Delete Vsam Files With The Delete Option Of The Disposition Parameter Of Jcl?

    Answer :


    We cannot delete, you have to give a separate DELETE command in the VSAM cluster.

  31. IBM – VSAM Interview Questions

  32. Question 19. What Do You Mean By Gdg In Vsam?

    Answer :

    GDG means Generation Data Group.

  33. IMS/DB Tutorial

  34. Question 20. Can You Tell Me What Are The Codes Returned By The Ams (access Method Services) Command During The Execution In Vsam?

    Answer :

    Every AMS command issues a condition code. If multiple commands are being executed successively, there might be a requirement to execute or bypass certain commands on the Success or failure of a previous command. The normal condition codes returned by AMS commands are :

    0 – The function was executed successfully.
    4 – A problem was encountered while executing the function, WARNING.
    8 – The requested function was executed, but major specifies were unavoidably bypassed,ERROR.
    12 – The requested command could not be performed because of a logical error, SEVERE.
    16 – A severe error occurred causing the remainder of the command stream to be bypassed., FATAL.

  35. IMS/DB Interview Questions

  36. Question 21. Explain In Brief How You Can Create A Vsam File?

    Answer :

    You use the IDCAMS utility with the DEFINE CLUSTER option.

  37. Question 22. How Can You Copy To A Vsam Cluster?

    Answer :

    With the help of the IDCAMS utility with the REPRO option.

  38. Question 23. Can You Tell Me How Many Buffers Are Allocated To Vsam Ksds And Esds?

    Answer :

    There are 2 data buffers by default for ESDS. For KSDS it allots 2 data buffers and 1 index buffers. Each buffer is about 4k.

  39. Mainframe DB2 Interview Questions

  40. Question 24. Explain In Brief What Are The 3 Types Of Vsam Files?

    Answer :

    Below are the 3 types of VSAM files.

    1. ESDS (Entry sequenced dataset). DB2 uses a special type of ESDS.
    2. RRDS (Relative record dataset). Records are accessed using a relative number.
    3. KSDS (Key sequenced dataset) is the most common type encountered. The record sequence is determined by a unique key field.
  41. IBM-CICS Interview Questions

  42. Question 25. Explain What Do You Mean By A Upgrade Set In Vsam?

    Answer :

    The upgrade set is the list of all AIXs that VSAM must be maintaining for a specific base cluster, so that when data in the base cluster is modified or updated, the AIX files are also updated.

  43. Question 26. Explain What Is A Base Cluster In Vsam?

    Answer :

    The base cluster in VSAM consists of the data component as well as the index component that is required for the primary index of a KSDS.

  44. Question 27. In A Cobol Select Statement, Can You Tell What Is The Organization For A Ksds?

    Answer :


  45. JCL Interview Questions

  46. Question 28. In A Cobol Select Statement For A Ksds Can You Tell Me What Are The 3 Possibilities For Access?

    Answer :

    The three possibilities for ACCESS can be RANDOM, SEQUENTIAL or DYNAMIC.

  47. Question 29. What Will Happen If There Is No Secondary Allocation Made For Datasets?

    Answer :

    VSAM will inform COBOL program of the problem and terminate the processing of the program.

  48. Question 30. What Do You Mean By Idcams? Explain Its Purpose?

    Answer :

    IDCAMS, also known as Access Method Services, is used to perform the following tasks cited below.

    • Createing a VSAM data set, VSAM alternate index, or catalog.
    • Conversion of non-VSAM to VSAM data set.
    • Listing a catalog entry for a data set, Dataset/catalog contents.
    • Copy a Dataset or catalog.
    • Loading of a VSAM Dataset from VSAM records
    • Renaming of VSAM data sets.
  49. Question 31. Why Ci And Ca Splits Are Not Possible In Esds And Rrds?

    Answer :

    In ESDS the new record is added at the end of last record. And no embedded free space is allocated at the time of Dataset definition. In the case of RRDS the slots for the records are pre-allocated and so the CI and CA split is not possible.

  50. Question 32. Is It Required That Primary Key Values Have To Be Unique? Do Alternate Key Values Have To Be Unique?

    Answer :

    Primary Key values must always be unique however alternate Key values need not be unique all the time.

  51. Question 33. What Do You Mean By The Cobol Record Key Clause In Vsam?

    Answer :

    The RECORD KEY in the SELECT clause identifies the files Primary Key as it will be made available to the program.

  52. IBM DB2 Interview Questions

  53. Question 34. What Is The Use Of The File Status Clause In The Select Statement In Vsam?

    Answer :

    The FILE STATUS field is used to identify the field that VSAM uses to provide information about each I/O Operation for the file.

  54. Question 35. To Use The Rewrite Command, How Should The Vsam File Be Opened?

    Answer :

    It should be opened Input/Output mode.

  55. Question 36. What Do You Mean By A Vsam Split?

    Answer :

    If there is a memory crunch and there is not enough space in the Control Interval, VSAM performs a Control Interval split by moving some records to the free Control Intervals. If there isn’t a free Control Interval,then VSAM performs a control area split by allocating a new control area and moving half of the Control Intervals to it.

  56. COBOL Interview Questions

  57. Question 37. Explain The Meaning And Syntax For The Start Command?

    Answer :

    In VSAM, the START command is used to read other than the next VSAM record. For this, A value must be moved into the RECORD KEY. However, the KEY clause is optional, but it can be used to specify a relational operator.

  58. Question 38. Explain What Is The Meaning Of Dynamic Processing In Vsam?

    Answer :

    Dynamic processing means one program uses both sequential and random processing for a VSAM KSDS file. It is however rarely used in VSAM.

  59. Question 39. Can You Name Some Common Vsam Error Conditions And Codes?

    Answer :

    They are end of file (10), duplicate Key (22), record not found (23), Out of space condition is raised (28) ,VSAM logic error (90), open problem (92) and space problem (93).bIt is a COBOL II enhancement to VSAM batch processing expanding the FILE STATUS field.It is defined in WORKING – STORAGE as a six byte group item with three two byte elements, the normal return code, the function code and the feedback code.

  60. Question 40. What Do You Mean By A Vsam Slot?

    Answer :

    VSAM slot is a relative record Dataset (RRDS) consists of a specified number of areas called slots. Each slot is identified by a relative record number (RRN) which indicates its relative position in the file.

  61. DB2 Using SQL Interview Questions

  62. Question 41. Name The Utility Program Closely Associated With Vsam?

    Answer :

    IDCAMS is the utility, the access method services utility.

  63. Question 42. There Are Seven Idcams Commands In Vsam. Can You Name And Explain Each Of Them?

    Answer :

    • ALTER is used for modification of information for a catalog, alternate index, cluster or path.
    • BLDINDEX is used to build the alternate index.
    • DELETE is used to remove the catalog entry for a catalog, cluster, alternate index or path.
    • LISTCAT is for listing Information about the Dataset.
    • PRINT is used to print the Dataset contents.
    • REPRO is used to copy records from one file to another.
  64. IMS/DB Interview Questions

  65. Question 43. Can You Tell Me What Are The Three Levels Of Definition For The Vsam Define?

    Answer :


  66. Question 44. Explain What Is The Significance Of The Shareoptions Parameter?

    Answer :

    SHAREOPTIONS parameter specifies how the file may be shared between jobs and between batch and CICS Environments.

  67. Question 45. What Do You Mean By Define Model Parameter?

    Answer :

    DEFINE MODEL parameter specifies whether the MODEL parameter allows you to model your cluster by modelling it after an existing cluster.

  68. Question 46. Can You Tell Me How Do You Fix The Problem Associated With Vsam Out Of Space Condition?

    Answer :

    We can fix it by the following. 

    • By defining new VSAM Dataset allocated with more space.
    • By using IDCAMS to REPRO the old VSAM file to new VSAM Dataset.
    • By using IDCAMS to ALTER / rename the old VSAM Dataset or set IDCAMS to DELETE the old VSAM Dataset.
    • By using IDCAMS to ALTER / rename the new VSAM Dataset to the name of the original VSAM Dataset.
  69. Question 47. Explain How Many Ways You Can Load Data In A Vsam Cluster?

    Answer :

     There are two ways to achieve that.Firstly by using the REPRO command and secondly by using COBOL program.


  70. Question 48. What Will Happen When You Try To Open An Empty Vsam File In A Cobol Program For Input?

    Answer :

    A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.

  71. Question 49. Explain How Can You Initialize A Vsam File Before Any Operation?

    Answer :

    You can write a dummy program that will just open the file for output and thereafter closes it.

  72. Question 50. Can You Tell Me What Does A File Status Of 02 On A Vsam Signifies?

    Answer :

    It indicates duplicate alternate key. It happens on both input and output operation.

  73. Question 51. How Can You Load A Vsam Data Set With Records ?

    Answer :

    For loading we can use the REPRO command.

  74. Question 52. Differentiate Between Sequential Files And Esds Files In Vsam?

    Answer :

    In VSAM, Sequential(QSAM) files can be created on tape while ESDS files cannot be created. Again, you can have ALTINDEX for an ESDS while no such facility that exists for QSAM files.

  75. Question 53. Explain How Do You Define A Gdg In Vsam?

    Answer :

    We can use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0) 

  76. Question 54. Is It Necessary That All Versions Of The Gdg Have To Be Of The Same Record Length?

    Answer :

    It is not required, the DCB of the model dataset can be overridden when you allocate new versions.

  77. Question 55. Explain In Brief How Are Different Versions Of Gdg Named?

    Answer :

    base-file-name.GnnnnnV00 where nnnn= generation number (upto 255). nnnn will be 0000 for the 1st generation.

  78. Question 56. What Are The Additional Information You Should Give In The Dd Statement While Defining The Next Generation Of A Gdg?

    Answer :

    Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can give the dcb parameter if you want to override the dcb of the model dataset.

  79. Question 57. When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File’s Organisation ?

    Answer :

    You can use the LISTCAT command.

  80. Question 58. What Are The Different Types Of Vsam Datasets?

    Answer :

    • Entry sequenced Datasets (ESDS),
    • Key sequenced Datasets (KSDS) and relative record
    • Dataset (RRDS), LDS (linear Data Set)
  81. Question 59. Can You Tell Me How Are Records Stored In An Esds, Entry Sequenced Dataset?

    Answer :

    They are stored without respect to the contents of the records and in the order in which they are included in the file.

  82. Question 60. Explain In Brief Why Do Vsam Take More Disk Space Than Other Utilities?

    Answer :

    VSAM increases the disk space requirements of systems. This is because VSAM offers certain capabilities like partial self-reorganization to make things more efficient in data sets that can be modified.

  83. Question 61. Can You Specify Some The Distinctive Features Of A Ksds, Key Sequenced Dataset?

    Answer :

    The index and the distributed free space. CI and CA splits upon updates. Record length may be changed during the time of update. The records are accessed by a particular Key in KSDS.