|
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of SUBSCRIBE SAS-L Anonymous
> Sent: Sunday, July 08, 2007 10:50 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Importing CSV file format into Sas
>
> If you notice Var1 = 'A' and also = 'B'. Also Var4 is the
> same in both
> cases -- when Var1 = 'A' or Var1 = 'B'. So will the code
> below be correct?
>
> If Var1 = 'A' Then Do ;
> Input Var1 Var2 Var3 Var4 $ ;
> End ;
> Else Do ;
> Input Var1 Date11. Var5 Var6 Var7 Var4 $;
Close to correct, but Toby's example requires a variable Var8 I believe, in order to line up the variables properly, something like this
Input Var5 Date11. Var6 Var7 Var8 $ Var4 $;
Is Var2 on record type A supposed to be a datetime variable of some type (the first half of the value looks like a date)? I changed Var1 on the record type B branch to Var5 because Var1 is used for reading the record type.
> *in this case Var1 > = 'B' and> Var 4 is the same when Var1 = A and also Var1 = B; ;
> End ;
>
> Cards;
> A,200606016672059,1,ABC
> A,200606010004552,1,DEF
> B,01-JUN-2006,97073,92001,IQ,ABC
> ;
>
Hope this is helpful,
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
|