DEFV (Define VSAM Statements)

Purpose
This function produces IDCAMS define statements for one or more VSAM data sets to an output data set defined to DD FMNDEFV.
Figure 1. Syntax

1 DEFV
2? DSNLIST=(+ ,dsn1,dsn2,...dsnN)
1! SMS=NO
1 SMS=YES
1! NAMES=NO
1 NAMES=YES
1! CATALOG=NO
1 CATALOG=YES
5 TYPES=(+ ,type_n)

Where,

DSNLIST
Is a list of comma delimited data set names. A fully qualified or generic data set name can be specified. Only VSAM clusters matching the data set names specified are included in the DEFINE statements produced.

In a generic name, use the percent (%) sign to represent a single character, and an asterisk (*) to represent any number of characters within one qualifier. Two asterisks (**) represent any number of characters within any number of qualifiers.

SMS
Determines whether to generate the DATACLASS, MANAGEMENTCLASS and STORAGECLASS values.
NO
Default.
YES
Specify SMS=YES to generate the DATACLASS, MANAGEMENTCLASS and STORAGECLASS values, if they are known, for the associated data set.
NAMES
NO
Default.
YES
Specify NAMES=YES to generate the Data and Index component name for cluster definitions.
CATALOG
NO
Default.
YES
Specify CATALOG=YES to generate the catalog name.
TYPES
Specify one or more of the following values, separated by commas, in parentheses to filter the data set types to be processed. See Example 3. All keywords and all types and Example 4. Only produce defintion statements for Alternate Index and Paths to see how values are specified.
VSAM
Default. VSAM cluster definitions.
ALL
VSAM, alternate index, path, and GDG matching data set names.
AIX
Alternate index types are included.
PATH
PATHs are included.
GDG
Generate data set definitions are included.
Example 1. Batch job
//FMBAT EXEC PGM=FMNMAIN                
//FMNDEFV DD SYSOUT=*                  
//SYSPRINT DD SYSOUT=*                  
//SYSIN DD *                            
$$FILEM DEFV ,                          
$$FILEM DSNLIST=(FMN.FMDATA.K*,         
$$FILEM FMN.FMDATA.ESDS,                
$$FILEM userid.FMDATA.**)              
Example 2. REXX exec for usage with ISPF 3.4
/* REXX - VSAM define statements for data set  */         
ARG DSN                                                   
CALL FMNELIBD DEF       /* Remove if not using LIBDEFS */ 
ADDRESS TSO                                               
  "ALLOC FI(FMNPRINT) DA(*) REUSE"                        
  "ALLOC FI(FMNDEFV) NEW SP(1,5) TRACKS"                  
ADDRESS ISPEXEC                                           
  "SELECT CMD(FILEMGR $DEFV DSNLIST=("DSN")"              
  "LMINIT DATAID(DEFID) DDNAME(FMNDEFV) ENQ(SHR)"         
  IF RC = 0 THEN DO;                                      
    "VIEW DATAID("DEFID")"                                
    IF RC > 8 THEN                                        
      "SETMSG MSG("ZERRMSG")"                             
    "LMFREE DATAID("DEFID")"                              
  END;                                                    
ADDRESS TSO                                               
  "FREE FI(FMNPRINT)"                                     
  "FREE FI(FMNDEFV)"                                      
CALL FMNELIBD DROP      /* Remove if not using LIBDEFS */ 
EXIT 0;                                                   
Example 3. All keywords and all types
$$FILEM DEFV ,                           
$$FILEM DSNLIST=(FMN.VSAM.**), 
$$FILEM SMS=YES,                    
$$FILEM NAMES=YES,                       
$$FILEM CATALOG=YES,                     
$$FILEM TYPES=(ALL)    
          
Example 4. Only produce defintion statements for Alternate Index and Paths
$$FILEM DEFV ,                           
$$FILEM DSNLIST=(FMN.VSAM.**), 
$$FILEM TYPES=(AIX,PATH)