Ibm-jcl&vsam Placement Papers - Ibm-jcl&vsam Interview Questions and Answers updated on 27.Jul.2024

Q1. Explain In Brief What Are The 3 Types Of Vsam Files?

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.

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

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.

Q3. Can You Name Some Common Vsam Error Conditions And Codes?

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.

Q4. To Use The Rewrite Command, How Should The Vsam File Be Opened?

It should be opened Input/Output mode.

Q5. Explain In Brief Why Do Vsam Take More Disk Space Than Other Utilities?

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.

Q6. Name The Utility Program Closely Associated With Vsam?

IDCAMS is the utility, the access method services utility.

Q7. What Do You Mean By Include Statement In Jcl?

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.

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

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

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

Q9. What Is Meant By S0c-07 System Abend Codes?

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.

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

TIME=1440

Q11. What Do You Mean By The Repro Command?

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.

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

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.

Q13. Define Cond Parameter In Jcl?

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.

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

For a KSDS, the ORGANIZATION is INDEXED.

Q15. Explain What Is The Meaning Of Dynamic Processing In Vsam?

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

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

They are INDEX, DEFINE CLUSTER and DATA.

Q17. How Can You Load A Vsam Data Set With Records ?

For loading we can use the REPRO command.

Q18. How Many Types Of Libraries Are There In Jcl?

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.

Q19. Explain The Meaning And Syntax For The Start Command?

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.

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

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.

Q21. What Do You Mean By Recovery And Speed Parameters In Define Cluster Command?

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.

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

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.

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

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

Q24. What Do You Mean By The Cobol Record Key Clause In Vsam?

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

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

  • ALTER is used for modification of information for a catalog, alternate index, cluster or path.
  • BLDINDEX is used to build the alternate index.
  • DEFINE is used for ALTERNATEINDEX, CLUSTER or PATH.
  • 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.

Q26. Explain How Do You Define A Gdg In Vsam?

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) 

Q27. Explain How Can You Initialize A Vsam File Before Any Operation?

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

Q28. Explain In Brief How Are Different Versions Of Gdg Named?

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

Q29. Explain What Do You Mean By A Upgrade Set In Vsam?

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.

Q30. What Do You Mean By Idcams? Explain Its Purpose?

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.

Q31. What Do You Mean By Define Model Parameter?

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

Q32. What Will Happen If There Is No Secondary Allocation Made For Datasets?

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

Q33. How To Pass The Temp Dataset Form One Job Step To Another?

By specifying the DISP as PASS for the temp dataset.

 

Q34. What Are S0c1, S0c4, S0c5, S0c7 Abends?

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

Q35. Explain What Is A Base Cluster In Vsam?

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.

Q36. How Can You Copy To A Vsam Cluster?

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

Q37. Differentiate Between Sequential Files And Esds Files In Vsam?

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.

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

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

Q39. How Do You Submit A Jcl Under Cics Environment?

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.

Q40. What Are The Different Types Of Vsam Datasets?

  • Entry sequenced Datasets (ESDS),
  • Key sequenced Datasets (KSDS) and relative record
  • Dataset (RRDS), LDS (linear Data Set)

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

i) Skip and Count :
Syntax:
SKIP(2)
COUNT(4)

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 -
INDATASET (CUSTOMER.KSDS.CLUSTER) -
FROMKEY (111111) -
TOKEY (444444)
Will print all records with Key value ranging from 111111 to 444444.
iii) FROMADDRESS and TOADDRESS.
iv) FROMNUMBER and TONUMBER.

Q42. How Do You Submit Jcl Via A Cobol Program?

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.

Example: MOVE '//TESTJOB JOB 1111,VISVEISH' TO JCL-REC.MOVE '//STEP01 EXEC
PGM=IEFBR14' TO JCL-REC.and close this file. Then TESTJOB will be submitted.

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

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.

Q44. What Do You Mean By Gdg In Vsam?

GDG me Generation Data Group.

Q45. Why Do You Use A Control Card?

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.

Q46. Can You Delete Vsam Files With The Delete Option Of The Disposition Parameter Of Jcl?

 

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

Q47. Explain How Many Ways You Can Load Data In A Vsam Cluster?

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

 

Q48. Explain What Is The Significance Of The Shareoptions Parameter?

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

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

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.

Q50. Explain In Brief How You Can Create A Vsam File?

You use the IDCAMS utility with the DEFINE CLUSTER option.