Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query on secondary index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: Query on secondary index
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    Post subject: Secondary Indexes and Order
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Query runs very long John F Dutcher DB2 21 Wed Aug 21, 2019 11:44 pm
No new posts Query to Truncate value in table bhaskar_kanteti DB2 2 Mon Aug 12, 2019 3:26 pm
No new posts Verify WITH UR present inside program... priyankakir CLIST & REXX 23 Wed Jun 12, 2019 3:37 pm
No new posts Query on updating the control cards. abdulrafi DFSORT/ICETOOL 2 Tue Feb 26, 2019 2:23 pm
This topic is locked: you cannot edit posts or make replies. Query on updating the control cards. abdulrafi JCL & VSAM 2 Mon Feb 25, 2019 7:43 pm

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