IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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


 
IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
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
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: 2432
Location: Hampshire, UK

PostPosted: Mon Mar 24, 2014 2:01 pm
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
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

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Mon Mar 24, 2014 2:46 pm
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
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

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Mon Mar 24, 2014 6:21 pm
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: 6251
Location: Mumbai, India

PostPosted: Mon Mar 24, 2014 6:39 pm
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: 2432
Location: Hampshire, UK

PostPosted: Mon Mar 24, 2014 6:51 pm
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

Global Moderator


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

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

Use [URL] BBCode for Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> IMS DB/DC
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts NOT ABLE TO FIND DB2 ROWS DB2 2
No new posts BMS map length field greater than zero CICS 3
No new posts Break a record into fields, each fiel... SYNCSORT 2
No new posts SYNCSORT Error - CONTROL FIELD BEYOND... SYNCSORT 10

Back to Top