data s ;
name='joseph' ;
new='peter ';
run;
how to assign value of name variable as a label of new variable like see below
| joseph |
he is a stat programmer |
|
harish | harish |
I don't understand your example.
Is this what you want ?
data _NULL_;
set s;
call execute(cats('data S; set S; label new="',name,'"; run;'));
run;
Sorry, but i don't understand what you try to do.
What happened to Peter?
@thanikondharish wrote:
data s ;
name='joseph' ;
new='peter ';
run;how to assign value of name variable as a label of new variable like see below
joseph
he is a stat programmer
harish
harish
@thanikondharish wrote:
data s ;
name='joseph' ;
new='peter ';
run;how to assign value of name variable as a label of new variable like see below
joseph
he is a stat programmer
harish
harish
LABEL is a variable property. You can only have one label for a given variable. And does it need to be a label of a variable or the column heading for a report?
Give a more complex example of what you are attempting such as with three records with different values of name and "new" and what the resulting data set should look like.
Proc Transpose can use the value of variable to NAME a variable using the ID statement.
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.