Desktop productivity for business analysts and programmers

How to format macro parameter

Reply
N/A
Posts: 0

How to format macro parameter

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 || ');');
N/A
Posts: 0

Re: How to format macro parameter

Archie,

Your better off using Proc Sql for something like this.

Post more of your code and see if I can help you further.
N/A
Posts: 0

Re: How to format macro parameter

Hi,

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

Hope this works.
N/A
Posts: 0

Re: How to format macro parameter

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!!!
N/A
Posts: 0

Re: How to format macro parameter

Oops....I spoke too soon....this actually does work !!!

Thank you for your thoughtfullness!!!
Ask a Question
Discussion stats
  • 4 replies
  • 121 views
  • 0 likes
  • 1 in conversation