Date: Fri, 5 Oct 2007 15:21:16 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Comma separated
In-Reply-To: <128350.21823.qm@web63611.mail.re1.yahoo.com>
Content-Type: text/plain; charset="Windows-1252"
Data Need ( Keep = Var1 Var3 ) ;
Length Var1 $ 200 ;
Infile MyFile DLM = ',' ;
Input Var1 Var2 Var3 Var4 Var5 Var6 ;
Run ;
Or < Untested>
Data Need ( Drop = Temp ) ;
Length Var1 $ 200 ;
Infile MyFile DLM = ',' ;
Input @ ;
Temp = CatS( Scan( _Infile_ , 1 , ',' ) , Scan( _Infile_ , 3 , ',' ) ) ;
_InFile_ = Temp ;
Input Var1 Var3 ;
Run ;
Toby Dunn
Compromise is like telling a lie, it gets easier and easier. Each compromise you make, that becomes your standard.
Perfection doesnt exist, once you reach it, its not perfect anymore. It means something else.
> Date: Fri, 5 Oct 2007 08:08:10 -0700
> From: valkrem@YAHOO.COM
> Subject: Comma separated
> To: SAS-L@LISTSERV.UGA.EDU
>
> Dear SAS users,
>
> I want read a data file that is separated by commas
>
> Example- the following data file have 6 varaibles,
>
> TYG123, 435, 22334, 46, 123234, 670005
>
>
>
> The variables may not have the same length. The first variable is always Character and the other variables are numeric.
>
> How can I read them?
>
> I may want to read only some variables. eg. variable 1, and variable 3.
>
> Any help is highly appreciated.
>
>
> Val.
>
>
> ---------------------------------
> Need a vacation? Get great deals to amazing places on Yahoo! Travel.
_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
|