View previous topic :: View next topic
|
Author |
Message |
thanoozm
New User
Joined: 23 May 2007 Posts: 26 Location: hyderabad
|
|
|
|
We are trying to develop a new module for report purpose. The main functionality of this module is
1)Read some student number from file (this is numeric)
2)Search it in tablea with student number, and prefix of student number can be (A,B,C and D) – I need to retrive all the rows with (any prefix).
EX: student numbers is 123,
if Table A has like this
Prefix Number Dep no
A 123 1
B 123 2
C 123 3
D 123 4
I need to able to read all the four numbers from table I need to write report Under student no123
3)I need to read next record from input file (different student number) and repeat 2 step. This process has to repeat until end off the file.
I am having problem with this I have written code it is taking 10 hours to run in production. It is huge amount of CPU time using. I need to reduce time.
My input file is getting 10,000 records and Table A has (8lakhs records), I have write cursor on Table A with conditions. Cursor is getting maximum off 100 records. Do we have any options to reduce time consuming? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what are the datatype definitions for your table?
what is the potential range of PREFIX
what does your declare cursor look like?
what does the jcl for the step that invokes your program look like?
use the BBcode CODE tags |
|
Back to top |
|
|
thanoozm
New User
Joined: 23 May 2007 Posts: 26 Location: hyderabad
|
|
|
|
Data type of Prefix is character(1) and maximum it can have 35(26 alphabets and 9 numeric) but I need to consider only 5 prefixes(A,B,C,D and E).
I am using IKJEFT01 utility |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, since you can only have 35 potential rows returned per Number
it makes no sense to have 100 returned by the cursor,
which is why I asked: what does your declare cursor look like?
|
|
Back to top |
|
|
thanoozm
New User
Joined: 23 May 2007 Posts: 26 Location: hyderabad
|
|
|
|
Hi Dick,
Correct what ever you said but I have not mentioned one point. Depart meant numbers can be any number (it has one character and 6 numeric), If depart meant number varies i need to accept that row also.
Prefix Number Dep no
A 123 1
B 123 2
C 123 3
D 123 4
A 123 2
A 123 3
In above case i will get more rows. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what does the following (which you sent me in a PM)
have to do with what you stated in your first post.
Code: |
EXEC SQL
DECLARE CUR-GET-PAYMUM CURSOR FOR
SELECT DISTINCT B.POLICY_IDENTITY
,B.INDIVIDUAL_IDENT
,A.TITLE
,A.SURNAME
,A.FORENAME
FROM VMWI_BASIC01 A
, VMWD_B_DTLS01 B
WHERE A.MAX_INIT_ANNTY_ASS = 'N'
AND A.INDIVIDUAL_IDENT = B.INDIVIDUAL_IDENT
AND A.CURRENT_STATUS IN ('S','I','N')
AND B.POLICY_IDENTITY LIKE :WS-SCHEMENUM-DB2
END-EXEC.
|
Private Message wrote: |
VMWI_BASIC01 this table has 4lakhs and VMWD_B_DTLS01 this table has around 8lakhs records. My input scheme number present in WS-SCHEMENUM-DB2 I have added % to get all the prefix with that scheme.
|
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
and stop sending me private messages.
there is a very large difference between what you described in your first post and what you are actually doing.
get an explain of the cursor and work with that.
I don't like joins, but the LIKE clause does not thrill me.
and sort your IN-list
instead of IN ('S','I','N')
should be IN ('I','N','S')
only thing I can suggest based on the information that I have is buffer up your input and output files (30 or 40).
we have no idea about your system, your tables, their interrelationships.
work with the explain and get the sql pared down as best you can on your end. |
|
Back to top |
|
|
thanoozm
New User
Joined: 23 May 2007 Posts: 26 Location: hyderabad
|
|
|
|
Thanks Dick, |
|
Back to top |
|
|
|