BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to format a macro call from within a datastep using the call execute statement. I have not figured out how to format the parameter.
The parameter needed is a list of quoted strings:
'0001','0002','0003','0004'

When I EXECUTE I get the following error:
ERROR: More positional parameters found than defined.

So apparently my list is being interpretted as 4 parameters rather than one.
How can I get this parameter to pass through OK?

my code:
CALL EXECUTE ( '%getInfo(' || cust_nbrs || ');');
4 REPLIES 4
deleted_user
Not applicable
Archie,

Your better off using Proc Sql for something like this.

Post more of your code and see if I can help you further.
deleted_user
Not applicable
Hi,

try this:
CALL EXECUTE ( '%getInfo(%quote(' || cust_nbrs || '))');

Hope this works.
deleted_user
Not applicable
No, that does nothing, I tried all the functions like that I could find. Only work around I could come up with is to create indexed global variables for each parameter string, and then call the macro with each global parameter after the data step is done. What a pain!!!
deleted_user
Not applicable
Oops....I spoke too soon....this actually does work !!!

Thank you for your thoughtfullness!!!

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 759 views
  • 0 likes
  • 1 in conversation