BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GeorgeSAS
Lapis Lazuli | Level 10

Hello everyone,

 

I want to print label of dataset(not variable)

DATA XX(LABEL = "This is the label of dataset xx");
X=999;
RUN;

PROC PRINT DATA=XX/LABEL;
RUN;


ERROR 200-322: The symbol is not recognized and will be ignored

 

Please help.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@GeorgeSAS wrote:

Hello everyone,

 

I want to print label of dataset(not variable)

DATA XX(LABEL = "This is the label of dataset xx");
X=999;
RUN;

PROC PRINT DATA=XX/LABEL;
RUN;


ERROR 200-322: The symbol is not recognized and will be ignored

 

Please help.

 

Thank you!


Sounds like you want a TITLE statement. If you want to do this automagically you would have to read the table properties, place the label into a macro variable and use that variable in a title statement.

 

data work.junk (label='This is a dataset label');
x=1;
run;

proc sql noprint;
   select memlabel into : labelvar
   from dictionary.tables
   where libname='WORK' and memname='JUNK'
   ;
run;

proc print data=work.junk ;
   title "&labelvar.";
run; title;

View solution in original post

1 REPLY 1
ballardw
Super User

@GeorgeSAS wrote:

Hello everyone,

 

I want to print label of dataset(not variable)

DATA XX(LABEL = "This is the label of dataset xx");
X=999;
RUN;

PROC PRINT DATA=XX/LABEL;
RUN;


ERROR 200-322: The symbol is not recognized and will be ignored

 

Please help.

 

Thank you!


Sounds like you want a TITLE statement. If you want to do this automagically you would have to read the table properties, place the label into a macro variable and use that variable in a title statement.

 

data work.junk (label='This is a dataset label');
x=1;
run;

proc sql noprint;
   select memlabel into : labelvar
   from dictionary.tables
   where libname='WORK' and memname='JUNK'
   ;
run;

proc print data=work.junk ;
   title "&labelvar.";
run; title;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 5527 views
  • 4 likes
  • 2 in conversation