VSAM Interview Questions

Showing Questions 1 - 4 of 4 Questions
Sort by: 
 | 
Jump to Page:
  •  

    How do you split a file data into multiple files?

    Explain with example?

    Star Read Best Answer

    Editorial / Best Answer

    jjtharappel  

    • Member Since Nov-2011 | Nov 24th, 2011


    Run a JCL with the below sort step

    Code
    1. //STEP1    EXEC PGM=SORT                            
    2. //SORTIN   DD DSN=input-file-name,DISP=SHR          
    3. //SORTOF01 DD DSN=output-file-name-1,          
    4. //            DISP=(NEW,CATLG,DELETE),              
    5. //            SPACE=...
    6. //            LRECL=...,RECFM=FB    
    7. //SORTOF02 DD DSN=output-file-name-2,          
    8. //            DISP=(NEW,CATLG,DELETE),              
    9. //            SPACE=...
    10. //            LRECL=...,RECFM=FB                    
    11. //SORTOF03 DD DSN=output-file-name-3,          
    12. //            DISP=(NEW,CATLG,DELETE),              
    13. //            SPACE=...
    14. //            LRECL=...,RECFM=FB                        
    15. //SYSOUT   DD SYSOUT=*                              
    16. //SYSIN    DD *                                      
    17.   SORT FIELDS=COPY                                        
    18.   OUTFIL FNAMES=SORTOF01,                                
    19.    INCLUDE=(cond for file 1)  
    20.   OUTFIL FNAMES=SORTOF02,                                
    21.    INCLUDE=(cond for file 2)  
    22.   OUTFIL FNAMES=SORTOF03,                                
    23.    INCLUDE=(cond for file 3)
    24. /*
    25. //*
    26.  

    Haribabu

    • Oct 15th, 2019

    SORT FIELDS=COPY
    OUTFIL FILES=OUT1,ENDREC=10000
    OUTFIL FILES=02,STARTREC=10001,ENDREC=20000 OUTFIL FILES=03,STARTREC=20001,ENDREC=30000

    also possible for OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLIT=10000

    Rishu

    • Jul 31st, 2014

    In addition to the above solution, we can use SPLIT BY in SORT. But it will depend on condition of split.

  •  

    What is the default size of the record

    Star Read Best Answer

    Editorial / Best Answer

    nlarsensmith  

    • Member Since May-2009 | Dec 1st, 2010


    If the record size parameter is not specified when the cluster is created, then the size is determined by the size of the Control Interval.

    kumar

    • Jul 3rd, 2014

    For non spanned--(4089,4089)
    for spanned---(4086,32600)

  •  

    Define KSDS

    How will you define a KSDS of avg length-100 and max length-150 and key length 10

    Star Read Best Answer

    Editorial / Best Answer

    Yaswanth kodali  

    • Member Since Jul-2010 | Jul 12th, 2010


    We can define the KSDS cluster by two ways by using the file-aid or by using the IDCAMS Utlity..

    By using the IDCAMS utility we can define the record with average length 100 and maximum length 150 with keylength 10 starting at 0 as follows

    //step01 EXEC pgm=IDCAMS
    //SYSIN DD *

       DEFINE CLUSTER(NAME(userid.name.sample) -
                                   VOLUMES(MVS801)              -
                                   RECORDSIZE(100 150)        -
                                   TRACKS(10 20)
                                   KEYS(10 0)                          -
                                   INDEXED  )                          -
                        DATA ( NAME(userid.name.sample.data))  -
                        INDEX( NAME(userid.name.sample.index)) -     
    /*
    // 

  •  

    How do you convert flat files to VSAM files?

    kousikgeek

    • Oct 25th, 2008

    Following steps will convert a sequential file to VSAM file.1. Sort the sequential fille, with SORT FIELD=NONE, to remove the duplicate key records.2. Define a VSAM file3. Use REPRO to copy the sequential file to VSAM file.

    Etnad

    • Nov 18th, 2007

    You can convert flat files to VSAM:1. Identify what will be your primary key. If you don't want to, the whole record can be?your primary key.2. Sort the file by primary key or the whole record (if no...