| Date: | Fri, 26 Jun 2009 14:44:48 -0500 |
| Reply-To: | Richard Griffiths <rgriffit@AUSTINCC.EDU> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Richard Griffiths <rgriffit@AUSTINCC.EDU> |
| Subject: | Re: Logic involved in outputting students from an enrollment file
using complex criteria |
|
| In-Reply-To: | <61701.150.142.232.4.1246038491.squirrel@webmail.albany.edu> |
| Content-Type: | text/plain; charset="iso-8859-1" |
Thanks to Mike for his help with this!
I ran the syntax with the actual data file and it worked beautifully.
Thanks again,
Rich
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mike
Zdeb
Sent: Friday, June 26, 2009 12:48 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Logic involved in outputting students from an enrollment file
using complex criteria
hi ... this should work ...
data x;
infile datalines dsd;
input id : $3. Term : $5. Grade : $1.;
datalines;
001, 2008U, B
001, 2007S, C
001, 2007F, F
002, 2006F, W
002, 2007U, F
003, 2007, B
004, 2007F, A
004, 2007U, B
004, 2007S, C
004, 2006F, F
005, 2006F, F
005, 2006U, W
;
run;
data success do_you_want_fries_with_that;
do until (last.id);
set x;
by id;
pass = sum(pass, grade in ('A', 'B', 'C'));
end;
if pass then output success;
else output do_you_want_fries_with_that;
keep id;
run;
proc print data=success;
run;
proc print data=do_you_want_fries_with_that;
run;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> I am trying to calculate the number of developmental math students from a
> Fall 2005 cohort file that eventually attempted any college-level math
class
> in subsequent semesters and either failed (Grade of D,F,W) or succeeded
> (Grade of A,B,C). I need to output students who succeeded into a success
> file, and also output students into a failed file.
>
>
>
> I am having difficulty with the syntax because even if you received a
D,F,W
> for one college-level math course but subsequently received a A,B,C grade
in
> another section of the same course (repeated the course) or in a different
> college-level math course you would be considered a success. The failure
> file should only include those that received a D,F,W in a college-level
math
> course(s) and then did not receive an A, B, C in another section or
course.
>
>
>
>
>
> The fields in the file:
>
>
>
> id, Term, Grade
>
> 001, 2008U, B
>
> 001, 2007S, C
>
> 001, 2007F, F
>
> 002, 2006F, W
>
> 002, 2007U, F
>
> 003, 2007, B
>
> 004, 2007F, A
>
> 004, 2007U, B
>
> 004, 2007S, C
>
> 004, 2006F, F
>
> 005, 2006F, F
>
> 005, 2006U, W
>
>
>
> The students that succeeded according to the above parameters would be
001,
> 003, 004 and the ones that failed 002 and 005.
>
>
>
> Thanks,
>
>
>
> Rich
>
|