Help using Base SAS procedures

Macro, get variable into code

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

Macro, get variable into code

I dont understand in the below code how do I put 'C' into the macro code? &strike goes in well, but &C does not?sert v

%MACRO want(strike, type);

       DATA rawdata.have;

         SET rawdata.euro;

         where Indicator=&type and Strike=%SYSEVALF(&strike*0.001)

       run;

%MEND GetOptionsData;

%want(1575, C);

I get the log saying 'ERROR: Variable C is not on file RAWDATA.EURO.'


Accepted Solutions
Solution
‎05-04-2012 05:35 AM
Super Contributor
Posts: 349

Re: Macro, get variable into code

Hi,

%MACRO want(strike, type);

       DATA rawdata.have;

         SET rawdata.euro;

         where Indicator="&type" and Strike=%SYSEVALF(&strike*0.001)

       run;

%MEND GetOptionsData;

%want(1575, C);

Thanks,

Shiva

View solution in original post


All Replies
Solution
‎05-04-2012 05:35 AM
Super Contributor
Posts: 349

Re: Macro, get variable into code

Hi,

%MACRO want(strike, type);

       DATA rawdata.have;

         SET rawdata.euro;

         where Indicator="&type" and Strike=%SYSEVALF(&strike*0.001)

       run;

%MEND GetOptionsData;

%want(1575, C);

Thanks,

Shiva

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 138 views
  • 0 likes
  • 2 in conversation