The free IBM-Software Program IDCAMS is used to create, alter, load and delete VSAM Files. I am going to elaborate, on how you write a job to run the IDCAMS Software to create a new KSDS-File. The IDCAMS Software expects you two supply two important files – //SYSPRINT File and //SYSIN File. The skeleton of the job, that you must write to run IDCAMS Software is shown in this picture.
To tell IDCAMS, what to do, you type Control Instructions or Commands, which IDCAMS Software understands in the //SYSIN DD File. Here are some of the commands, that you can issue to IDCAMS - 1. DEFINE Command to create a new Object. 2. ALTER Command to alter an existing Object. 3. DELETE Command to delete objects. 4. PRINT Command to Print the contents of an Object. 5. REPRO Command to take Backups. You must understand, how to write the Control-Card which contains the Special-Instructions for IDCAMS Software. |
You type the DEFINE CLUSTER Command to create a new KSDS File. The model or format of this Command is shown in the picture below.
You type IDCAMS Commands like DEFINE, ALTER, DELETE etc. beginning from Column 03. Also, if the Command spans across several lines, you must put a continuation character '-' in Column 72. NAME – The NAME Parameter specifies the name of the VSAM File to be created newly. TRACKS – The space allocation of the VSAM File is in terms of Tracks. This says, my new VSAM File will occupy 10 Tracks of Primary Space, and shall grow by 10 Tracks of secondary, when full. You may specify CYLINDERS or RECORDS as well. VOLUMES – The VOLUMES Parameter specifies one or more DASD Volumes on which the VSAM File may be created. CONTROLINTERVALSIZE – The CISZ Parameter tells the size of the Control-Interval in the VSAM File in Bytes. Generally, you would skip off this, and let AMS decide the best CI Size. It defaults to 4096 Bytes. ERASE or NOERASE – The ERASE Parameter specifies, that when the Cluster is Deleted, the space must be over-written with Binary Zeroes, prior to marking the space free for Re-use. FREESPACE(ci ca) – FREESPACE Parameter specifies the percentage of space to be left unallocated for future expansion. If no FREESPACE is specified, the Control-Intervals will be filled upto the brim. IMBED and REPLICATE – These options are now obsolete. IMBED specifies that the Sequence-Set Records are to be embedded with the Data in Data-Cluster. Without Embedding, the Sequence-Set Records are kept with the Index-Set Records in the Index Cluster. KEYS(length offset) – This is used to tell the Key Column in the VSAM File. 3 is the length of the Key, and it is at a Displacement of 0 Bytes from the Column 1. RECORDSIZE(avg max) – This tells average and Maximum length of the Logical-Reocrds in the VSAM File. For Fixed-Length records, avg=max. INDEXED, NONINDEXED and NUMBERED – This tells the Type of Cluster – KSDS(Data is accessed using Key Value), ESDS(Data is accessed using RBA), and RRDS(Data is accessed using Relative Record Number) respectively. |