BookmarkSubscribeRSS Feed
ds21
Calcite | Level 5

I have attached an example of what my SAS data looks like. I want to create a dataset that has a separate column for each day (1,2,3 etc), with times concatenated into a second column. I want the result to look something like this:

 

ID  Day1      Time                       Day2      Time                      Day3             Time                    Day 4        Time                   
1   Monday  10:00AM-12:00pm Tuesday  9:00AM-4:00PM                                                    Thursday   4:00PM - 9:00PM

2                                                                                             Wednesday    5:00PM-8:00PM Thursday  9:00AM - 1:00PM

3   Monday  8:00AM-12:00pm                                                                                                 Thursday   5:00PM - 12:00AM

 

 

So basically I want the dataset so that the first day column only lists all Monday availability, the second day column lists all Tuesday availability, etc. and then to concatenate their start and end times together into one column. That way, it's easy to see everyone's days and times in order of day of week, instead of all together as in the example where it's difficult to determine everyone with a Monday preference. I'm ok with a data step or proc sql. 

 

1 REPLY 1
HB
Barite | Level 11 HB
Barite | Level 11

This seems largely presentational.

 

Could you post some data in a data step?

 

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 698 views
  • 0 likes
  • 2 in conversation