From: Sunny on
How to resolve macro variable in double qoutes inside single quotes
right now it is saving as by name keltnerand&dsn2


%macro createExcel( dsn2 = xyz);


some code ....

then

put '[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]';

%mend;


Thanks

Sunny
From: Ya on
On Jun 14, 12:44 pm, Sunny <msunn...(a)gmail.com> wrote:
> How to resolve macro variable in double qoutes inside single quotes
> right now it is saving as by name keltnerand&dsn2
>
> %macro createExcel( dsn2 = xyz);
>
> some code ....
>
> then
>
> put '[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]';
>
> %mend;
>
> Thanks
>
> Sunny

Try this:

put '[SAVE.AS("c:\temp\keltnerand' "&dsn2..xls" '")]';

HTH

Ya
From: RolandRB on
On Jun 14, 9:44 pm, Sunny <msunn...(a)gmail.com> wrote:
> How to resolve macro variable in double qoutes inside single quotes
> right now it is saving as by name keltnerand&dsn2
>
> %macro createExcel( dsn2 = xyz);
>
> some code ....
>
> then
>
> put '[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]';
>
> %mend;
>
> Thanks
>
> Sunny

How to "resolve" a macro variable? Why, use the resolve() function.

12 %let dsn2=XXXXX;
13
14 data _null_;
15 str=resolve('[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]');
16 put str;
17 run;

[SAVE.AS("c:\temp\keltnerandXXXXX.xls")]
From: Sunny on
On Jun 14, 6:37 pm, RolandRB <rolandbe...(a)hotmail.com> wrote:
> On Jun 14, 9:44 pm, Sunny <msunn...(a)gmail.com> wrote:
>
>
>
>
>
> > How to resolve macro variable in double qoutes inside single quotes
> > right now it is saving as by name keltnerand&dsn2
>
> > %macro createExcel( dsn2 = xyz);
>
> > some code ....
>
> > then
>
> > put '[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]';
>
> > %mend;
>
> > Thanks
>
> > Sunny
>
> How to "resolve" a macro variable? Why, use the resolve() function.
>
> 12   %let dsn2=XXXXX;
> 13
> 14   data _null_;
> 15     str=resolve('[SAVE.AS("c:\temp\keltnerand&dsn2..xls")]');
> 16     put str;
> 17   run;
>
> [SAVE.AS("c:\temp\keltnerandXXXXX.xls")]

Thanks for the reply Ya and roland
I appreciate your help its working fine for me now.