Copy of SAS Programming Module Ten Lesson One Activity

pdf

School

North Carolina State University *

*We aren’t endorsed by this school

Course

540

Subject

Computer Science

Date

Nov 24, 2024

Type

pdf

Pages

3

Uploaded by GrandGalaxyDolphin7

Report
Google File Access Directions: Please click on File in the upper left corner. If you are working on a Chromebook or Google Docs, choose the Make a copy option and save a copy of the document to your Google Drive. If not, choose the Download as option and then the Microsoft Word (.docx) option to download an editable copy of the document to your computer. Module Ten Lesson One Activity Open p203a01.sas from the activities folder and perform the following tasks: 1. Run the program. Why does the DATA step fail? This is because of upcase() function. Correct the error by overwriting the value of the column Name in uppercase. 2. Examine the expressions for Mean1 , Mean2 , and Mean3 . Each one is a method for specifying a list of columns as arguments in a function. Run the program and verify that the values in these three columns are the same. 3. In the expression for Mean2 , delete the keyword OF and run the program. What do the values in Mean2 represent? Differences between Quiz1 and Quiz5 in the dataset. %let path=~/EPG294/data; libname PG2 "&path"; data quiz_summary; set pg2.class_quiz; Name=upcase(Name); Mean1=mean(Quiz1, Quiz2, Quiz3, Quiz4, Quiz5); /* Numbered Range: col1-coln where n is a sequential number */ Mean2=mean(Quiz1-Quiz5); /* Name Prefix: all columns that begin with the specified character string */ Mean3=mean(of Q:); run; Open p203a02.sas from the activities folder and perform the following tasks:
1. Examine the program and notice that all quiz scores for two students are changed to missing values. Highlight the first DATA step and submit the selected code. 2. In a web browser, access SAS Help at http://support.sas.com/documentation . In the Syntax Shortcuts section, click the 9.4 link next to SAS Language Elements by Name, Product, and Category. 3. Access the alphabetical listing for CALL routines. Use the documentation to read about the CALL MISSING routine. 4. Simplify the second DATA step by using CALL MISSING to assign missing values for the two students’ quiz scores. Run the step. %let path=~/EPG294/data; libname PG2 "&path"; data quiz_report; set pg2.class_quiz; if Name in("Barbara", "James") then call missing(of Q:); run; /* Step 1 */ /*data quiz_report; set pg2.class_quiz; if Name in("Barbara", "James") then do; Quiz1=.; Quiz2=.; Quiz3=.; Quiz4=.; Quiz5=.; end; run;*/
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help