Thread: DB2 Coding
01-07-11, 15:49 #1Registered User
- Join Date
- Nov 2004
Unanswered: DB2 Coding
If I have one stored procedure on a file and code into that procedure that I only show records that have an end date parameter, meaning I have coded it so that it returns for instance only data that is valid prior to 11:59pm est 01/31/2011 then I have another stored procedure that runs the job on the first day of the month 2/1/2011, will the run time overridge the coding?
I am asking because we have DB2 programmers we paid lots of cash to code something for us and they said it was done. We have no way to verify it was done because they do not supply the code. They simply supply a raw file that has our subscribers names/id's and the choice they made when registering. But the file is to return all active folks during the month and not termed folks due to the end date parameter being coded. Well since July of 2010 we thought it was done but when we got our Dec file the 1st of Jan it showed we lost over 200 thousand subscribers which can't be because we know that 200 thousand were set to term but not until 1159pm on 12/31/2010. So this tells us either 1 they didn't code the end date parameter or two something happened during the dec load. We believe the first is valid because I personally went back and reviewed some subID's from Jul10, Aug10, Sep10, Oct10, Nov10 files and all have same cases. Termed subid's but the term date was 7/31/2010, 8/31/2010, etc. I even had cases where a term date in the Jul file was 8/1/2010. So to me it looks as if they said they coded but didn't. But then I got to thinking what if the stored procedure for the runtime overrides the stored procedure they coded for the end date parameter. The programmers think users are all stupid but since I am the report person who takes the data and uses it I do know a little something. Of course I told them to rectify the issue why not just disregard end dates coded in and run the file the last day of the month? Set the job to run at like 10pm or 11pm the last day of the month. That should be an easy thing to code. But management said no don't offer suggestions the team doesn't appreciate that. As in the team of programmers. I am like whatever. we still paid some serious dough for this so..............................I have programmers in my family and they are all kind of jerks if you correct them on anything or question their work.
01-09-11, 06:24 #2Registered User
- Join Date
- Sep 2004
Not really a DB2 issue, IMHO.
If I understand your problem correctly, you'll need to set up a "black box unit test" framework:
- Create a (bunch of) test database(s), relatively small but exhibiting all potential special cases that could occur sometime (like entries with and without end dates).
- Write out which output is expected from the program (for each of these test cases).
- Then run the program on each of the test cases and compare its outcome with the expected outcome.
Beware that "testing" is a complex art, just like programming is. The above is a very simplistic explanation of how to set up test cases. You'll probably want to hire a "tester", someone who knows the art (and has the tools to set up test cases).--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting