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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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