Any one knows why Permanent Label in this code doesn't work?

Reply
Occasional Contributor
Posts: 5

Any one knows why Permanent Label in this code doesn't work?

the code that doesn't work (doesn't label the two variables)

data work.subset_pmlabel;

    set orion.sales;

    where country='AU'

            and job_title like '%Rep%';

    Bonus=salary*0.1;

    label Job_Title='Sales Title'

           Hire_Date='Date Hired';

    drop Employee_id gender  Birth_date;

run;

proc print data=work.subset_pmlabel;

run;

this is directly from sas e-training, I reeeeealy don't see any difference between.

thanks in advance

Occasional Contributor
Posts: 5

Re: Any one knows why Permanent Label in this code doesn't work?

ok I got it,

in proc print step I need to mention LEBAL

is that right guys?

Trusted Advisor
Posts: 1,203

Re: Any one knows why Permanent Label in this code doesn't work?

Yes, if you want to display labels instead of variable names you have to use label in proc print

proc print data=work.subset_pmlabel label;

run;

You can also use proc contents to see labels assigned to variables in the dataset.

Occasional Contributor
Posts: 5

Re: Any one knows why Permanent Label in this code doesn't work?

appreciated!

Frequent Contributor
Posts: 81

Re: Any one knows why Permanent Label in this code doesn't work?

and you can use split() options as well....

Grand Advisor
Posts: 9,576

Re: Any one knows why Permanent Label in this code doesn't work?

Or you can simply use  proc report which print LABEL by default .

Ask a Question
Discussion stats
  • 5 replies
  • 504 views
  • 3 likes
  • 4 in conversation