View previous topic :: View next topic |
Author |
Message |
digitalnirmal Beginner
Joined: 06 Dec 2005 Posts: 21 Topics: 10
|
Posted: Wed May 17, 2006 5:04 am Post subject: how to use index to search |
|
|
I have a IMS DB DB1
the struct of this DB is as follows
DBROOT (key = KEY1)
|
|--DBSEG1 (key = KEY2)
now an index has been created on DBSEG1
The structure now looks like this if the index is used for view
DBSEG1 (key = KEY2)
|
|--DBROOT (key = KEY1)
I need to write a prog to search DB1 using the index on keyfields [KEY2, KEY1]
what steps need to be done??
Do i need a new PSB?
If yes, what shoutl the PSB look like?
Also can I search using two key segments in a single SSA???? |
|
Back to top |
|
 |
ANIL SARATHY Beginner

Joined: 30 Aug 2005 Posts: 88 Topics: 3 Location: Syracuse,New york
|
Posted: Wed May 17, 2006 9:56 am Post subject: |
|
|
One more information required here. Even though it is said that secondary index is created on DBSEG1, can you once gain let us know what is source and target segments of secondary index. This will help to come out with best call.
What excatly should the call do , ie. what segment information ur looking here _________________ Anil Sarathy |
|
Back to top |
|
 |
ANIL SARATHY Beginner

Joined: 30 Aug 2005 Posts: 88 Topics: 3 Location: Syracuse,New york
|
Posted: Wed May 17, 2006 10:03 am Post subject: |
|
|
INDICES parameter can do something like accessing segment with primary and secondary key.
"http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims9.doc.adb/dba317.htm"
Not sure wether it helps you out  _________________ Anil Sarathy |
|
Back to top |
|
 |
digitalnirmal Beginner
Joined: 06 Dec 2005 Posts: 21 Topics: 10
|
Posted: Fri May 19, 2006 12:34 am Post subject: |
|
|
Hi Anil
i'm not sure what u mean by this
"what is source and target segments of secondary index"
"what segment information ur looking here"
I'm looking to insert / update into DBSEG1 |
|
Back to top |
|
 |
ANIL SARATHY Beginner

Joined: 30 Aug 2005 Posts: 88 Topics: 3 Location: Syracuse,New york
|
Posted: Fri May 19, 2006 4:11 am Post subject: |
|
|
To insert into DBSEG1, there is no need to use secondary index.
Tp update , i think ur looking for occurences of DBSEG1 based on some criteria.
Are you novice in Secondary index _________________ Anil Sarathy |
|
Back to top |
|
 |
digitalnirmal Beginner
Joined: 06 Dec 2005 Posts: 21 Topics: 10
|
Posted: Fri May 19, 2006 4:29 am Post subject: |
|
|
We are using the secondary index to improve performance of the existing code
The plan is to seek the segment using an index and then insert/update depending on conditions |
|
Back to top |
|
 |
ANIL SARATHY Beginner

Joined: 30 Aug 2005 Posts: 88 Topics: 3 Location: Syracuse,New york
|
Posted: Fri May 19, 2006 7:24 am Post subject: |
|
|
i assume that you have a file with keys of segments DBSEG1 and DBROOT.
File has secondary index of DBSEG1 and primary key DBROOT and data to updateor insert.
Read the database as
GU DBSEG1(SECONDARY KEY FIELD=*******)
DBROOT(Primary key field=******)
PSB should have procopt=secondary index database in PCB statement of PSB
segm dbseg1,parent=0procopt=ir or g
segm dbroot ,parent=dbseg1
Instead of GU call give GN and later check the fields of segment for selection criteria. _________________ Anil Sarathy |
|
Back to top |
|
 |
|
|