BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rnmishra
Calcite | Level 5

I have created two macro variable (B0 and B3)this way...

............

data _null_;

    set abc;

if variable="Intercept" then

        call SYMPUTX("B0", estimate);

if variable="logX3" then

        call SYMPUTX("B3", estimate);

run;

/* After this I have created a data set aa

as

data aa; m=&B0;n=&B1;run;

Found that both m and n are numeric-I have done this to check the variable types*/

Finally, I am interested to use these variables as

PROC NLIN Data=Prob20;

    Parms gamma0 = 10**&B0    gamma3=&B3;

    MODEL Y=gamma0*X3**(gamma3);

RUN;

But this what it returned

Here is the error message

Thanks in advance for any help.

Raghu

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Yes it can, wrap it in the %sysevalf function to resolve it.

parms gamm0=%sysevalf(10**&B0) gamm3=&b3;

ALL macro variables are character, so testing to see if they're numeric is pointless.

View solution in original post

3 REPLIES 3
Reeza
Super User

Yes it can, wrap it in the %sysevalf function to resolve it.

parms gamm0=%sysevalf(10**&B0) gamm3=&b3;

ALL macro variables are character, so testing to see if they're numeric is pointless.

rnmishra
Calcite | Level 5

Thanks Reeza.

Appreciate your skills.

Andre
Obsidian | Level 7

Raghu

%let calc=%sysevalf(10**&b0.);

PROC NLIN Data=Prob20;

    Parms gamma0 = &calc.    gamma3=&B3;

    MODEL Y=gamma0*X3**(gamma3);

RUN;

Try this the return is without error for me except the table which is not existing.

the macro variable calc contain the exact TEXT that will be substituted in your parms instruction

AS Macro variable contains always text

and as it seems that  exponient is not allowed

74   Parms gamma0 =11**1gamma3=&B3;

ERROR 200-322: The symbol is not recognized and will be ignored

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
  • 601 views
  • 0 likes
  • 3 in conversation