View previous topic :: View next topic
|
Author |
Message |
Phoenix
New User
Joined: 27 Feb 2007 Posts: 20 Location: Chennai
|
|
|
|
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.
Cheers,
Phoenix.[/code] |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
Phoenix
New User
Joined: 27 Feb 2007 Posts: 20 Location: Chennai
|
|
|
|
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.
Cheers,
Phoenix. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
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 |
|
|
Phoenix
New User
Joined: 27 Feb 2007 Posts: 20 Location: Chennai
|
|
|
|
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 ; 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.
Cheers.
Phoenix |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
Back to top |
|
|
Phoenix
New User
Joined: 27 Feb 2007 Posts: 20 Location: Chennai
|
|
|
|
Yup,
I think that would serve the purpose, thanks Bitneuker for your help.
Thanks Devzee.
Cheers,
Phoenix. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
You're wellcome |
|
Back to top |
|
|
|