Posted by: last_buddha March 30, 2015
HELP w/ SAS
Login in to Rate this Post:     0       ?        
Hey Arrogant,
Can I ask for little more help?
Following is my code for my hw.
I am trying to create a new variable called Grade as Pass or Fail but for some reason it is not working. Any idea how I can fix it?

dm "out;clear;log;clear";
option pageno=1;
title "Test Record";
%let path = C:\SAS\Hw 5;
libname sasdata "&path";
filename rawdata "&path\Testrecords.txt";
data work.records1;
Infile rawdata lrecl=100 pad;
Input ID Name $ Gender $ Height Weight DOB$ Test1 Test2 Test3 Test4 Test5 Test6 ;
run;
data records2;
set records1;
Array Test(*) Test1 Test2 Test3 Test4 Test5 Test6;
do i = 1 to 6;
If Test(i) gt -1 then do;
Score = test(i);
output;
end;
end;
Drop ID Gender Height Weight DOB i Test1 - Test6 ;
run;
proc contents;
run;
proc summary data = records2 nway missing;
class Name;
var Score;
output out = Score mean=;
run;
proc format;
value Grade
0 -< 70 = 'Fail'
70 - High = 'Pass'
run;
proc print;
format Score Grade.;
run;
Read Full Discussion Thread for this article