BookmarkSubscribeRSS Feed
vandhan
Fluorite | Level 6

Can I use all datastep function in macro using %sysfunc??

 

OR do we have limited function where I can use with %sysfunc??

 

Please help

5 REPLIES 5
FreelanceReinh
Jade | Level 19

There are exceptions. Please see the list of "SAS Functions Not Available with %SYSFUNC and %QSYSFUNC" in the documentation.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

A more important question than "do we have limited function where I can use with %sysfunc?", is when is it a good idea to go down that route.  Sysfunc is a great command, and useful in many situations, but if you find your using it a lot, then you may want to look at your code and see if it can be written in such a way as to be more readble.  To often things like:

%sysfunc(intnx(%sysfunc(input(...),%sysfunc(...

is used just to squeeze normal Base SAS code into macro form.  I rarely come across situations where base SAS cannot do something far simpler, and easier to read.

dcruik
Lapis Lazuli | Level 10

There are limited SAS functions that can be used with %sysfunc, and there are also macro specific functions you can use without the %sysfunc.  I would suggest looking at the documentation that has been provided to determine which function you want and if it's already a macro function, or if you can use it inside a %sysfunc.

kannand
Lapis Lazuli | Level 10

Would it be possible to elaborate on what you are trying to accomplish with the function ? 

Kannan Deivasigamani

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
  • 5 replies
  • 934 views
  • 2 likes
  • 6 in conversation