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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: