Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to use Alternate Index in Cobol program?

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

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Fri May 26, 2006 11:32 am    Post subject: How to use Alternate Index in Cobol program?
Reply with quote

How do we use alternate index to browse a KSDS file in COBOL program? Please provide me with the code if any one know how to.

Regards,
Umesh
Back to top
View user's profile Send private message

gskulkarni

New User


Joined: 01 Mar 2006
Posts: 70

PostPosted: Fri May 26, 2006 2:59 pm    Post subject:
Reply with quote

Code:
//MASTERA DD DSNAME=CLUSTERNAME,DISP=OLD
//MASTERA1 DD DSNAME=PATH1,DISP=OLD
//MASTERA2 DD DSNAME=PATH2,DISP=OLD

FILE-CONTROL.
SELECT MASTER3FILE ASSIGN TO MASTERA
RECORD KEY IS EM3NAME
ALTERNATE RECORD KEY IS EM3PHONE
ALTERNATE RECORD KEY IS EM3CITY



.1/ The base cluster name is CLUSTERNAME.
.2/ The name of the first alternate index path is PATH1.
.3/ The name of the second alternate index path is PATH2.
.4/ The ddname for the base cluster is specified with the ASSIGN clause.
.5/ The key, EM-PHONE, relates to the first alternate index.
.6/ The key, EM-CITY, relates to the second alternate index.
Back to top
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Fri May 26, 2006 3:58 pm    Post subject:
Reply with quote

Thanks...

Now what is the syntax/methos to use these alternate indexes while READ statement.

For Example:
(1) If we do
MOVE "ENAME" TO EM3NAME
READ MASTER3FILE

we will use EMPNAME key field.

(2) If we do
MOVE "DELHI" TO EM3CITY
READ MASTER3FILE

we will use CITY alternate index

(3) What if we do ???

MOVE "ENAME" TO EM3NAME
MOVE "DELHI" TO EM3CITY
READ MASTER3FILE

Which index will be used?

Please clarify...
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us