Apologise for not posting my code and result part. @Reeza @HB @Tom @ballardw @error_prone Here is my code and what i get in sas: data temp;
infile 'exam.txt';
retain Course StudentName Grade Reportdate ID School DoB District;
input;
if _infile_ =: 'Calculus' then Course = scan(_infile_, 1, '\\');
else if _infile_ =: 'Student' then StudentName = scan(_infile_, -1, ':');
else if _infile_ =: 'ID' then ID = scan(_infile_, -1, ':');
else if _infile_ =: 'Grade' then Grade = scan(_infile_, -1, ':');
else if _infile_ =: 'Date of Birth' then Dob = scan(_infile_, -1, ':');
else if _infile_ =: 'School' then School = scan(_infile_, -1, ':');
else if _infile_ =: 'District' then District = scan(_infile_, -1, ':');
else if (_infile_)=:'Report Date' then do
Reportdate = scan(_infile_,-1,':');
output;
end;
run;
proc print data = temp;
run; I am still get lost in sas. (1) Why is there something missing in the first row? (2) How to convert Reportdate format into mmddyy? eg convert 12/20/2016 to 12/20/16 (3) Is there some ways that could split School into School code and School name? eg "123 Edision" into "123" and "Edison" Thank you for your time reading this.
... View more