BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
danielhu
Calcite | Level 5

Hi, new user here that is trying to learn the ropes. I have a question here, how do I convert table 1 to table 2? table 2 is to calculate the frequency of eg, number of times in year 2005, 2006.. where the index is 6.

table 1

YearIndex
20055
20058
200511
20066
200713
20075
20076
20075
20088
20085
20085

table 2

2005200620072008
Index<61022
Index=60110
Index=81001
Index>81010
1 ACCEPTED SOLUTION

Accepted Solutions
stat_sas
Ammonite | Level 13

proc format;

value indx low-5='Index<6'

               6='Index=6'

               8='Index=8'

              8-high='Index>8';

run;

proc freq data=table1;

table index*year/nocum nopercent norow nocol;

format index indx.;

run;

View solution in original post

2 REPLIES 2
stat_sas
Ammonite | Level 13

proc format;

value indx low-5='Index<6'

               6='Index=6'

               8='Index=8'

              8-high='Index>8';

run;

proc freq data=table1;

table index*year/nocum nopercent norow nocol;

format index indx.;

run;

danielhu
Calcite | Level 5

thanks pal! great help!

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
  • 2 replies
  • 757 views
  • 0 likes
  • 2 in conversation