BookmarkSubscribeRSS Feed
ricodonself
Calcite | Level 5

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

5 REPLIES 5
ricodonself
Calcite | Level 5

ok I got it,

in proc print step I need to mention LEBAL

is that right guys?

stat_sas
Ammonite | Level 13

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.

AnandSahu
Calcite | Level 5

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

Ksharp
Super User

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1260 views
  • 3 likes
  • 4 in conversation