| Date: | Fri, 20 Aug 2010 09:54:14 -0500 |
| Reply-To: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Subject: | Re: Read missing values with scan function |
|
| In-Reply-To: | <201008201426.o7KDawqW027435@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
It is not clear to me what part(s) of LONGTEXT need to end in which fields.
On 8/20/10, Samuel Escarigo <samuel.escarigo@rbs.co.uk> wrote:
> Hi All,
>
> In the following example, where I have a string with dot and comma
> delimited values, how can I read the missing value into variable scan3?
>
> data _null_;
> set test;
> longtext= 'var1,3.,var2.54,var3.12';
> scan1 = scan(longtext,1,',.');
> scan2 = scan(longtext,2,',.');
> scan3 = scan(longtext,3,',.');
> scan4 = scan(longtext,4,',.');
> put longtext=;
> put scan1= scan2= scan3= scan4=;
> run;
>
> longtext=var1,3.,var2.54,var3.12
> scan1=var1 scan2=3 scan3=var2 scan4=54
>
>
> As you can see, with my current code, scan3 is getting the following word
> ('var2') and scan4 is 54 instead of 'var2'...
>
> Many thanks,
>
> Samuel
>
|