BookmarkSubscribeRSS Feed

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-199200 - 299300 - 399400 - 499500 - 599600 - 699700 - 799800- 899900-11001100+

R

0.02547145
3 REPLIES 3
Reeza
Super User

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.

Reeza
Super User

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 893 views
  • 0 likes
  • 2 in conversation