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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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