karlomutschler
Programmer
hi and good day,
need to develop an updateroutine for our report data.
Script 1 gathers the data from a definite starting point eg. start of financial year to date.
After successful completion ORA-table MaxDate is created.
Script 2 is the update part for Script 1.
According to the value stored in the MaxDate table it will gather the data from the StartDate to CurrDate.
With a proc sql statement we read the data from the MaxDate table and create a SAS-Table MaxDate.
rsubmit;
proc sql;
connect to oracle(user="&user" password="&pwd" path="db" buffsize=200);
create table MaxDate as
select * from connection to oracle
(
SELECT MaxDate
FROM MaxDate
);
quit;
endrsubmit;
This value now has to to be uses to determine &StartDate for Script 2.
rsubmit;
proc sql;
connect to oracle(user="&user" password="&pwd" path="db" buffsize=200);
create table CurrPeriod as
select * from connection to oracle
(
SELECT PRODUCT_SUBSCRIPTION_ID,
SERVICE_CODE,
SALES_ORG_CHANNEL_RD,
SALES_ORG_REGION_RD,
trunc(EFFECTIVE_REPORT_DATE),
NUMBER_OF_ITEMS
FROM ReportData_FACT
WHERE TRANSACTION_TYPE = 'E'
AND EFFECTIVE_REPORT_DATE >= to_date(&StartDate, 'yyyymmdd')
);
quit;
endrsubmit;
How would I accomplish this task
Tips and suggestions would be highly appreciated.
Thanks in advance.
Kind regards
Karlo
need to develop an updateroutine for our report data.
Script 1 gathers the data from a definite starting point eg. start of financial year to date.
After successful completion ORA-table MaxDate is created.
Script 2 is the update part for Script 1.
According to the value stored in the MaxDate table it will gather the data from the StartDate to CurrDate.
With a proc sql statement we read the data from the MaxDate table and create a SAS-Table MaxDate.
rsubmit;
proc sql;
connect to oracle(user="&user" password="&pwd" path="db" buffsize=200);
create table MaxDate as
select * from connection to oracle
(
SELECT MaxDate
FROM MaxDate
);
quit;
endrsubmit;
This value now has to to be uses to determine &StartDate for Script 2.
rsubmit;
proc sql;
connect to oracle(user="&user" password="&pwd" path="db" buffsize=200);
create table CurrPeriod as
select * from connection to oracle
(
SELECT PRODUCT_SUBSCRIPTION_ID,
SERVICE_CODE,
SALES_ORG_CHANNEL_RD,
SALES_ORG_REGION_RD,
trunc(EFFECTIVE_REPORT_DATE),
NUMBER_OF_ITEMS
FROM ReportData_FACT
WHERE TRANSACTION_TYPE = 'E'
AND EFFECTIVE_REPORT_DATE >= to_date(&StartDate, 'yyyymmdd')
);
quit;
endrsubmit;
How would I accomplish this task
Tips and suggestions would be highly appreciated.
Thanks in advance.
Kind regards
Karlo