Wednesday, January 19, 2011

Temporary VSAM

Allocation:
Temporary VSAM data sets can be allocated by specifying RECORG=KS/ES/LS/RR (RECORG keyword is the dynamic allocation parameter) along with other parameters of DD statement as follows:

1.      Syntax for temporary KSDS:

//SORTVSAM     EXEC PGM=SORT
//SYSOUT          DD  SYSOUT=*                                   
//SYSPRINT        DD  SYSOUT=*
//INDD1             DD  DSN=&INFILE,DISP=SHR
//OUTDD1          DD  DSN=&&OUTFILE,DISP=(,PASS),                     
//                             RECORG=KS,SPACE=(CYL,(25,50),RLSE),             
//                             LRECL=4000,AVGREC=K,KEYLEN=11,KEYOFF=0            
//SYSIN              DD  *
    SORT FIELDS=COPY
//*

Where:

LRECL=(Maximum record size), KEYLEN=(KSDS key length), KEYOFF=(KSDS key location), STORCLAS=TEMP

2.      Syntax for temporary ESDS/LDS/RRDS:

RECORG=ES/LD/RR,LRECL=(Record length), STORCLAS=TEMP

Restrictions:

1. Multivolume temporary VSAM data sets is not permitted.
2. Temp VSAM cannot be referred once a job is complete.

1 comment:

  1. Please note that the RECORG option is used to create any VSAM dataset .You may even use this option to create VSAM dataset using the dummy utility i.e IEFBR14.

    ReplyDelete