BookmarkSubscribeRSS Feed
0 Likes

PROC SQL is a very powerful way to create macro variables but as far as I can only create LOCAL variables unless I %GLOBAL the names before running SQL.  It would be nice to add a GLOBAL option to the INTO statement so that macro variables are created as GLOBAL.

2 Comments
ballardw
Super User

The scope of the variables depends on where you create them. If your proc sql is not inside a macro the scope is global. The INTO creating variables behaves just like the %let statement for scope purposes.

eshupp
Obsidian | Level 7

I understand how it currently works.  I would rather add a GLOBAL parameter to my :INTO statement rather than code separate %GLOBAL statement(s) similar to the way you can tell SYMPUTX to create a GLOBAL variable with an optional parameter.