VSAM Interview Questions

Showing Questions 41 - 44 of 44 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page:
  •  

    How we can access the last record from KSDS file ?

    Nandhakumar

    • Nov 19th, 2018

    Start is used to read a file dynamically (Some where in between the file), so its not needed for sequential read from end of the file. Moving High-values to Key field would absolutely work.

    Premasai

    • Jun 12th, 2010

    I dont think moving HIGH-VALUES will take you to the last record , as you need to access the record for which the key value is <= HIGH VALUES. And START KEY syntax does not allow you to search a ke...

  •  

    Splitting and merging of file using sort

    Hi,I have a file which contains 3 types of transactions with account number,transaction type and transaction creation date.The transaction types are 35,39 and 41.The file has duplicate records for all transactions(ie 2 records for each account number for each transaction).Now I need to remove the duplicate for the 39 type transaction alone and keep the remaining.That is only for the transaction type...

    manikanta

    • Feb 15th, 2019

    We can do it by ICETOOL by selecting the firs duplicate row only and rest of the rows based on the transtion type it will not copy.
    SELECT FROM(IN) TO(OUT) ON(starting post,length,CH) USING(CTL1) FIRST - it will copy the first records only.

    Rishu

    • Jul 31st, 2014

    It is not possible to do it in single SORT step. 2 steps are required. First, extract all 39 type transaction record using EXCLUDE statement. Second, remove duplicate from step 1 file with SUM FIELDS=NONE. Third, merge output from step1 and 2.

  •  

    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.

Showing Questions 41 - 44 of 44 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page: