DATA Step, Macro, Functions and more

%sysfunc questions

Reply
Contributor
Posts: 50

%sysfunc questions

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.

Regular Contributor
Posts: 213

Re: %sysfunc questions

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

Ahmed

Super Contributor
Posts: 394

Re: %sysfunc questions

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

Ask a Question
Discussion stats
  • 2 replies
  • 269 views
  • 0 likes
  • 3 in conversation