i created two variables like var1 and var2.
%let var1=10;
%let var2=raju;
how to create dataset from these two variables with titled dataset name as "age_name" .???
thanks inadvance.....
@raj143 wrote:
i created two variables like var1 and var2.
%let var1=10;
%let var2=raju;
how to create dataset from these two variables with titled dataset name as "age_name" .???
thanks inadvance.....
Why must a macro be involved? IF you are actually creating the macro variables with %let statements you are just adding work.
Data age_name;
var1=10;
var2 ='raju';
run;
would do it.
If the macro variable come from another process then YOU must know what type of value the data step variable would have to be and the result would look like:
Data age_name;
var1 = &var1.;
var2 = "&var2.";
run;
note that for macro text to resolve properly the values must be in double quotes, " ", not single quotes, ' '.
If you are asking how to create a data set named 10_raju, you should modify your plan. That's not a legal data set name.
There's not enough information in your initial post but I'm going to make a wild guess that you're looking for this:
https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/
@raj143 wrote:
i created two variables like var1 and var2.
%let var1=10;
%let var2=raju;
how to create dataset from these two variables with titled dataset name as "age_name" .???
thanks inadvance.....
@raj143 wrote:
i created two variables like var1 and var2.
%let var1=10;
%let var2=raju;
how to create dataset from these two variables with titled dataset name as "age_name" .???
thanks inadvance.....
@raj143 This is not twitter here so you've got actually ample space to formulate your problem and to even provide sample data....
Guessing what you're asking for:
%let var1=10;
%let var2=raju;
data &var2._&var1.;
set sashelp.class;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.