Friends, I am fairly experienced in SAS but am finding hard to find a better way to handle the below problem in SAS.
I have a table with multiple fields. eg. Policy table with fields Pol_ref,Date,Premium fields. Pol_ref is not unique. First I need to check if the Pol_ref is within inputted date range. Once I get the Pol_ref, I will extract other fields from the table.
Currently it is done by having a subselect (applying date criteria) in the query but it is consuming lot of time as the table is massive. Also I cannot apply the date criteria on the main query because I will get latest record where as I want oldest record.
I can read all the Pol_refs into a SAS table but I am not sure how I can pass each Pol_ref to the where clause in the DB2 query. I think the option of reading the main table into a Sas dataset and joining both tables can be ruled out as the main table is quite large.
I gave subject as 'cursor logic' because this can be thought as first reading a lookup table into Sas and for each record processing a large table.
Please provide your thoughts on this.
Thanks alot!!!
I have a table with multiple fields. eg. Policy table with fields Pol_ref,Date,Premium fields. Pol_ref is not unique. First I need to check if the Pol_ref is within inputted date range. Once I get the Pol_ref, I will extract other fields from the table.
Currently it is done by having a subselect (applying date criteria) in the query but it is consuming lot of time as the table is massive. Also I cannot apply the date criteria on the main query because I will get latest record where as I want oldest record.
I can read all the Pol_refs into a SAS table but I am not sure how I can pass each Pol_ref to the where clause in the DB2 query. I think the option of reading the main table into a Sas dataset and joining both tables can be ruled out as the main table is quite large.
I gave subject as 'cursor logic' because this can be thought as first reading a lookup table into Sas and for each record processing a large table.
Please provide your thoughts on this.
Thanks alot!!!