I\'ve been trying to import this data into SAS. In point A, the data is not prin
ID: 3042577 • Letter: I
Question
I've been trying to import this data into SAS. In point A, the data is not printed correctly. And in point B, it says that the file doesn't exist. Please let me know if you find a valid code to make this work. Thanks!Grades.txt
Name & Midterm & Final & Homework Anderson & 54 & 65 & 71 Baker & 65 & 84 & 77 Brown & 73 & 91 & 88 Campbell & 89 & 67 & 90 Casey & 87 & 72 & 80 Davis & 72 & 78 & 83 Diaz & 84 & 91 & 93 Fisher & 75 & & 54 Foster & 88 & 90 & 99 Garcia & 89 & 77 & 91 Gonzalez & 84 & 87 & 79 Gray & 73 & 82 & 65 Green & 67 & 82 & 85 Hall & 59 & 67 & 64 Harris & 75 & 75 & 82 Jackson & 82 & 88 & 85 Jenkins & 89 & 58 & 80 Johnson & 64 & 70 & 78 Kennedy & 95 & 95 & Marshall & 37 & & Martin & 74 & 85 & 82 Miller & 98 & 93 & 88 Moore & 72 & 79 & 82 Price & 48 & 80 & 95 Reed & 69 & 81 & 75 Rogers & 92 & 85 & 90 Smith & 92 & 95 & 93 Thompson & 73 & 62 & 75 Wallace & 82 & 91 & 77 White & 96 & 79 & 85 Name & Midterm & Final & Homework Anderson & 54 & 65 & 71 Baker & 65 & 84 & 77 Brown & 73 & 91 & 88 Campbell & 89 & 67 & 90 Casey & 87 & 72 & 80 Davis & 72 & 78 & 83 Diaz & 84 & 91 & 93 Fisher & 75 & & 54 Foster & 88 & 90 & 99 Garcia & 89 & 77 & 91 Gonzalez & 84 & 87 & 79 Gray & 73 & 82 & 65 Green & 67 & 82 & 85 Hall & 59 & 67 & 64 Harris & 75 & 75 & 82 Jackson & 82 & 88 & 85 Jenkins & 89 & 58 & 80 Johnson & 64 & 70 & 78 Kennedy & 95 & 95 & Marshall & 37 & & Martin & 74 & 85 & 82 Miller & 98 & 93 & 88 Moore & 72 & 79 & 82 Price & 48 & 80 & 95 Reed & 69 & 81 & 75 Rogers & 92 & 85 & 90 Smith & 92 & 95 & 93 Thompson & 73 & 62 & 75 Wallace & 82 & 91 & 77 White & 96 & 79 & 85 1. The data set Grades.txt posted on Blackboard contains grades for a class of 30 students. Each of vation consists of the student's name, midterm score, final score, delimiter in the file is the ampersand (&). and homework score. Notice that the a Import the data set into SAS using a DATA step. Print the data set and report the resulting output. b Use PROC IMPORT to import the data set into SAS. Print the data set and report the resulting output. c Import the data set into R and store it in a data frame. Report the resulting output.
Explanation / Answer
You can import the dataset in SAS using either of the three given below methods:
1)
/*Copy the dataset in the dataset and use datalines to import the data*/
data main;
input Name$ Midterm Final Homework;
datalines;
Martin 74 85 82
Miller 98 93 88
;
run;
proc print data = main;
run;
2)
## Save the dataset as a csv file and use the infile statement
data main;
infile '<Location of the csv file>' firstobs = 2;
input Name$ Midterm Final Homework;
;
run;
proc print data = main;
run;
3)
##Use the proc import to import the csv file
FILENAME REFILE "/home/quinn/sasuser.v94/Basic_SAS_programming/Marks.csv" TERMSTR = CR;
PROC IMPORT DATAFILE = REFILE
DBMS = CSV
OUT = WORK.MARKS;
GETNAME = YES;
RUN;
PROC PRINT DATA = MARKS;
RUN;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.