BookmarkSubscribeRSS Feed
deleted_user
Not applicable
How would I sort by job_class, osha_rate1, and lost_rate1 (ie I want to ignore year)? osha_rate1 and lost_rate1 are both nested in year (year is equal to 2008, 2009, 2010).
Thank you.

ods tagsets.tableeditor file="C:\Documents and Settings\summary_job.htm"
options(sort="yes"
sort_arrow_color="green"
sort_underline="no"
describe="yes"
);
proc report data=jobyear3 nowd contents="Summary Table-Jobs"
style(header)=[font_weight=bold] out=test;
options missing='0';
columns job_class year, (osha_rate1 lost_rate1);
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Since YEAR is going to be an ACROSS item and that OSHA_RATE1 and LOST_RATE are going to be nested underneath YEAR. I'm not sure how the sort will work using TAGSETS.TABLEEDITOR (whether you can skip the row with YEAR or not).

One alternative would be to create a "flat" version of the report data (using OUT= on the PROC REPORT statement). This will cause the ACROSS columns to be named _C2_, _C3_, _C4_, etc. Then you would use the new dataset with these column names in the TAGSETS.TABLEEDITOR step. Since you can relabel the column names in the DEFINE statements, you won't have to worry about folks seeing the absolute column names (_C2_, etc).

Before you go down this route, you might wish to check with Tech Support about using TAGSETS.TABLEEDITOR and its sort capability.

cynthia

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
  • 1 reply
  • 576 views
  • 0 likes
  • 2 in conversation