Hi
I have a table, example in attachment.
A slowly changing 2 dimension according to Kimball.
Key is just a surrogate key, a key to make rows unique
As you can see there are three rows for product A.
Timelines for this product are ok. During time the description of the product changes.
From 1-1-2020 up until 4-1-2020 the description of this product was ProdA1.
From 5-1-2020 up until 12-2-2020 the description of this product was ProdA2 etc.
If you look at product B, you see there are gaps in the timeline.
We use DB2 V12 z/Os. How can I check if there are gaps in the timelines for each and every product?
regards
Ron
Finding gaps in history table (slowly changing dimension 2)
Finding gaps in history table (slowly changing dimension 2)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 27
- Joined: Sun Aug 16, 2009 11:07 pm
- Skillset: cobol, db2, application performance tuning
- Referer: SEARCH
- Location: St. Cloud, Minnesota
Re: Finding gaps in history table (slowly changing dimension
This should be pretty simple, unload the table to a sequential file, sort it by product / start date. (for this I would recommend casting the dates to ISO format CCYYMMDD as it makes sorting much easier). The write a simple COBOL program to check for gaps in the timelines. This should be a pretty simple program to write.
Re: Finding gaps in history table (slowly changing dimension
I what if you don't have Cobol experience?
Isn't this just possible by writing a query in DB2?
Regards
Isn't this just possible by writing a query in DB2?
Regards
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Finding gaps in history table (slowly changing dimension
Prior to writing a code in any language, either SQL, or COBOL, or REXX, or Java, or SORT, or 100 other options you need first of all to find out (to develop, to search, to learn, to ask, etc.) what the acceptable algorithm should be to reach your goal?
The algorithms do not depend at all on the used language, or whatever. It only demonstrates: either the expert is able to think with his own mind, or he is able only to beg any free of charge ready to use solution from others...
It doesn’t matter did you have or not experience with COBOL, or whatever else. The way of thinking with ones own mind does not depend on any programming language, and even on any language at all!
The algorithms do not depend at all on the used language, or whatever. It only demonstrates: either the expert is able to think with his own mind, or he is able only to beg any free of charge ready to use solution from others...
It doesn’t matter did you have or not experience with COBOL, or whatever else. The way of thinking with ones own mind does not depend on any programming language, and even on any language at all!
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Finding gaps in history table (slowly changing dimension
The write a simple COBOL program to check for gaps in the timelines. This should be a pretty simple program to write.
can be done with sort, but at the end a simple COBOL program might be faster to develop and test
( or any other language the TS is comfortable with )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 11975
-
by socker_dad
View the latest post
Mon Sep 28, 2020 8:53 am
-
- 1
- 3222
-
by steve-myers
View the latest post
Sat Oct 31, 2020 5:35 pm
-
- 1
- 5988
-
by Robert Sample
View the latest post
Fri Aug 26, 2022 8:42 am
-
- 1
- 2574
-
by engh
View the latest post
Thu Jun 22, 2023 5:35 pm
-
-
Finding duplicate in variable lenght string in cobol
by kanipriya2785 » Fri Jun 17, 2022 10:02 pm » in IBM Cobol - 8
- 3389
-
by sergeyken
View the latest post
Wed Jun 22, 2022 3:10 am
-