LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 6 Oct 2011 10:19:18 -0700
Reply-To:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject:   Re: Scanning the string
In-Reply-To:   <201110061558.p96AmH0t000825@waikiki.cc.uga.edu>
Content-Type:   text/plain; charset=utf-8

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Ben > Sent: Thursday, October 06, 2011 8:58 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Scanning the string > > Your methods are great, but what if the case is a little bit complcated > like following: > > the demension of array is going to be varied from 2 to 50. > > > ************************; > data _null_; > infile datalines ...; > > > datalines; > aa*bb**dd*ee****ii > a*b > ;;;; > > ***********************; > > > > > > On Wed, 5 Oct 2011 17:19:56 -0400, Ben <benpub7@YAHOO.COM> wrote: > > >data _null_; > >STR='aa*bb**dd*ee****ii"; > > > >put s1= s2= s3= s4= s5= s6= s7= s8= s9= s10=; > >run; > > > >*the desired results; > > > >s1='aa' s2='bb' s3='' s4='dd' s5='ee' s6='' s7='' s8='' s9='' s10='ii' > > > >**instead of; > >s1='aa' s2='bb' s3='dd' s4='ee' s5='ii' > > > >Thanks > > > >ben

Ben,

To provide a practical answer I would need to know more about what you are actually doing. I assumed your data _null_ examples were just a way to look at string scanning. What is your real task? What do you mean "the demension of array is going to be varied from 2 to 50"? Are you actually creating a SAS dataset, or are your "putting" values to a CSV file, or ...?

If you provide more context, you will get answers more tailored to your needs.

Dan

Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204


Back to: Top of message | Previous page | Main SAS-L page