From: Sunny on 14 Jun 2010 15:44 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 14 Jun 2010 15:57 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 14 Jun 2010 18:37 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 14 Jun 2010 19:48 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.
|
Pages: 1 Prev: data manipulation question Next: correlation coefficient |