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