BookmarkSubscribeRSS Feed
Macro
Obsidian | Level 7

Hi,

Anyone know why the following does nnot work?

%put %sysfunc(input('10',4.));

%put %sysfunc(rand('binomial',0.5,10));

The log says that the input function is not found. It says 'binomial' is out of range of offered distributions. Clearly 'binomial' is one of the options. So what is wrong with these statements? Thanks.

2 REPLIES 2
AhmedAl_Attar
Rhodochrosite | Level 12

Use inputn for the first statement, and remove the quotes from both statements

Ahmed

Tim_SAS
Barite | Level 11

The INPUT function is one of the functions that you can't use with %sysfunc. Use INPUTN or INPUTC instead.

Also "Because %SYSFUNC is a macro function, you do not need to enclose character values in quotation marks as you do in DATA step functions".

See "%SYSFUNC and %QSYSFUNC Functions" here: SAS(R) 9.2 Macro Language: Reference

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
  • 2 replies
  • 1128 views
  • 0 likes
  • 3 in conversation