Hi.....I have enrollment data that I am trying to create separate reports, one in the Fall and the other in the Winter. Each report is based on the academic year and the term number that the student was enrolled in. The field "Term" consist of the academic year and term number that the student was enrolled. The Fall report is to consist of Term 1 of the current academic year and Terms 2 & 3 of the previous academic year. The Winter report is to consist of Terms 1 & 2 of the current academic year. Any suggestion on to obtain this....thanks
Have:
Student ID | Term |
10010 | 15-16 TRM 2 |
10010 | 15-16 TRM 3 |
10010 | 16-17 TRM 1 |
10010 | 16-17 TRM 2 |
10010 | 16-17 TRM 3 |
10032 | 16-17 TRM 2 |
10032 | 16-17 TRM 3 |
10032 | 17-18 TRM 1 |
Want:
Student ID | Term | Fall | Winter |
10010 | 15-16 TRM 2 | 16-17 | 15-16 |
10010 | 15-16 TRM 3 | 16-17 | |
10010 | 16-17 TRM 1 | 16-17 | 16-17 |
10010 | 16-17 TRM 2 | 17-18 | 16-17 |
10010 | 16-17 TRM 3 | 17-18 | |
10032 | 16-17 TRM 2 | 17-18 | 16-17 |
10032 | 16-17 TRM 3 | 17-18 | |
10032 | 17-18 TRM 1 | 17-18 | 17-18 |
You can calcolate term_no and season from term using function scan:
length term_no $1 fall winter season $5;
term_no = scan(term, -1);
season = scan(term, 1);
All you need now is to assign values to fall and to winter according to above values.
You can calcolate term_no and season from term using function scan:
length term_no $1 fall winter season $5;
term_no = scan(term, -1);
season = scan(term, 1);
All you need now is to assign values to fall and to winter according to above values.
Hi Shmuel,
I followed your suggestion and it worked....thanks for your help.
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.
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.