Hi Team, One column that has weekdays, timings, and a delimiter . what I want to divide into seven columns based on the delimiter ,. Additionally, the values are separated by a comma. It was closed on some of the days. The data I have looks like this: data have; length days $200; infile datalines truncover; input days $ 1-200; datalines; Sun CLOSED, Mon 9:00AM-6:30PM, Tue 9:00AM-6:30PM, Wed 9:00AM-6:30PM, Thu 9:00AM-6:30PM, Fri 9:00AM-6:30PM, Sat 9:00AM-4:00PM, Sun 10:00AM-9:00PM, Mon 8:00AM-9:00PM, Tue 8:00AM-9:00PM, Wed 8:00AM-9:00PM, Thu 8:00AM-9:00PM, Fri 8:00AM-9:00PM, Sat 8:00AM-9:00PM, Sun CLOSED, Mon 8:00AM-5:00PM, Tue 8:00AM-5:00PM, Wed 8:00AM-5:00PM, Thu 8:00AM-5:00PM, Fri 8:00AM-5:00PM, Sat CLOSED, ; run; I want data as I tried the below code data want (drop=days); set have; Sunday = scan(days,1,','); monday = scan(days,2,','); tuesday = scan(days,3,','); wednesday = scan(days,4,','); thursday = scan(days,5,','); friday = scan(days,6,','); saturday = scan(days,7,','); run;
... View more