Hi Both,
thanks for replying
Yes, I understand that proc print demonstrate. ive also tried the suggestion already.
I tried the dataset2, however it just gives me the orginal dataset2 with the VAR1,2,3
1/07/2016 1 0 1
8/07/2016 0 1 1
15/07/2016 0 0 1
Just wanting to know what option can you suggest to output the modified datset2 with the new labels as a dataset rather than a sas report
If you need this table be used to join to another table , Then apply my code on your final dataset .not the temporary table.
Hi Ksharp,
yes i have applied it and it works perfect.
just that when i open the dataset2, its not the modified version
i attached the file
View your proc contents.
Note that the LABEL is correct, but I'm suspecting you actually want to change the variable name, not the label.
Does that sound correct?
Datset2 doesn't have the labels after the proc datasets?
That doesn't seem correct, otherwise how can Proc print display it correctly?
Hi Reeza,
Yes, i want the variables name changable when i upload the dataset1 again with different column names
sorry wasnt clear before
thanks
Well the process is essentially the same. Modify the SQL query so there are no quotes in the macro variable. (Var1=apples vs var1="apples")
And then in proc datasets change the word label to rename.
Hi
i get this error, what does it mean?
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
thanks
@SASuserxx wrote:
Hi
i get this error, what does it mean?
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
thanks
You did something incorrectly.
Without seeing the code or rest of the log that's about all anyone can say.
This is a fairly common question as well so some searching will bring up code.
Hi,
when i tried the modification advised on the original problem, its works
then i modified to my real problem
proc sql noprint;
select cats(colname,'=',label,'') into : label separated by ' '
from dataset1;
quit;
proc datasets library=work nolist nodetails;
modify datset2;
rename &label ;
quit;
proc print data=datset2 noobs label;run;
data datset2_N;
set datset2;
run;
my code,
the proc print works and changes but the dataset doesnt change the same as the proc print data
proc sql noprint;
select cats(Variables,'=',Discription,' ') into : Discription separated by
from cfg.jp21vartable;
quit;
proc datasets library=in nolist nodetails;
modify jp21var;
rename &Discription;
quit;
proc print data=in.jp21var noobs label;
run;
data new;
set in.jp21var;
run;
Look at the description macro variable and/or compare to solutions posted. It seems incorrect. Why is the third parameter a space?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.