Problems with Label command not working.

Reply
Occasional Contributor
Posts: 5

Problems with Label command not working.

Hello. I'm in a beginners SAS program, and my output isn't working the way I need it to. When I define my value labels, my defined label variables are no longer defined. How can I fix this?

This is the part that I think is giving me problems, but I can always post my whole input if needed.

proc format;

    label rate_change='Pulse Rate Change'

        BMI='Body Mass Index';

    value bmifmt

        Low-25='Normal'

        26-35 ='Low Risk'

        36-High='High Risk';

run;

proc print data=comb_rate;

    FORMAT BMI bmifmt.;

run;

   

Thank you!

Super Contributor
Posts: 644

Re: Problems with Label command not working.

Labels defined in a Proc are not persistent for subsequent steps.  Put your labels in a data step or Proc SQL.

Richard

Occasional Contributor
Posts: 5

Re: Problems with Label command not working.

If I change it to data, the value step won't work. Like 'Value' is highlighted in red. What would I use instead of value?

Contributor
Posts: 29

Re: Problems with Label command not working.

Move the label statement to the step where you created the comb_rate data set, leaving the rest of the proc format as it was.

Ask a Question
Discussion stats
  • 3 replies
  • 714 views
  • 0 likes
  • 3 in conversation