View previous topic :: View next topic
|
Author |
Message |
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
In this code from c++ programming guide the author uses DUMMY.DATA
and no word about what should be inside. Any ideas?
//REPRO EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO INDATASET(userid.DUMMY.DATA) -
OUTDATASET(userid.KSDS.CLUSTER)
/*
Is this code the same?
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
REPRO INDATASET(userid.my.test) -
OUTDATASET(userid.KSDS.CLUSTER)
But after this fopen works fine but creating of BLDIndex failed. Any ideas? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You can not build an alternate index on an empty file.
I usually build two dummy records of '00'X & 'FF'X for the whole length of the record and repro them into the base cluster. Then perform the BUILDIX afterwards. |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
thanks. Can you tell what "two dummy records of '00'X & 'FF'X" Don't really know how this member should look like? |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Sorry, i mean that i don't know what should be inside this dummy records. I am new to this subject. Can you expaing in more detail? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You know how long the records are for the base cluster, because you need that info to define the cluster.
In an external dataset, set up two records equal to the maximum record length of the file, and for each byte us '00'X HEX zeros - low values, and one record with 'FF'X - HEX FF - high values.
These populate the VSAM cluster, which in effect initialises it making it totally usable.
I'll try and post some REXX code tomorrow, I've posted something very similar on another forum, so will try and dig it up either from there or from my own library, if I kept a copy. It will initialise any VSAM KSDS just by knowing the cluster name. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Here's the JCL code to run the REXX. It executes an ISPF environment in batch. Because I trip from site to site where standards differ I use loads of symbolics so that the code executes immediately at any site after initial set up.
The REXX will populate the cluster with two records, one with a key value of HEX low values '00'X and one with HEX high values 'FF'X. Obviously the code can be changed if there are any specific requirements for header/trailer information to be inserted.
You can also change the length of the WORK DD dataset to accomodate records larger than the 2004 specified.
Code: |
//*
// SET PREFIX='FX.',
// SYSTID=''
//*
// JCLLIB ORDER=(&PREFIX.&SYSUID..&SYSTID.TEMPISPF)
//*
//BATCH EXEC ISPFBAT,PARM='%VSAMPOP &PREFIX.. &SYSUID.. &SYSTID..'
//WORK DD DSN=&PREFIX.&SYSUID..&SYSTID.WORK,
// DISP=(,CATLG,CATLG),
// SPACE=(TRK,1),
// RECFM=V,LRECL=2004
//VSAMFLS DD *
Vsam cluster name 001
Vsam cluster name 002
Vsam cluster name 003
/*
//DELETE EXEC PGM=IEFBR14,COND=EVEN
//DD01 DD DSN=&PREFIX.&SYSUID..&SYSTID.WORK,
// DISP=(MOD,DELETE),SPACE=(TRK,0)
|
And the REXX code executed is
Code: |
/* REXX ** POPULATE SELECTED VSAM KSDS WITH HIGH AND LOW HEX KEYS */
Z = MSG('OFF')
ARG PF US SI .
IF PF = '.' THEN PF = ''
IF US = '.' THEN US = ''
IF SI = '.' THEN SI = ''
WORKDSN = STRIP(PF!!US!!SI!!"WORK")
S1 = "KEYLEN"
S2 = "RKP"
S3 = "REC-TOTAL"
"EXECIO * DISKR VSAMFLS ( STEM FLS. FINIS"
DO A = 1 TO FLS.0
PARSE VAR FLS.A DSN
DSN = STRIP(DSN)
CX1 = 0
CX2 = 0
CX3 = 0
X=OUTTRAP(LST.)
" LISTC ENT('"DSN"') ALL"
X=OUTTRAP(OFF)
DO B = 30 TO LST.0
IF CX1 <> 1 THEN IX1 = POS(S1,LST.B)
IF CX2 <> 1 THEN IX2 = POS(S2,LST.B)
IF CX3 <> 1 THEN IX3 = POS(S3,LST.B)
IF IX1 <> 0 & CX1 <> 1 THEN DO
KLN = STRIP(TRANSLATE(SUBSTR(LST.B,IX1+6,18),' ','-'))
CX1 = 1
END
IF IX2 <> 0 & CX2 <> 1 THEN DO
KPS = STRIP(TRANSLATE(SUBSTR(LST.B,IX2+6,18),' ','-'))
CX2 = 1
END
IF IX3 <> 0 & CX3 <> 1 THEN DO
RCS = STRIP(TRANSLATE(SUBSTR(LST.B,IX3+9,15),' ','-'))
CX3 = 1
END
IF CX1 & CX2 & CX3 THEN DO
B = LST.0
IF RCS <> 0 THEN DO
SAY "RECORDS COUNT GT 0 FOR "DSN
ITERATE A
END
"FREE FI(WORK,VSAM)"
"ALLOC FI(WORK) DA('"WORKDSN"') SHR"
"ALLOC FI(VSAM) DA('"DSN"') SHR"
IF KPS > 0 THEN AA = LEFT(' ',KPS)!!COPIES('00'X,KLN)
ELSE AA = COPIES('00'X,KLN)
PUSH AA
"EXECIO 1 DISKW WORK"
IF KPS > 0 THEN AA = LEFT(' ',KPS)!!COPIES('FF'X,KLN)
ELSE AA = COPIES('FF'X,KLN)
PUSH AA
"EXECIO 1 DISKW WORK ( FINIS"
"FREE FI(WORK)"
"ALLOC FI(WORK) DA('"WORKDSN"') SHR"
" REPRO IFILE(WORK) OFILE(VSAM) "
SAY "RETURN CODE "RIGHT(RC,4)" FOR "DSN
"FREE FI(WORK,VSAM)"
ITERATE A
END
END
END
|
|
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Thank you. Have'n you got a code in c++? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
Thank you. Have'n you got a code in c++? |
Reply best left blank !!! |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Sorry if I asked something wrong. I am new to this. may be you recommend some books about creating vsam. I have only DFSMS using data sets and c++ user's guide. And may be there is a way for more easier way to create this dummy data set? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
To copy
“dummy” indexed-sequential records (with X'FF' in the first byte), specify the
DUMMY option in the ENVIRONMENT parameter.
Found in using data sets? may be i should use this? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Give it a try ....................... but I have always loaded my own records into a KSDS to initialise it. See if it works. It will work, I'm sure otherwise IBM would not tell you to do it.
The REXX above is a quick and easy way to initialise the cluster without having to know anything about the cluster except its name.
To initialise it properly, the key should be populated - that's why I use '00'X & 'FF'X because these are the lowest and highest possible values you could use. |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Can anybody write a small jcl which creates dummy data set for initializing VSAM and used in repro? |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
any ideas? how to create this dummy data set using jcl? really need help |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
You can try VSAMINIT if it is available in your organisation.
This is to initialize the VSAM file with low values.
Code
Code: |
//R020 EXEC PGM=VSAMINIT,
//INIT01 DD DSN=<VSAM file>,
// DISP=SHR
//SYSOUT DD SYSOUT=* |
|
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
IEFC621I EXPECTED CONTINUATION NOT RECEIVED
unfortunately not available. I can't understand what should be inside.
000000
000000 and where
fffff
fffff
?
And can't find in documentation. no word about it. in all examples they use something like userid.dummy |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Aleksey
Quote: |
To copy
?dummy? indexed-sequential records (with X'FF' in the first byte), specify the
DUMMY option in the ENVIRONMENT parameter. |
Indexed-sequential is a completely different access method from VSAM, and as far as I am aware is no longer supported by IBM, being replaced by VSAM.
Quote: |
unfortunately not available. I can't understand what should be inside.
000000
000000 and where |
Once a VSAM file has been defined, it can not be immediately used by any program until it has been initialised. This can be done by the first program to access the file, but that is not how I usually do this.
You know the offset of the key within the record, so add 1 to the offset to get the real position of the record.
Let us assume it is 80 bytles long with the key at offset 0 (position 1), for a length of 12.
Create a dataset that is 80 bytes long, and edit it by creating a blank line. Then on the command line type HEX ON
Code: |
''''''
44444444444444444444444444444444444444444444444444444444444444444
00000000000000000000000000000000000000000000000000000000000000000 |
Now, to create a key of '00'X overtype the all of the 4's from the top line with 0 (zero), and then type SAVE.
Code: |
''''''
00000000000044444444444444444444444444444444444444444444444444444
00000000000000000000000000000000000000000000000000000000000000000
|
Type HEX OFF, and you will then see
So now you have built the data to initialise your KSDS. I for one also generate a 'FF'X as well. So create a new line in your dataset and this time with HEX ON, overtype the 4's in the top line with F, and also each 0 below the 4.
Code: |
000001
0000000000004444444444444444444444
0000000000000000000000000000000000
-----------------------------------------
000002
FFFFFFFFFFFF4444444444444444444444
FFFFFFFFFFFF0000000000000000000000
|
Type SAVE
Now, when you REPRO this dataset to the VSAM KSDS it is fully initialised with two records, one containing the lowest possible value in the key field, and one with the highest possible value.
Give it a go with your VSAM dataset, and if you still have problems post back here. |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Some errors:
Code: |
IDC1645I NONUNIQUE AIX KEY 4040404040404040
PRIME KEY IS 00000000
IDC1645I NONUNIQUE AIX KEY 4040404040404040
PRIME KEY IS FFFFFFFF
IDC1653I xxxxxxx.KSDS.UAIX BUILT WITH ERRORS |
Code: |
IDC1644I ALTERNATE INDEX KEY NOT IN BASE RECORD 00000000
IDC1644I ALTERNATE INDEX KEY NOT IN BASE RECORD FFFFFFFF
IDC1653I xxxxxxx.KSDS.NUAIX BUILT WITH ERRORS |
|
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
Problem was solved. Thank you very much. |
|
Back to top |
|
|
Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
When I write to vsam i see this error
Code: |
Reason code = 8
RBA = 0
Last op = 115 |
Do you know what does it mean and where I can find the description of this error? in which book? |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
Using standard IBM utilities you can use the following JCL to prime a KSDS with one low values record.
I use this for a KSDS with lrecl=96 and a KEYLEN=44 (offset=0)
You should be able to modify it for your own file.
Code: |
//IEBDG EXEC PGM=IEBDG
//SYSPRINT DD SYSOUT=*
//PRIMER DD DSN=&&PRIMER,DISP=(NEW,PASS),UNIT=VIO,
// DCB=(RECFM=F,LRECL=96,BLKSIZE=96),SPACE=(TRK,(1))
//SYSIN DD *
DSD OUTPUT=(PRIMER)
FD NAME=A,LENGTH=44,STARTLOC=1,PICTURE=44,
'00000000000000000000000000000000000000000000'
CREATE NAME=A
END
/*
//*
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPRIMER DD DSN=&&PRIMER,DISP=(OLD,DELETE)
//KSDS DD DSN=............,DISP=OLD
//SYSIN DD *
REPRO OFILE(KSDS) INFILE(INPRIMER)
/* |
|
|
Back to top |
|
|
|