Hi,
I want to Create Dynamic Parameters From Excel .
I have this structure:
| Var | value |
| current_offer | 5 |
| ofer Structure | 10 |
| 4087_current | 0.21 |
| Kizba_Adif_Q-1 | 0.0021 |
| Kizba_Adif_Q-2 | 0.2 |
| i_adif | 0.65 |
and the expected results :
¤t_ofer=5
ofer Structure=10
....
&i_adif=0.65
Any ideas?
Best Regards
Step 1: read the Excel file into a SAS data set named HAVE
Step 2:
data _null_;
set have;
call symputx(var,value);
run;
Please note that your second row, which has a space in the VAR column, will not work with this method (or any method) as macro variable names cannot have a space; and so you will have to fix the second row.
Step 1: read the Excel file into a SAS data set named HAVE
Step 2:
data _null_;
set have;
call symputx(var,value);
run;
Please note that your second row, which has a space in the VAR column, will not work with this method (or any method) as macro variable names cannot have a space; and so you will have to fix the second row.
@CurtisMackWSIPP wrote:
Nor will those that start with numbers.
Good point! And macro variable names can't have hyphens in them either.
Looks like @jony123 will have to modify the VAR column in either Excel or SAS so that it conforms to the rules for macro variable names.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.