BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chinli72
Obsidian | Level 7

Would somebody please explain why the label is not labeling the variables?

data test;
	label n = "num";
	label c = "char";
	input n c $;
cards;
1 123
2 xyz
run;
proc contents data=test; run;


Proc contents output has no labels.

 

 
test1.gif
Thank you very much.
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Looks like you have turned of the LABEL system option.

Check it.

proc options option=label;
run;

Turn it back on.

options label;

View solution in original post

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

Please try the below code

 

data test;
	label n = "num"
	c = "char";
	input n c $;
cards;
1 123
2 xyz
run;

proc contents data=test; 
run;
Thanks,
Jag
Jebastin
Obsidian | Level 7

Please put your input statement at the beginning followed by your label statement. Let's see, if it works

Tom
Super User Tom
Super User

Looks like you have turned of the LABEL system option.

Check it.

proc options option=label;
run;

Turn it back on.

options label;
chinli72
Obsidian | Level 7
You nailed it on the head. The labels are showing now. Thank you and all who helped.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1184 views
  • 2 likes
  • 4 in conversation