4. Using the SAS data set called “main”, create a new dataset “four” by doing the following: a. Add formatting to the variable “weekdayb” in the following format: 1 = Monday, 2 = Tuesday, … 7 = Sunday. Hint: Don’t forget that formatting takes TWO steps! b. Check your work by creating a frequency table for “weekdayb”. Unfinished Code *lab 8 – Problem 4; proc; data proc; run;
i did as follows;
proc format;
value weekdayb
1 = 'Monday'
2 = 'Tuesday'
3 = 'Wednesday'
4 = 'Thursday'
5 = 'Friday'
6 = 'Saturday'
7 = 'Sunday';
run;
data lab.four;
set lab.main;
format weekdayb;
run;
proc freq data=lab.four;
tables weekdayb;
run;
Your FORMAT statement requires both the variable you are using your FORMAT on and the format name you are applying:
format weekdayb weekdayb.;
Your FORMAT statement requires both the variable you are using your FORMAT on and the format name you are applying:
format weekdayb weekdayb.;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.