BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Markanti
Calcite | Level 5

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Your FORMAT statement requires both the variable you are using your FORMAT on and the format name you are applying:

format weekdayb weekdayb.;

View solution in original post

1 REPLY 1
SASKiwi
PROC Star

Your FORMAT statement requires both the variable you are using your FORMAT on and the format name you are applying:

format weekdayb weekdayb.;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 259 views
  • 0 likes
  • 2 in conversation