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!!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1526 views
  • 0 likes
  • 1 in conversation