1

I have problem defining alternate index for my VSAM KSDS. It says

IDC3211I KEYWORD 'DATA' IS IMPROPER  

Here is my VSAM KSDS definition:

  DEFINE CLUSTER                            -    
       (NAME(IBMUSER.TEST.SAMPLE.KSDS)      -    
        VOLUMES(ZASYS1)                     -    
        TRACKS(15 15)                       -    
        INDEXED                             -    
        SHAREOPTIONS(1 3) UNIQUE            -    
        RECORDSIZE(100 100)                 -    
        KEYS(18 0)                          -    
      DATA(NAME(IBMUSER.TEST.SAMPLE.KSDS.DATA))- 
     INDEX(NAME(IBMUSER.TEST.SAMPLE.KSDS.INDEX)) 

This is my Alternate Index definition:

  DEFINE AIX (NAME(IBMUSER.TEST.SAMPLE.AIX)- 
  RELATE(IBMUSER.TEST.SAMPLE.KSDS)       -   
  CISZ(4096)                             -   
  FREESPACE(20,20)                       -   
  KEYS(20,19)                            -   
  NONUNIQUEKEY                           -   
  UPGRADE                                -   
  RECORDSIZE(61,61)                    -     
  DATA(NAME(IBMUSER.TEST.SAMPLE.AIX.DATA))-  
  INDEX(NAME(IBMUSER.TEST.SAMPLE.AIX.INDEX)) 

I don't get why it says keyword DATA is improper.

Hogstrom
  • 3,581
  • 2
  • 9
  • 25

1 Answers1

1

There are a few issues. The first one is a syntax issue in the command.

  DEFINE CLUSTER                                   -                          
       (                                           -                          
        NAME(IBMUSER.TEST.SAMPLE.KSDS)             -                          
        TRACKS(15 15)                              -                          
        INDEXED                                    -                          
        VOLUMES(ZMSHR1)                            -                          
        SHAREOPTIONS(1 3) UNIQUE                   -                          
        RECORDSIZE(100 100)                        -                          
        KEYS(18 0)                                 -                          
      DATA(NAME(IBMUSER.TEST.SAMPLE.KSDS.DATA))    -                          
IDC3211I KEYWORD 'DATA' IS IMPROPER                                           
     INDEX(NAME(IBMUSER.TEST.SAMPLE.KSDS.INDEX))                              
IDC3202I ABOVE TEXT BYPASSED UNTIL NEXT COMMAND. CONDITION CODE IS 12         

This is because you are missing a closing parenthesis after the KEYS clause which completes the CLUSTER section. Adding a closing parenthesis like follows will complete the DEFINE CLUSTER section.

  DEFINE CLUSTER                                   -
       (                                           -
        NAME(IBMUSER.TEST.SAMPLE.KSDS)             -
        TRACKS(15 15)                              -
        INDEXED                                    -
        VOLUMES(ZMSHR1)                            -
        SHAREOPTIONS(1 3) UNIQUE                   -
        RECORDSIZE(100 100)                        -
        KEYS(18 0)                                 -
       )                                           -
      DATA(NAME(IBMUSER.TEST.SAMPLE.KSDS.DATA))    -
     INDEX(NAME(IBMUSER.TEST.SAMPLE.KSDS.INDEX))
IDC0508I DATA ALLOCATION STATUS FOR VOLUME ZMSHR1 IS 0         
IDC0509I INDEX ALLOCATION STATUS FOR VOLUME ZMSHR1 IS 0        
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0      

When that is corrected you'll get another error because you need a space and volume specification for the AIX. Use the definition below that has the needed parameters for the AIX.

  DEFINE AIX                                       -
         (                                         -
          NAME(IBMUSER.TEST.SAMPLE.AIX)            -
          TRACKS(15 15)                            -
          VOLUMES(ZMSHR1)                          -
          RELATE(IBMUSER.TEST.SAMPLE.KSDS)         -
          CISZ(4096)                               -
          FREESPACE(20,20)                         - 
          KEYS(20,19)                              - 
          NONUNIQUEKEY                             - 
          UPGRADE                                  - 
          RECORDSIZE(61,61)                        - 
         )                                         - 
        DATA(NAME(IBMUSER.TEST.SAMPLE.AIX.DATA))   - 
       INDEX(NAME(IBMUSER.TEST.SAMPLE.AIX.INDEX))    

Complete JOB to accomplish the creation of the CLUSTER and the ALTERNATEINDEX follows. I formatted the statements to be more readable:

//IDCAMS   JOB CLASS=A,NOTIFY=&SYSUID               
//STEP0010 EXEC PGM=IDCAMS                          
//SYSPRINT DD  SYSOUT=*                             
//SYSIN    DD  *                                    
  DELETE IBMUSER.TEST.SAMPLE.KSDS                   
  DELETE IBMUSER.TEST.SAMPLE.AIX                    
  SET MAXCC = 0                                     
                                                    
  DEFINE CLUSTER(                                   -
                 NAME(IBMUSER.TEST.SAMPLE.KSDS)     -
                 TRACKS(15 15)                      -
                 INDEXED                            -
                 VOLUMES(ZMSHR1)                    -
                 SHAREOPTIONS(1 3) UNIQUE           -
                 RECORDSIZE(100 100)                -
                 KEYS(18 0)                         -
         )                                          -
         DATA(                                      -
           NAME(IBMUSER.TEST.SAMPLE.KSDS.DATA)      -
         )                                          -
         INDEX(                                     -
               NAME(IBMUSER.TEST.SAMPLE.KSDS.INDEX) -
         )    
                                                                                                        
  DEFINE AIX(                                       -
             NAME(IBMUSER.TEST.SAMPLE.AIX)          -
             TRACKS(15 15)                          -
             VOLUMES(ZMSHR1)                        -
             RELATE(IBMUSER.TEST.SAMPLE.KSDS)       -
             CISZ(4096)                             -
             FREESPACE(20,20)                       -
             KEYS(20,19)                            -
             NONUNIQUEKEY                           -
             UPGRADE                                -
             RECORDSIZE(61,61)                      -
            )                                       -
         DATA(                                      -
              NAME(IBMUSER.TEST.SAMPLE.AIX.DATA))   -
             )                                      -
         INDEX(                                     -
               NAME(IBMUSER.TEST.SAMPLE.AIX.INDEX)  -
              )         
/*                                                  
//                                                  
Hogstrom
  • 3,581
  • 2
  • 9
  • 25
  • 1
    Regarding VOLUMES: "This parameter is not required if the cluster is modeled or if the cluster is SMS-managed. You can specify VOLUMES for SMS-managed data sets; however, the volumes specified might not be used and, in some cases, can result in an error." https://www.ibm.com/docs/en/zos/2.5.0?topic=dap-required-parameters-1 – cschneid Nov 01 '21 at 22:46
  • On my ZDT system it was needed so I agree your mileage will vary. I presumed the OP was on a similar system due to his reference to ZMSHR1 – Hogstrom Nov 02 '21 at 02:53