Date: Thu, 24 May 2001 15:00:14 GMT
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Organization: NewsOne.Net - Free Usenet News via the Web - http://newsone.net/
Subject: SUMMARY:Split variable using regular expression
I received several interesting suggestions to the problem I had posed below,
including a couple that were posted. The solutions were in general of the
1. Use perl to identify the files that are to be read in sas via a pipe (and
thus use split to do what I needed)
2. Iteratively search the string to be "split" for various delimiters using
the index function and then substring.
3. Use scan.
1. seemed certainly workable but is ruled out in my case as I had to stick to
SAS. 2 seemed to be a lot of work, but would ensure that I got exactly what I
needed. 3. worked just fine with a bit of modification (some pretreatment of
the string to control for multiple delimiters).
In article <firstname.lastname@example.org>, <email@example.com> writes:
>Does anyone know of a way to replicate the functionality of the 'split'
>function in perl?
>My problem (sasv8 on UNIX).
>I am reading in a list of files (traversing a directory tree using find)
>a dataset and using the FILEVAR option to open a bunch of other files. No
>problems so far. I need to be able to parse values in the FILEVAR variable
>extract some features--simple substring based extracts don't work. I did
>at the RX functions, but couldn't get too far as they seem to be limited to
>matches and substring operations.
>Perl split does the trick but then I would have to cat the files outside SAS
>and then read them in which is wasteful. Any thoughts?
> ----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web
> http://newsone.net/ -- Free reading and anonymous posting to 60,000+
> NewsOne.Net prohibits users from posting spam. If this or other posts
>made through NewsOne.Net violate posting guidelines, email firstname.lastname@example.org
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email email@example.com