Hello, I was given this question for review and the solution, but I had no idea how to begin this problem.
Questions
I do highlight key words, reference my syntax sheet, and review old lessons, but every question is worded differently. Some questions give more details than others. I know I asked a lot of questions, but I would appreciate anyone's help.
Write a new SAS program that uses procedures to evaluate whether the data in the employee_raw table meets the following requirements:
proc freq data=cr.employee_raw order=freq nlevels ; tables EmpID Country Department; run; proc print data=cr.employee_raw; where TermDate ne . and HireDate>TermDate; format salary dollar10. TermDate HireDate BirthDate date9.; run;
Generic comment:
If you do not specify a library with a data set name then SAS assumes you are using a one level and will default to treating the name in the WORK library. This one-level name setting can be changed but that's pretty advanced and not commonly done.
You can create data set without referencing anything outside of a data step. Example:
data junk; x=3; run;
Trivial but if the variables are created and values assigned in the code then you do not need to "set" anything from another data set.
Also data steps can read external files.
The remainder of your questions reference something and it is not obvious what it may be. You should phrase questions such than any other stuff needed is easy to find.
Example the question: What is the CR. referencing in this solution? Are you asking about the code here:
proc freq data=cr.employee_raw order=freq nlevels ;
If you do not recognize CR. as a library name then you need to go back to earlier classes as that should have been one of the very earliest items in your training. If you hope to take one of the certification exams just following the review questions then be prepared for a rough road.
Another instance your question: What does it mean when the question asks for unique columns?
There is nothing about "unique columns" that I see. I see unique values. At which point you are at the meaning of the word "unique" applied to a single variable.
These all relate to "evaluate whether the data in the employee_raw table meets the following requirements:".
Which means use one or more procedures to see if the following statements are true or not.
Hello Ballardw,
I'll try to word my questions better next time. Well If I have a long road ahead I'll review the previous video lessons. Thank you for your help.
Unique means no duplicates. So you should not have the same ID twice in your dataset. PROC FREQ is fine to check if the country columns is either US or AU. CR would be the library name that the dataset is stored in. Yes, you do have to put US and AU in quotes if you're using them in a where statement.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.