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

Requirment:Multiple keys in the root segment.


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

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Thu May 31, 2007 4:44 pm
Reply with quote

Hi,

The problem i am having requires the Key field of the root segment of the database to be altered from 'U' to 'M'.

Consider a root segment A with two child segments, say B and C at the same level.

I need to have say 30-days history retained for each key field in the root segment in the same database.

I could have had all 30-day data under one root segment occurrence but the root segment has some Non-unique field which change for each occurrence of the root segment.

kindly let me know if the change I am planning is possible. if not do we have another alternative for handling case like this. icon_smile.gif

Cheers,
Phoenix.[/code]
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu May 31, 2007 11:39 pm
Reply with quote

Please some more info. Remember each logical database record in your case has a unique root A and dependents B and C. To really understand your problem please post more information like how logical database records would look.
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Fri Jun 01, 2007 12:23 pm
Reply with quote

Hi,

For more details I here is what the database looks like now:


Segment Data
A 00001 FROM TO BILL-NO
B U 20070514 213531
B C 20070514 183201
C 71340419014
C 71340498605
C 71340685787
C 71340984896

A 00002 FROM TO BILL-NO
B U 20070514 122912
B G 20070514 112516
B Z 20070514 091625
B L 20070514 091211
C 71340240107
C 71340742937


A 00003 FROM TO BILL-NO
B U 20070514 011201
C 71340240107
C 71340742937

....
...
..
.

Note that the root segment keys (00001,00002,......) are unique here, and the timestamp is in the child segment B (20070514 122912,...).



And here is what it should look like (Remember 30 occurrences for each unique key in A):


Segment Data

A 00001 FROM TO BILL-NO
B U 20070514 213531
C 71340419014
C 71340498605
C 71340685787
C 71340984896

A 00001 FROM TO BILL-NO
B U 20070514 122912
B T 20070514 063940
C 71340240107
C 71340742937

A 00001 FROM TO BILL-NO
B U 20070513 101201
C 71330240107
C 71330742937

A 00001 FROM TO BILL-NO
B U 20070512 194510
B E 20070512 123531
B R 20070512 114607
C 71320240107
C 71320742937
.....
....
here each 00001 root key has multiple occurrences having different timestamps in the child segment B, occuring together in the database based on the key.
...
..
.

A 00002 FROM TO BILL-NO
B U 20070514 231201
C 71340240107
C 71340742937

A 00002 FROM TO BILL-NO
B U 20070513 182819
B R 20070513 113531
C 71330240107
C 71330742937

A 00002 FROM TO BILL-NO
B U 20070512 151603
C 71320240107
C 71320742937
.....
....
Similarly, for root key 00002 is also having numerous records for different date and time entries in B segment.
...
..
.

In the DBD now the Key field of the root segment is defiled as (Fldname,SEQ,U)

which if we change to
(Fldname,SEQ,M) would serve the purpose but it is a HIDAM database and the IBM manual says this is only possible for a HDAM database.

Can you suggest any other way around to handle the scenario?

I hope you get the idea of the problem. icon_neutral.gif

Cheers,
Phoenix.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Sat Jun 02, 2007 12:29 am
Reply with quote

The idea I'm getting is you want a root A with dependents B and C. Depending on the dates within a period of 30 days (stored in the dependent B) you would like to store multiple roots A. Within the logical database record for each root there would be information stored for a 30 days period. Is my guess correct?

Example:
root 001 (1) counts for january and relevant data is stored in dependents B and C.
root 001 (2) counts for february and relevant data is stored in dependents B and C.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sun Jun 03, 2007 11:49 pm
Reply with quote

Instead of keeping duplicate keys in the root segment, to make it efficient I can think of introducing internal sequence number field along with the key. This way the root segment will be unique, and the sequence number will range from 1 to 30.

Example:
A 00001 01 FROM TO BILL-NO
A 00001 02 FROM TO BILL-NO
A 00001 03 FROM TO BILL-NO
A 00001 04 FROM TO BILL-NO

for this DBD change is required to expand the key length.
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Mon Jun 04, 2007 12:22 pm
Reply with quote

Hi Bitneuker,

Quote:
The idea I'm getting is you want a root A with dependents B and C. Depending on the dates within a period of 30 days (stored in the dependent B) you would like to store multiple roots A.


Yes, you are correct.

Quote:
Within the logical database record for each root there would be information stored for a 30 days period.


Yes, but the information for each day would be under a different root with the same key. And there may be multiple occurrences for a root key for the same day and different timings (HH:MM:SS).


Hi Devzee,

The idea seems to be correct, but my application requires deletion of any data older than 30-days, so once I do what you suggested I'll have to change the sequence number of every occurrence with the deletion of every 30-day old record because the all the existing data will become one day older.

And there is one more probllem in that, sorry i forgot to mention earlier icon_sad.gif ; there may be multiple occurrences for a root key for the same day and different timings (HH:MM:SS), which leaves me no criterion to identify how many records may exist for a particular root key.

Hope this helps in understanding the problem. icon_neutral.gif

Cheers.
Phoenix
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 04, 2007 10:21 pm
Reply with quote

I would consider another level under the root where the time period is the key and have B and C under this level. So your hierarchy exists of 3 levels. May be some datamodelling could help icon_idea.gif
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Tue Jun 05, 2007 10:26 am
Reply with quote

Yup,

I think that would serve the purpose, thanks Bitneuker for your help.

Thanks Devzee.


Cheers,
Phoenix.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Jun 06, 2007 1:39 am
Reply with quote

You're wellcome icon_wink.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top