Hi all,
I've been trying to solve this problem on and off for a number of days without much luck. Appreciate any thoughts on it.
I create this variable:
%let today = today();
data _null_;
call symput ('Stamp',"Report created: "||put(today(),mmddyy10.));
run;
%put &Stamp;
It gives me the following: Report created: mm/dd/yyyy
All I want to do is take this variable and export it to a specific cell in excel. Seems easy, maybe it is, but I haven't been able to figure out how to do it without creating a table in SAS first.
I can't use DDE because the code will ultimately run from a server that does not have excel installed. I can do it locally but ultimately that's not gonna work.
Code for the curious:
options noxwait noxsync xmin;
%sysexec "&Directory\&tprogram..xlsb";
data _null_;
rc = sleep(15);
run;
filename Workbook DDE 'Excel|Sheet1!R1C1';
data _null_;
file Workbook;
Stamp = "&Stamp";
put Stamp;
run;
I've resorted to creating a table and appending it.:
data Stamp;
Time_Stamp = "&Stamp";
run;
Libname WrkBk EXCEL "&directory\&program..xlsb" Scan_Text = No;
PROC DATASETS
LIB = WrkBk;
DELETE Stamp;
RUN;
QUIT;
PROC APPEND
BASE = WrkBk.Stamp
DATA = Stamp;
RUN;
Libname WrkBk CLEAR;
Is there a way to just export the variable without having to go through the process of creating a table for it while also not using DDE? Maybe ODS? Appreciate any thoughts.
Not if you want it in a specific cell.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.