Hi, I have this code and want to populate the excel speadsheet below by DDE. For some reason only the first cell will populate and the others won't, any idea why please? The ROW number is 93 and spread from COLUMN 3 - 11.
%macro outbal(var);
proc means data=Additional_Dataset sum;
var balance_outstanding;
where &var.=1;
output out=&var._balance(drop=_type_ _freq_) sum=;
run;
data &var._balance;
set &var._balance;
percent=balance_outstanding/&total_bal.;
balance_outstanding=balance_outstanding/1000000;
run;
%mend (var);
%outbal(unsec_resless199);
%outbal(unsec_resless299);
%outbal(unsec_resless399);
%outbal(unsec_resless499);
%outbal(unsec_resless599);
%outbal(unsec_resless699);
%outbal(unsec_resless799);
%outbal(unsec_resless899);
%outbal(unsec_resless1100);
%outbal(unsec_resplus1100);
data all_unsec_balance;
set
unsec_resless199_balance
unsec_resless299_balance
unsec_resless399_balance
unsec_resless499_balance
unsec_resless599_balance
unsec_resless699_balance
unsec_resless799_balance
unsec_resless899_balance
unsec_resless1100_balance
unsec_resplus1100_balance;
run;
filename odata dde
"Excel|G:\Mortgages\Optimum\Reporting Challenger\[Co-Op MI Credit Risk.xlsx]Data!R96C3:R96C11" notab ;
DATA _NULL_;
SET all_unsec_balance;
FILE odata dlm='09'x;
PUT percent;
RUN;
Lo-199 | 200 - 299 | 300 - 399 | 400 - 499 | 500 - 599 | 600 - 699 | 700 - 799 | 800- 899 | 900-1100 | 1100+ | |
R | 0.02547145 |
If you're exporting to a specific range why not try a straight proc export instead of DDE?
Im new to DDE so im unsure as to how I do that.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.