Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Accessing ESDS through Alternate index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:03 pm    Post subject: Accessing ESDS through Alternate index
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 11, 2008 5:15 pm    Post subject:
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: 43
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:20 pm    Post subject: Reply to: Accessing ESDS through Alternate index
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Aug 11, 2008 5:20 pm    Post subject: Reply to: Accessing ESDS through Alternate index
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Aug 11, 2008 5:25 pm    Post subject: Reply to: Accessing ESDS through Alternate index
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: 43
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:31 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Aug 11, 2008 5:33 pm    Post subject:
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 -

http://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: 43
Location: Chennai

PostPosted: Mon Aug 11, 2008 5:53 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts Accessing first bit of PD value rajatbagga DFSORT/ICETOOL 11 Wed May 03, 2017 6:03 am
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us