```Date: Wed, 21 Jul 2004 09:12:16 -0400 Reply-To: "Kondeti, Adi" Sender: "SAS(r) Discussion" From: "Kondeti, Adi" Subject: Re: A simpler way? Comments: To: Pat Moore Content-Type: text/plain; charset="iso-8859-1" Hi Pat, How about If p1grnum < 4 then p1g=.; ..... If p6grnum < 4 then p6g=.; Thanks, Adi /*this sets negative values of p1g-p6g to missing so non-letter grades are not computed into the gpa*/ if p1g<0 then p1g=.; -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Pat Moore Sent: Tuesday, July 20, 2004 8:50 PM To: SAS-L@LISTSERV.UGA.EDU Subject: A simpler way? I have variables p1grnum--p6grnum that each vary from 0-8. I wrote this code: /*this makes grnums below 4 negative numbers*/ p1g=p1grnum-4; p2g=p2grnum-4; p3g=p3grnum-4; p4g=p4grnum-4; p5g=p5grnum-4; p6g=p6grnum-4; /*this sets negative values of p1g-p6g to missing so non-letter grades are not computed into the gpa*/ if p1g<0 then p1g=.; if p2g<0 then p2g=.; if p3g<0 then p3g=.; if p4g<0 then p4g=.; if p5g<0 then p5g=.; if p6g<0 then p6g=.; /*this computes the grade point average with the modified values*/ preqgpa=mean(p1g,p2g,p3g,p4g,p5g,p6g); Is there some more sophisticated way to do this? ```

Back to: Top of message | Previous page | Main SAS-L page