Reputation: 65
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??
//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?
Upvotes: 1
Views: 149
Reputation: 13076
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.
Upvotes: 1