Johan
Johan

Reputation: 45

Add title to a SAS dataset

I hope that you can help me out with a question.

After creating a summarizing table (using proc summary, proc means etc.), I would like to add a title to the dataset. It's not the easiest thing to remember sample restrictions etc. so it would help a lot to be able to add a title, for example: "Mean income (note: incomes < $1000 have been excluded)".

An obvious way of doing this is to create another dataset...

data title;
length title $100;
title = "Mean income (note: incomes < $1000 have been excluded)";
run;

...and then combine this with the summarizing table. But is there a standard procedure to simply add a title while creating the table?

Upvotes: 1

Views: 2625

Answers (1)

vasja
vasja

Reputation: 4792

If I understood correctly, what you want to accomplish is called Label of SAS dataset. You can add label to your dataset when creating it by using dataset option LABEL. You should be able to use it anywhere you can use dataset options and you're creating dataset, e.g.:

data title (label="Mean income (note: incomes < $1000 have been excluded)");
length var1 8;
run;

proc sql;
create table title2 (label="Title in SQL") as select * from title
;
quit;

proc sort data=title out = title_sorted (label="Title Sorted");
by var1;
run;

Or add/modify title later via PROC DATASETS:

proc datasets lib=WORK nodetails nolist;
modify title (label="New title");
quit;

Upvotes: 2

Related Questions