Help using Base SAS procedures

Dataset Label

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 145
Accepted Solution

Dataset Label

Hi,

I have dataset with 10 variables. One of the variables represents the dataset LABEL.  I would like to know if there is way to LABEL the dataset based on the variable value.

Thanks


Accepted Solutions
Solution
‎10-30-2014 04:01 PM
Respected Advisor
Posts: 3,124

Re: Dataset Label

Not sure what your data looks like and what you exactly want, the following code may or may not hit the nail:

data test;

     set sashelp.orsales(obs=1);

run;

DATA _NULL_;

     set test;

     call symputx('dlabel', product_group);

     stop;

run;

proc datasets lib=work;

     modify test (label="&DLABEL");

quit;

proc sql;

     select MEMlabel from dictionary.tables where LIBNAME='WORK' AND MEMNAME='TEST';

QUIT;

Haikuo

View solution in original post


All Replies
Solution
‎10-30-2014 04:01 PM
Respected Advisor
Posts: 3,124

Re: Dataset Label

Not sure what your data looks like and what you exactly want, the following code may or may not hit the nail:

data test;

     set sashelp.orsales(obs=1);

run;

DATA _NULL_;

     set test;

     call symputx('dlabel', product_group);

     stop;

run;

proc datasets lib=work;

     modify test (label="&DLABEL");

quit;

proc sql;

     select MEMlabel from dictionary.tables where LIBNAME='WORK' AND MEMNAME='TEST';

QUIT;

Haikuo

Frequent Contributor
Posts: 145

Re: Dataset Label

Perfect Sir...This is what i want... Thanks

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 368 views
  • 1 like
  • 2 in conversation