For this activity you will create a SAS program and upload that program to wolfware. Be sure
that your SAS file adheres to the SAS file submission guidelines (available on wolfware).
The data set(s) for this activity are available in the assignment 6 link.
To Do – Write code corresponding to each step below, that is, do not change the code for step 1
to do step 2 (you can copy and paste it so you don’t have to retype it, but leave the answer to
each step in your program):
1. Create a library called Topic6
2. Load Data superPlus and store it in library Topic6, using appropriate informats (See last week).
– Print the dataset with an appropriate procedure and check the output.
– In the comments, answer the following:
a) What are the variable types and lengths (HINT: PROC CONTENTS may help)
b) Also state what the ’10’ following ddmmyy indicates?
c) What would happen if the ‘:’ was not included after the variables.
You can run the modified code to see what happens. The SAS help for the informats may help as well.
3. Create a new temporary data set called superFormat from superPlus (HINT: use a SET statement).
a) Format the variables DayOff to list the 3-letter-month-abbreviation, 2-digit-day and 4-digityear.
b) Format the variable TimeIn to display HH:MM
c) Print the data set;
d) In the comments, state whether or not the new date format specification changes the actual
class of the variable (PROC CONTENTS may help or look at the properties through the explorer tab);
4. Modify superFormat to include the following variable labels:
– ‘First Name’, ‘Last Name’, ‘Department’, ‘Day Off’, ‘Start Time’
– Use a PROC PRINT step so that the variable labels above are displayed in the output.
– Do not include the observation numbers (RECALL: NOOBS);
(HINT: in order to print the labels you will need to specify an option in the PROC PRINT step)
5. Create a dataset superFormula from SET superFormat and store it in library Topic6.
In this data set:
a) Change the format of DayOff to display two-digit-day, 3-letter-month-abbreviation, and 2-
digit-year with no spaces.
b) Create a new variable called “DaysLeft” that counts the number of days left until each person’s day off (HINT: use the today() function and subtract it from the appropriate variable).
c) Add the label “Days Until Vacation” to the new variable “DaysLeft”.
d) Print the data set displaying the labels without displaying observation numbers.
6. Super Folk earn $20/day for their services. The Department director wants to know how much money
each person will get paid until his/her day off.
a) Create a new temporary dataset called superCalc with a variable called ‘Wages’ that displays
b) Format ‘Wages’ so that a dollar sign and comma appear in the output.
c) In the comments, list the formula used for your calculation.
d) Print out ONLY the Wages variable displaying the proper format.