1

I have created a sequential file with some records. I have to copy them to a KSDS cluster. So i wrote a JCL for it. When i give numerals in my sequential file it is working but when i give english alphabet letters it is not working.

why is that??


THIS IS MY CODE FOR CREATING KSDS Cluster
 //TRC186H JOB (TRC,TRC,TRC186,D2,DT99X),CLASS=A,   
 //      MSGLEVEL=(1,1),MSGCLASS=C,NOTIFY=&SYSUID   
 //STEP1 EXEC PGM=IDCAMS                            
 //SYSPRINT DD SYSOUT=*                             
 //SYSIN DD *                                       
    DEFINE CLUSTER -                                
    (NAME(TRC186.VSAM.CASE.CLUSTER) -                
    TRACKS(2,2) -                                    
    CONTROLINTERVALSIZE(4096) -                      
    INDEXED -                                        
    KEYS(6,1) -                                      
    FREESPACE(10,10)) -                              
    DATA -                                          
    (NAME(TRC186.CASE.DATA) -                      
     RECORDSIZE(180 180)) -                         
      INDEX -                    
      (NAME(TRC186.CASE.INDEX) - 
       CONTROLINTERVALSIZE(4096)) 
 /*             


And this is my code for copying from sequential file to KSDS cluster

  //TRC186A JOB (TRG),CLASS=A,MSGLEVEL=(1,1),MSGCLASS=A, 
  //          NOTIFY=&SYSUID                             
  //STEP1 EXEC PGM=IDCAMS                                
  //INPUTDD  DD DSN=TRC186.VSAM.INPUTPS,DISP=OLD         
  //SYSPRINT DD SYSOUT=*                                 
  //SYSIN DD *                                           
       REPRO -                                              
       INFILE(INPUTDD) -                                    
       OUTDATASET(TRC186.VSAM.CASE.CLUSTER)                 
  /*    


The inputs that i have given are

123456
234567
345678
456789
567891

they are easily being copied butwhen i give english alphabet letters like-
abcdefg
cdhert
kjsdfg
qwerty
kjhgfd

This is not being copied to cluster.

please explain why?

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
VIBHAV PANDEY
  • 65
  • 2
  • 9
  • There may be other problems as well. What we need to see is a paste into your question of the "sysout" output you are getting from the IDCAMS step. I should have asked earlier :-) – Bill Woodger Oct 10 '14 at 09:56

1 Answers1

1

Your KEYS in the definition of your KSDS specify 6,1. You will want to check if that is what you want.

When loading a KSDS with REPRO the data must be in key sequence already. The numeric data you have shown is coincidentally in key sequence, the alphabetic data not.

If you precede your IDCAMS step with a SORT step, then you should be clean. However, review the way VSAM wants the key, and compare with the way SORT wants the key. That's the way it is.

A KEY definition for a KSDS on an IDCAMS DEFINE has a particular format. First you specify the length, which you did correctly, and then you specify the offset. What the offset means is "bytes from the starting point of the record". So, offset zero is byte one (or column one), offset one (which you specified) is byte two of the record, meaning that your numeric example is still in order (a bit of a fluke) but your alphabetics are not, they need to be in order on the second letter with the particular DEFINE you used.

Bill Woodger
  • 12,968
  • 4
  • 38
  • 47
  • sorry I gave an extra 'g' here in first row. I have written it correctly there and yes i want 6,1. I have not written any sort code but still its working in sorted manner only. – VIBHAV PANDEY Oct 10 '14 at 09:20
  • It will only work if the data you give for a REPRO to a KSDS are in sequence. It doesn't matter if you do that manually (as with your number example) or with a SORT step. Your numeric data is in order, your alphabetic data is not. You can manually rearranged your alphabetic data if you like, but until it is in order it won't work. Can you explain in words what you think 6,1 means on the DEFINE for the KSDS? – Bill Woodger Oct 10 '14 at 09:26
  • I am sorry. I don't understand how to give English alphabet letters in order. By (6,1) it specifies that 1 is the offset and 6 is the length of the key value that u are giving. It means that i have started from column 1 and ended on column 6. At-least, i think so. – VIBHAV PANDEY Oct 10 '14 at 09:35
  • abcdefghijklmnopqrstuvwxyz. Ok, with the key it is as I thought. Offset zero is start in column 1. Offset 1 is start in column 2. – Bill Woodger Oct 10 '14 at 09:47
  • i gave output like abcdef ghijkl mnopqr stuvwx. Its not working. – VIBHAV PANDEY Oct 10 '14 at 09:52
  • Yes, but that crossed with my comment about the key. I'll update the answer, but the other stuff will be useful as well. – Bill Woodger Oct 10 '14 at 09:59
  • It's working now. i gave english letter in 2nd column and it worked. – VIBHAV PANDEY Oct 10 '14 at 10:17