IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Accessing ESDS through Alternate index


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:03 pm
Reply with quote

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
View user's profile Send private message
Meir Goldstein

New User


Joined: 12 May 2008
Posts: 7
Location: Jerusalem, israel

PostPosted: Mon Aug 11, 2008 5:13 pm
Reply with quote

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 icon_rolleyes.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Aug 11, 2008 5:15 pm
Reply with quote

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 icon_rolleyes.gif

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
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 11, 2008 5:20 pm
Reply with quote

Quote:
asn long as i know, it's impossible to use alternante index with ESDS file, you must build it on KSDS file.


I beg to differ or at least VSAM begs to differ

http://www.ibmmainframes.com/viewtopic.php?t=29269&highlight=esds+aix
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 11, 2008 5:25 pm
Reply with quote

here is a link to lots of samples
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:31 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 11, 2008 5:33 pm
Reply with quote

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
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:53 pm
Reply with quote

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 icon_rolleyes.gif

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
View user's profile Send private message
Meir Goldstein

New User


Joined: 12 May 2008
Posts: 7
Location: Jerusalem, israel

PostPosted: Tue Aug 12, 2008 6:20 pm
Reply with quote

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 icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Cobol file using index COBOL Programming 2
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Accessing ABENDCC in JCL JCL & VSAM 6
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
Search our Forums:

Back to Top