View previous topic :: View next topic
|
Author |
Message |
kanchetibabu
New User
Joined: 25 Apr 2005 Posts: 3 Location: bangalore
|
|
|
|
Hi,
Please suggest a suitable method to read a VSAM KSDS file using partial key.
The key is of 40 bytes, and I have only data upto 17 byes.
I am told not to repro top another file of 17 bytes, and to use only file with 40 bytes key.
this is needed through batch cobol program.
Answeres are needed ASAP., litle bit urgent.
any help regarding this is highly apprciated.
thank you. |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Babu,
Looking at your constrains the task seems to be a bit hard, k one way of accesing is by d3efining thre first 17 bytes as an alternate key for the KSDS for this u need to define an AIX , build that AIX and got to define a Path, if ya running this in prouction u have to get proper approvals to do this task, the other way is to read the file KSDS in a sequential way load all the data to a table by using occurs depending on the no. of rec. inside your KSDS and then using the INDEX of the table to access the records, if ya want to follow this approach the lrecl inside the KSDS should be fixed for the array declaration to be proper and this one is bit lengthy process and perfiormance wise not good one. the best one is by using an alternate index i think.
Cheer's,
Thamilzan. |
|
Back to top |
|
|
kanchetibabu
New User
Joined: 25 Apr 2005 Posts: 3 Location: bangalore
|
|
|
|
Hi Thamilzan,
Thank you for your reply, i will try with the AIX.
regards.
if possible can u give the Alternate Key definition and AIX process |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
kanchetibabu wrote: |
Please suggest a suitable method to read a VSAM KSDS file using partial key.
The key is of 40 bytes, and I have only data upto 17 byes.
I am told not to repro top another file of 17 bytes, and to use only file with 40 bytes key. |
Is the 17 bytes part of the 40 byte key?
If so, COBOL will easily random read a KSDS file with a partial or "generic" key. Are you aware of this? |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Babu,
please find the sample creation of an AIX
Code: |
//AMSJOB JOB (ACCTNO)
//DEFAIX1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT =*
//SYSIN DD *
DEFINE AIX -
(NAME (EMP.KSDS.DEPT.AIX) -
VOLUMES (VS0101) -
RELATE (EMP.KSDS.CLUSTER) -
UPGRADE -
CYLINDERS (2 1) -
KEYS (25 9) -
RECORDSIZE (70 110) -
FREESPACE (20 10) -
SHAREOPTIONS (1) -
NONUNIQUEKEY ) -
DATA -
(NAME (EMP.KSDS.DEPT.DATA)) -
INDEX -
(NAME (EMP.KSDS.DEPT.INDEX))
/* |
after running this u have build index i.e..
Code: |
//AMSJOB JOB (ACCTNO)
//BLDIND EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*DISP=OLD ensures exclusive use during BLDINDEX
//*execution
//EMPBASE DD DSN=EMP.KSDS.CLUSTER,DISP=OLD
//AUTHAIX DD DSN=EMP.KSDS.DEPT.AIX,DISP=OLD
//IDCUT1 DD DSN=SORT.WORK.ONE,DISP=OLD
//IDCUT2 DD DSN=SORT.WORK.TWO,DISP=OLD
//*To use different ddnames in place of IDCUT1 and
//*IDCUT2 add WORKFILES(ddname1,ddname2)
//*as a BLDINDEX parameter
//SYSIN DD *
BLDINDEX -
INFILE (EMPBASE) -
OUTFILE (AUTHAIX) -
INTERNALSORT -
CATALOG (VSAM.USERCAT)
/*
//*To use data set names directly use INDATASET and
//*OUTDATASET in place of INFILE and OUTFILE
//*respectively |
then define a path
Code: |
//AMSJOB JOB
//KSDSPTH1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE PATH -
( NAME (EMP.KSDS.PATH1.DEPT) -
PATHENTRY (EMP.KSDS.DEPT.AIX) -
UPDATE )
/* |
phew... Quite a lot rite
Cheer's,
Thamilzan. |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Bill,
Could u please throw some light on Generic key , and how can it be used.
Cheer's,
Thamilzan. |
|
Back to top |
|
|
kanchetibabu
New User
Joined: 25 Apr 2005 Posts: 3 Location: bangalore
|
|
|
|
Thanks Thamilzan,
Hi Bill, can you please tell the process of Generic key reading.
yes it a part of 40 byte key. 17 are the 1 to 17 bytes of 40 byte key. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
prav_06 wrote: |
Could u please throw some light on Generic key , and how can it be used. |
Look at the START verb. |
|
Back to top |
|
|
|