HI tampham92,
The code what you are trying to execute, if it's working fine then you can try the below code and see if there is any difference in the execution time.
%macro loopthrough(from_date, to_date);
LIBNAME test1 db2 DSN='xxx' USER='xxx' PASSWORD='xxx';
%local filedate;
%do filedate=&from_date %to &to_date;
%if %substr(&filedate,5,2) ge 01 AND %substr(&filedate,5,2) le 12 %then %do;
/* %if %substr(&filedate,5,2) = 12 %then %do;*/
data _null_;
tmp = intnx('month',input("&filedate",yymmn6.),0,'e');
call symput('adate',put(tmp, yymmdd10.));
run;
Proc DS2;
thread newton2/overwrite=yes;
method run();
set {
SELECT * FROM connection to test1
(SELECT
DW.RLTN_DIM.A AS ACCT_NBR,
ORG_HIST_INT.B AS AffiliateNumber,
...
FROM
...
WHERE
...
)};
end;
endthread;
data Data QRM_DEP_REF_&filedate/overwrite=yes;
dcl thread newton2 frac1; /* Declare an Instance of the newton thread */
method run();
set from frac1 threads=4; /* <--- You Change the number of threads to control the threaded reads */
end;
enddata;
run;
quit;
%end;
%end;
%mend;
%loopthrough(from_date=201303, to_date=201303);
I am actually still learning the PROC DS2, because it's bit different from the PROC SQL and we need to think everything from the ANSI C Standard prospective.
Please try and check. I believe somehow the real time will be reduced.
Thanks
... View more