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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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