View previous topic :: View next topic
|
Author |
Message |
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
Hi,
I want to know is there any function in IMS DB which can give a maximum value of particular field in a database.
Thanks in advance! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
How do you mean "maximum value"? Actual maximum currently on the DB? Or the maximum possible value that the field can hold? Or something else? |
|
Back to top |
|
|
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
suppose i have a date field in one segment , i want to get the highest date among all the records. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
do You realize that IMS knows nothing about the segments content/data ?
IMS has to be told only about the KEY related fields |
|
Back to top |
|
|
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
i have a requirement that for some particular date field i need to get the maximum date among all the records in the database.
Anyone please suggest how can i achieve this... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Anyone please suggest how can i achieve this... |
start coding.... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
With that definition of your problem you look pretty far from what your destination!
In an effort to read between the lines -
- how's your date field defined? Is it in Julian or Gregorian format?
- "Maximum" is a relative term, with what the "value" should be maximum?
- With the information in hand I can think of two ways:
- Use File-Aid for IMS and select the only field and look at the values.
- As Enrico suggested write a program. Read the segment with date-filed. In output write the key for segment and the date-filed. And work with this output to get what you need.
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
And what do you do if there is more than one record with that date? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
Back to top |
|
|
|