After creating a prompt in Enterprise Guide, how can I see the macro variables the prompt creates?

StackOverflow https://stackoverflow.com/questions/9097749

  •  21-04-2021
  •  | 
  •  

Question

It would be nice to know how to reference the macro variables in other tasks/code nodes.

Was it helpful?

Solution

You could take a snapshot of SASHELP.VMACRO (macro variable dictionary table):

data macs;
  set sashelp.vmacro;
run;

This can be handy if, for example, you want to compare the macro variables present at one point in a process versus those present at another point:

data macs_before;
  set sashelp.vmacro;
run;

...
... /* Other stuff here... */
...

data macs_after;
  set sashelp.vmacro;
run;

OTHER TIPS

Once the prompt has been executed, you can see declared macro variables, in the log, by executing the %Put statement (in a program/code node):

%put _all_;       %* Lists the values of all user-generated and automatic macro vars ;
%put _automatic_; %* SAS macro vars. Depend on SAS version and products installed;
%put _global_;    %* lists user-generated global macro vars;
%put _local_;     %* lists user-generated local macro vars;
%put _user_;      %* describes user-generated global and local macro vars ;

However, EG (ver 4.3 and 4.2) has an easy way to view the macro vars that are created by a prompt (which comes in handy when the prompt is a range type and creates multiple macro vars)

  1. From within EG choose the VIEW menu item,
  2. Then select PROMPT MANAGER
  3. Then right-click on your prompt and choose "Show Macro Variables..."
  4. A dialog will then display all macro variables
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top