Date: Fri, 10 Aug 2007 11:49:29 -0400
Reply-To: "Henderson, Everett" <EHenders@UI.URBAN.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Henderson, Everett" <EHenders@UI.URBAN.ORG>
Subject: Re: Iterative Processing Issues
In-Reply-To: <456B52C41B724C41B96561D7AD283E7D6C7611@mail.chpdm.umbc.edu>
Content-Type: text/plain; charset="iso-8859-1"
Thanks for responding, Jack.
Yes, every output record has the same value, 0 in this case, since I
initially set it to that earlier in the code. It is not a variable on the
input data set, it's a variable I'm creating for the output data set.
-Everett
-----Original Message-----
From: Jack Clark [mailto:JClark@chpdm.umbc.edu]
Sent: Friday, August 10, 2007 11:46 AM
To: Henderson, Everett; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Iterative Processing Issues
When you say that GRADSTEM remains exactly the same, do you mean every
output record has the same value? What value does it end up with? Is
it a variable on the input data set?
Jack Clark
Research Analyst
Center for Health Program Development and Management
University of Maryland, Baltimore County
410-455-6256
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of E
Henderson
Sent: Friday, August 10, 2007 11:09 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Iterative Processing Issues
I'm trying to run the following code, but every time I execute it, I the
values of the variable I'm trying to create (gradstem) remain exactly
the
same. Any guidance would be appreciated.
data nlsy79_stemtrans_v3_ba;
set nlsy79_stemtrans_v2_ba;
array enrollyear{12} enrollyear1-enrollyear12;
array enrolltype{12} enrolltype1-enrolltype12;
array attstat{12} attstat1-attstat12;
array majorcat{12} majorcat1-majorcat12;
/*
array jobord{13} jobord1-jobord13;
array currstat{13} currstat1-currstat13;
array hoursjob{13} hoursjob1-hoursjob13;
array yearearn{13} yearearn1-yearearn13;
array occcatjob{13} occcatjob1-occcatjob13;
*/
gradstem=0;
do i=1 to i=12 until (enrollyear{i}=outyear);
if attstat{i}=1 then do;
if 1<=(majorcat{i})<=4 and (enrolltype{i})=1 then gradstem=1;/*Grad FT
STEM*/
else if 5<=(majorcat{i})<=9 and (enrolltype{i})=1 then gradstem=2;/*Grad
FT
Non STEM*/
else if 1<=(majorcat{i})<=4 and (enrolltype{i})=2 then
gradstem=3;/*Other
FT STEM*/
else if 5<=(majorcat{i})<=9 and (enrolltype{i})=2 then
gradstem=4;/*Other
FT Non STEM*/
end;
end;
drop i;
run;