Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to find the maximum value of a particular field inIMS-DB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
Susheel singh

New User


Joined: 25 Jul 2013
Posts: 13
Location: INDIA

PostPosted: Mon Mar 24, 2014 11:39 am    Post subject: How to find the maximum value of a particular field inIMS-DB
Reply with quote

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
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1727
Location: UK

PostPosted: Mon Mar 24, 2014 2:01 pm    Post subject: Reply to: How to find the maximum value of a particular fiel
Reply with quote

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
View user's profile Send private message
Susheel singh

New User


Joined: 25 Jul 2013
Posts: 13
Location: INDIA

PostPosted: Mon Mar 24, 2014 2:39 pm    Post subject:
Reply with quote

suppose i have a date field in one segment , i want to get the highest date among all the records.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10218
Location: italy

PostPosted: Mon Mar 24, 2014 2:46 pm    Post subject: Reply to: How to find the maximum value of a particular fiel
Reply with quote

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
View user's profile Send private message
Susheel singh

New User


Joined: 25 Jul 2013
Posts: 13
Location: INDIA

PostPosted: Mon Mar 24, 2014 5:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10218
Location: italy

PostPosted: Mon Mar 24, 2014 6:21 pm    Post subject: Reply to: How to find the maximum value of a particular fiel
Reply with quote

Quote:
Anyone please suggest how can i achieve this...

start coding....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Mar 24, 2014 6:39 pm    Post subject:
Reply with quote

With that definition of your problem you look pretty far from what your destination!

In an effort to read between the lines -

  1. how's your date field defined? Is it in Julian or Gregorian format?
  2. "Maximum" is a relative term, with what the "value" should be maximum?
  3. 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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1727
Location: UK

PostPosted: Mon Mar 24, 2014 6:51 pm    Post subject: Reply to: How to find the maximum value of a particular fiel
Reply with quote

And what do you do if there is more than one record with that date?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1638
Location: NY,USA

PostPosted: Wed Mar 26, 2014 7:57 am    Post subject:
Reply with quote

http://pic.dhe.ibm.com/infocenter/eiic/v1r1/index.jsp?topic=%2Fcom.ibm.ims10.doc.apg%2Fims_comparehierandreldbs.htm
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 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 37 Tue Dec 06, 2016 8:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us