BookmarkSubscribeRSS Feed
Andres_Fuentes1
Calcite | Level 5

Hello, good morning everyone, I have a query. I would like to do the following: when running a process the user has to enter a variable or parameter (numeric) that SAS requests, and this is saved in a table with a single record. 

Like That

Andres_Fuentes1_1-1628174324637.png

 

 

and Results 

Andres_Fuentes1_2-1628174351072.png

 

Thanks

 

 

 

2 REPLIES 2
andreas_lds
Jade | Level 19

A parameter is a macro-variable, all macro-variables are also stored in sashelp.vmacro, so if your parameters all start with a common prefix you can do:

data work.Parameter;
   set sashelp.vmacro;
   where Name =: 'PAR_';

   keep name value;
run;

proc transpose data=work.Parameter out=work.want(drop= _name_ _label_);
   var value;
   id name;
run;

If your parameter don't have a common prefix, adjust the where-statement  to your needs.

 

EDIT: proc transpose got lost during copy/paste.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 443 views
  • 0 likes
  • 3 in conversation