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

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
1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 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.

View solution in original post

2 REPLIES 2
Shmuel
Garnet | Level 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.

twildone
Pyrite | Level 9

Hi Shmuel,

 

I followed your suggestion and it worked....thanks for your help.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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