BookmarkSubscribeRSS Feed
manojinpec
Obsidian | Level 7


Hi,

Please see if someone can help:-

When i am running following program it is running fine:-

 

filename example1 dde 'excel|System';

data _null_;

set load_time2;

file example1;

if ((final_delay)='No Delays') then do;

put '[select("R11C23")]';

put '[patterns(1,,6,true)]'; /* color it red */

end;

run;

However when i am trying  to use macro variable for Row  It is giveing me SAS DDE Error.

filename example1 dde 'excel|System';

data _null_;

set load_time2;

file example1;

if ((final_delay)='No Delays') then do;

put '[select("R&part.C23")]';

put '[patterns(1,,6,true)]'; /* color it red */

end;

run;

Please assist

3 REPLIES 3
Amir
PROC Star

Hi,

Assuming you have set up the macro variable with the required value, I suspect it is not resolving because of the single quotes that surround the put string.

Try using:

put '[select("R' "&part" 'C23")]';

Regards,

Amir.

manojinpec
Obsidian | Level 7

Hi Amir,

Macro is resolving same as we required. However i suspect there might be some conflict netween DDE and MAcro engine.

Anybody can help?

art297
Opal | Level 21

manojinpec: You never posted the code showing how you are creating the macro variable &part.  Your original code wouldn't have resolved correctly, anyhow, but Amir's solution did work if the macro variable had been created correctly.  Did you test it using the mlogic symbolgen and mprint options?

I took dde out of the equation and ran the following to see if you were creating what you expected to create.  You might want to try to do the same with your current code:

data load_time2;

  informat final_delay $20.;

  input final_delay &;

  cards;

Some Delays

No Delay

No Delays

Lots of Delays

;

%let part=11;

data _null_;

  set load_time2;

  file "c:\testdde.txt";;

  if ((final_delay)='No Delays') then do;

    put '[select("R' "&part" 'C23")]';

    put '[patterns(1,,6,true)]'; /* color it red */

  end;

run;

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1177 views
  • 0 likes
  • 3 in conversation