Below are the 3 types of VSAM files.
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.
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.
It should be opened Input/Output mode.
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.
IDCAMS is the utility, the access method services utility.
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.
It is used to define the cross-region and cross-system sharing capabilities of the DataSet. Syntax is SHR (CRvalue CSvalue)
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.
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:
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.
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.
For a KSDS, the ORGANIZATION is INDEXED.
Dynamic processing me one program uses both sequential and random processing for a VSAM KSDS file. It is however rarely used in VSAM.
They are INDEX, DEFINE CLUSTER and DATA.
For loading we can use the REPRO command.
Libraries are of three types: System
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.
We can fix it by the following.
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.
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.
The three possibilities for ACCESS can be RANDOM, SEQUENTIAL or DYNAMIC.
The RECORD KEY in the SELECT clause identifies the files Primary Key as it will be made available to the program.
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)
You can write a dummy program that will just open the file for output and thereafter closes it.
base-file-name.GnnnnnV00 where nnnn= generation number (upto 255). nnnn will be 0000 for the 1st generation.
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.
IDCAMS, also known as Access Method Services, is used to perform the following tasks cited below.
DEFINE MODEL parameter specifies whether the MODEL parameter allows you to model your cluster by modelling it after an existing cluster.
VSAM will inform COBOL program of the problem and terminate the processing of the program.
By specifying the DISP as PASS for the temp dataset.
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.
With the help of the IDCAMS utility with the REPRO option.
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.
The code is: //*MAIN DEADLINE=(0700,B,012086)
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.
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 :
INDATASET (CUSTOMER.KSDS.CLUSTER) -
FROMKEY (111111) -
Will print all records with Key value ranging from 111111 to 444444.
iii) FROMADDRESS and TOADDRESS.
iv) FROMNUMBER and TONUMBER.
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.
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.
GDG me Generation Data Group.
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.
We cannot delete, you have to give a separate DELETE command in the VSAM cluster.
There are two ways to achieve that.Firstly by using the REPRO command and secondly by using COBOL program.
SHAREOPTIONS parameter specifies how the file may be shared between jobs and between batch and CICS Environments.
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.
You use the IDCAMS utility with the DEFINE CLUSTER option.