View previous topic :: View next topic
|
Author |
Message |
srajendran2
New User
Joined: 13 May 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi,
My requirement is to update the values of a field in a VSAM ESDS file. The file should be accessed through alternate index. I'm not aware of how to handle these things in COBOL. I need a sample source for this requirement. Also could anyone please let me know, accessing ESDS thru alternate index makes this process faster or not? |
|
Back to top |
|
|
Meir Goldstein
New User
Joined: 12 May 2008 Posts: 7 Location: Jerusalem, israel
|
|
|
|
hi!
asn long as i know, it's impossible to use alternante index with ESDS file, you must build it on KSDS file.
best tiding |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Meir Goldstein wrote: |
hi!
asn long as i know, it's impossible to use alternante index with ESDS file, you must build it on KSDS file.
best tiding |
No, you can use an alterate index on ESDS
Quote: |
I need a sample source for this requirement. |
DO NOT ask for code
The forum is a help forum, not a get it done for free forum. |
|
Back to top |
|
|
srajendran2
New User
Joined: 13 May 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi Gold stein,
I've created the alternate index for the ESDS. But i'm not aware of how to use it in COBOL. please find attached the JCL for building alternate index for ESDS.
Code: |
//**********************************************************************
//**********************DEFINES THE TEST VSAM FILE**********************
//**********************************************************************
//DEFINE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
(NAME(E97222.G6488U.SUSPFL.TEST) -
NONINDEXED -
CYLINDERS (25,1) -
VOLUME (TPUB) -
SPEED -
CONTROLINTERVALSIZE (4096)) -
DATA -
(NAME(E97222.G6488U.SUSPFL.TEST.DATA) -
RECORDSIZE (2062,2062) -
FREESPACE (10,10))
/*
//**********************************************************************
//**********DEFINES THE ALTERNATE INDEX FOR TEST VSAM FILE**************
//**********************************************************************
//DEFINEAX EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE ALTERNATEINDEX -
(NAME(E97222.G6488U.SUSPFL.TEST.AIX) -
RELATE(E97222.G6488U.SUSPFL.TEST) -
KEYS(38 74) -
RECORDSIZE(2062 2062) -
VOLUMES(TPUB) -
CYLINDERS(3 1) -
NONUNIQUEKEY -
UPGRADE)
/*
//*********************************************************************
//* REPRO OF ISSUFILE INTO VSAM
//*********************************************************************
//STEPRPRO EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=&&SORTVSM,DISP=OLD
//DD2 DD DSN=E97222.G6488U.SUSPFL.TEST,DISP=OLD
//SYSIN DD *
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
ERRORLIMIT(20000)
/*
//*********************************************************************
//*******BUILDS THE ALTERNATE INDEX************************************
//*********************************************************************
//BUILDAIX EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
BLDINDEX -
INDATASET('E97222.G6488U.SUSPFL.TEST') -
OUTDATASET('E97222.G6488U.SUSPFL.TEST.AIX')
/* |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
srajendran2
New User
Joined: 13 May 2008 Posts: 56 Location: Chennai
|
|
|
|
Hi Soricheti
The link doesn't have a sample for handling ESDS with alternate index. But it has a sample for KSDS. Where they've used primary key as the mainkey for accessing data. Could you please provide me something specific properties of ESDS with COBOL? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi Mani,
Please try not to post the attachment, they initiate un-necessary traffic & are not allowed to open at some shops, you might like to check this link -
www.ibmmainframes.com/viewtopic.php?t=33243&highlight=
Hopefully, it conveys the message - why I asked you not to post attachments.. |
|
Back to top |
|
|
srajendran2
New User
Joined: 13 May 2008 Posts: 56 Location: Chennai
|
|
|
|
expat wrote: |
Meir Goldstein wrote: |
hi!
asn long as i know, it's impossible to use alternante index with ESDS file, you must build it on KSDS file.
best tiding |
No, you can use an alterate index on ESDS
Quote: |
I need a sample source for this requirement. |
DO NOT ask for code
The forum is a help forum, not a get it done for free forum. |
Quote: |
I need a sample source for this requirement. |
Sorry i mentioned it wrongly. I need to know the methods that can be used for ESDS. |
|
Back to top |
|
|
Meir Goldstein
New User
Joined: 12 May 2008 Posts: 7 Location: Jerusalem, israel
|
|
|
|
hi! sorry for the mistake i did it stem from the fact that in to cobol programmer guide only KSDS files are mentioned in connection with alternae index, but hopefully it can work correctl with ESDS which use the RBA to build the altername index instead of key of the base cluster, which indicate that it is more efficient to use ESDS then KSDS files.
Anyhow i know that you have to define a PATH which connect the AIX to the base cluster.
Your connection to the files is thru the PATH. When you open the path the AIX and the base cluster are opened, you read the files as usual but if the AIX key are not uniqe you get the first one in the list and vsam return code of 2 and you get the next record by issueing READ NEXT, when last record in the list read the r.c is zero.
sorry that if have not any examle.
best tiding |
|
Back to top |
|
|
|