DATA Step, Macro, Functions and more

How do I export numeric data to Excel as numeric using DDE? Output formats as char

Reply
Occasional Contributor
Posts: 5

How do I export numeric data to Excel as numeric using DDE? Output formats as char

Hello,

I have a SAS dataset with several variables, 1 is formatted as a date, the rest are standard 1 or 2 digit numbers (with some missing ".").

I am trying to export them to a specific range on an excel sheet using DDE, but when I do, it writes to excel as if the numeric data were character. I want the data on the excel sheet automatically formatted as numeric, so that I don't have to manually convert character to numeric in excel

My code is the following:

OPTIONS NOXSYNC NOXWAIT;
X '"C:\filelocation\Masterau.xlsx"';


FILENAME Masterau DDE "excel|C:\filelocation\[Masterau.xlsx]Sheet1!r8007c2:r8037c10";

DATA _null_;
  SET dataset;
  FILE Masterau COLUMN = cpos;
  PUT date max min average diff q1 q2 val1 val2;

RUN;

Can anyone tell me what I need to add to the DDE process to format it as numeric?  I have searched for answers, but none seem to work for my situation

Thanks



Ask a Question
Discussion stats
  • 0 replies
  • 169 views
  • 0 likes
  • 1 in conversation