Fetching Previous Day's date

IBM's flagship relational database management system

Fetching Previous Day's date

Postby bhaskar.naidu » Mon Jul 06, 2009 12:20 pm

In my JCL, I am using DNSTIAUL to fetch records from a table which has a huge number of records in which My where clause is trying to get the previous day's date using the timestamp from the table. This Query is taking a lot of time in executing the JCL.
Is there any way by which I can tweak my query and reduce the execution time?

Posts: 1
Joined: Mon Jul 06, 2009 12:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Fetching Previous Day's date

Postby dick scherrer » Mon Jul 06, 2009 11:51 pm


If the timestamp is not a key/index, the entire table must be read to select the rows you want.

You might try unloading the entire table and then use your sort product to select the rows you want to use. Suggest you ask your dba which is the fastest tool to use to unload an entire table on your system.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Return to DB2


  • Related topics
    Last post