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

Query on secondary index


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suja.Sai

New User


Joined: 26 Sep 2008
Posts: 12
Location: Bangalore

PostPosted: Wed Oct 31, 2018 9:47 pm
Reply with quote

Hi,

Is it possible to create a secondary index in IMS DB that will arrange the records in the database in descending order of a key field?

Suppose there is an employee number field in the IMS DB which currently is not sorted in any order in the IMS DB. Is it possible to create a secondary index on this field, so that the records will be shown in descending order of the employee number? Or is there any other way to achieve this in IMS DB?
Back to top
View user's profile Send private message
Phil Sevetson

New User


Joined: 02 Mar 2012
Posts: 3
Location: United States

PostPosted: Tue Nov 27, 2018 10:20 pm
Reply with quote

I think what you're looking for is a "tens complement" field. You'd have to determine the "tens complement" of the employee number, then use that as a key field for the secondary index.

I am, I admit, puzzled as to why you would want to do this. If you're looking for a way to assign the next employee number in sequence after the current highest number, many ways exist to accomplish this, and most of them take a smaller amount of work and space. Example: a one-record IMS database (assuming that you are limited to IMS) which is updated when a new employee is hired.
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts DB2: Need helping below DB2 query DB2 13
No new posts DB2 SQL query to read and update data... DB2 12
No new posts Cobol-db2 : SQL query is running for ... DB2 4
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts Reading subsequent rows in a query. DB2 12
Search our Forums:

Back to Top