Lab Procedure for VSAM Homework

To do VSAM programs, you will need to create three members in your JCL library:

  1. To define a cluster to allocate and make an entry in the catalog for the VSAM/KSDS.
  2. To execute the ASSEMBLER program.
  3. To list the records in the VSAM/KSDS created.

1. Create, save, and execute the member xxKSDS in your JCL library to contain the following statements:


//youruserid JOB (STUMVS),’your name',CLASS=A,MSGCLASS=D
//*
//STEP1      EXEC  PGM=IDCAMS
//SYSPRINT   DD    SYSOUT=*
//SYSIN      DD    *
    DELETE (youruserid.xxxx.KSDS) CLUSTER
    DEFINE   CLUSTER                 -
       (NAME(youruserid.xxxx.KSDS)       -
       RECORDS(50 20)                -
       RECORDSIZE(20 20)             -
       INDEXED)                      -
    DATA                             -
       (NAME(youruserid.xxxx.DATA)   -
       KEYS(20 0))                   -
    INDEX                            -
       (NAME(youruserid.xxxx.INDEX)  -
       IMBED)
/*
//

xxxx is the name for the VSAM file.

After saving the member, execute it by SUBmitting the job. View the resulting output from the execution in your System Output Display queue (i.e. the output class D file in the S.O screen). If the AMS commands (notice there are two AMS commands DELETE and DEFINE CLUSTER) executed successfully, a message will be displayed after each AMS command execution. After the DELETE, the message will be: Data set not found, function not completed, highest condition code is 08 (this message is okay as there is no file by that name exists in the catalog). After the execution of the DEFINE CLUSTER command, the message will be: Function completed, Highest condition code was 0.

2. You need to create a member (EXEC) in your JCL library to contain the JCL statements required to execute the ASSEMBLER program. The JCL statements required are as follows:


//jobname JOB (STUMVS),'your name',CLASS=P,MSGCLASS=P
// EXEC PROC=ASMACG
//C.SYSIN DD DSN=youruserid.SU.SOURCE(PROG1152),DISP=SHR
//G.INFILE DD DSN=youruserid.wwww.DATA,DISP=OLD
//G.MASDS DD DSN=youruserid.xxxx.KSDS,DISP=SHR
//G.SYSPRINT DD SYSOUT=(P,writer name,SLW8),DEST=STULAB
//G.OUTFILE DD DSN=youruserid.eeee.DATA,DCB=(RECFM=F,LRECL=80),
// DISP=(OLD,KEEP)

The jobname is your userid followed by a character.

The writer name is the computer lab id where you want to send the output.

xxxx is the name for the VSAM file.

wwww is the name of the data file you create of unsorted words to compare to the dictionary.

eeee is the name of output file for words that do not match a word in dictionary.

3. Create, save, and execute the member VSPRINT in you JCL library to contain the following statements:


//youruserid JOB (STUMVS),'your name',CLASS=A,MSGCLASS=D
//*
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//KSDSFL DD DSN=youruserid.xxxx.KSDS,DISP=SHR
//SYSIN DD *
PRINT INFILE (KSDSFL) CHARACTER
/*
//

After saving the member, SUBmit the job for execution. If executed successfully, the output class D will contain the listing of the data records you copied into the VSAM/KSDS file. Change the output class from D to P, enter the writer name, form name (SLW8) and the destination as STULAB which will result in a hard copy printout of the VSAM file you just created.

This ASSEMBLER program puts one record (ABC) in the VSAM file.


PRINTOUT START
            STM      14,12,12(13)                                       
            BALR     12,0                                               
            USING    *,12                                               
            ST       13,SAVEAREA+4                                      
            LA       13,SAVEAREA                                        
            B        INIT                                               
MASACB   ACB    DDNAME=MASDS,AM=VSAM,                                 X
               MACRF=(KEY,SEQ,OUT)                                      
MASRPL   RPL    ACB=MASACB,                                           X
               OPTCD=(KEY,SEQ,NUP,MVE,SYN),                           X
               AREA=RECORD,                                           X
               AREALEN=80,                                            X
               RECLEN=20                                                
TRANDCB  DCB    DDNAME=TRANDS,                                        X
               DSORG=PS,                                              X
               MACRF=GM,                                              X
               LRECL=80,                                              X
               BLKSIZE=80,                                            X
               RECFM=F                                                  
RECORD               DC     CL20'ABC'                                   
                     DC     CL60' '                                     
INIT  EQU *                                                             
*           OPEN     (DCB1,xxxx,DCB2,OUTPUT)                           
            OPEN     MASACB                                             
            PUT      RPL=MASRPL                                         
            CLOSE    MASACB                                             
            L        13,SAVEAREA+4                                      
            LM       14,12,12(13)                                       
            BR       14                                                 
SAVEAREA    DS       18F                                                
            END                                                         

 

The following is an example of the CLIST to view output file.


ALLOCATE DATASET (wwww.DATA) FILE(INFILE) OLD
ATTRIB A1X RECFM(F) LRECL (80)
ALLOCATE DATASET (eeee.DATA) FILE (OUTFILE) OLD
ALLOCATE DATASET (xxxx.KSDS) DDNAME (MASDS) OLD
TEST 'youruserid.SU.LOADLIB(programname)'