Produce a Table Containing Parameters

Accepted Solution Solved
Reply
Contributor
Posts: 51
Accepted Solution

Produce a Table Containing Parameters

I've got a Process Flow in Enterprise Guide 5.1 that uses a number of Parameters.  The Parameters are a mix of numbers and dates.  I want to use a Code Node to produce a table that lists these parameters, one column for the parameter name and another for the entered value.

 

Can anyone point me in the right direction?


Accepted Solutions
Solution
‎02-28-2017 06:00 AM
Super User
Super User
Posts: 7,401

Re: Produce a Table Containing Parameters

There is a view in SAS called VMACRO which has all the macro data in, so you could do (and not sure if EG uses same terminology):

data want;
  set sashelp.vmacro (where=(name in ("MVAR1","MVAR2")));
run;

The above takes MVAR1/2 macro variable information and creates a dataset of it.  This has name and parameter.

View solution in original post


All Replies
Solution
‎02-28-2017 06:00 AM
Super User
Super User
Posts: 7,401

Re: Produce a Table Containing Parameters

There is a view in SAS called VMACRO which has all the macro data in, so you could do (and not sure if EG uses same terminology):

data want;
  set sashelp.vmacro (where=(name in ("MVAR1","MVAR2")));
run;

The above takes MVAR1/2 macro variable information and creates a dataset of it.  This has name and parameter.

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Hello, thanks for your help.  

 

That code produces an empty table with the column headers, "scope", "name", "offset" and "value".

 

Is it looking just at Macros?  I don't have any Macros, only parameters, or prompts as I've remembered they're called in version 5.1.

Super User
Super User
Posts: 7,401

Re: Produce a Table Containing Parameters

Ah, yes thats just macro values, I thought prompt values in EG are macro values?  Anyways, there's likely to be another table in SASHELP library which holds the data, I don't have EG so can't tell you, but open an explorer window and have a look at the Vxxx tables in SASHELP.

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Thanks, there's a VPROMPT in there, so I'll start from that....

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

VPROMPT looks right, columns are libname, memname, name, propmtname, id, text, type, length, promptype, dependentpid, description

 

But the table is blank.  I've associated the rompts with the code node, so while running the code it asks for the prompts, the prompts also have default values which must be stored somewhere.  

Super Contributor
Posts: 259

Re: Produce a Table Containing Parameters

EG parameters are stored in sashelp.vmacro. SAS changes the names to be all upcase. The parameters must have been assigned to the program-node.

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Thanks, yes I've found the prompts in VMACRO, so I know where they are now.  The prompts are associated with the Code Node in it's properties too.  Jus tneed to make it work now....

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Got it to work now, thanks!

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Quick follow-up question; how do I ammend the above code to specify which columns to include in the output?

 

Thanks

Super User
Super User
Posts: 7,401

Re: Produce a Table Containing Parameters

You can do it many ways, for instance adding keep to the dataset only keeps the specified variables:

data want;
  set sashelp.vmacro (where=(name in ("MVAR1","MVAR2")) keep=name);
run;

Drop is the opposite.  You could also do it in the report procedure etc. 

Contributor
Posts: 51

Re: Produce a Table Containing Parameters

Great, thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 205 views
  • 3 likes
  • 3 in conversation