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
Diamond | Level 26
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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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