LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 22 Jan 2010 17:53:06 -0500
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: Put to split a string into two lines ?
Comments:   To: Ya Huang <ya.huang@AMYLIN.COM>

Ya,

Would something like the following suffice or does it fit into the category you would like to avoid?

data _null_; infile cards truncover; informat a $100.; input a &; do i=1 to 99; x= scan(a,i,"/"); if x eq "" then i=99; else put x; end; cards; first line / second line first line / second line/third line ;

Art -------- On Fri, 22 Jan 2010 14:28:49 -0500, Ya Huang <ya.huang@AMYLIN.COM> wrote:

>Hi there, > >I have a long string, which has one or more '/' in between the letters, >is there a way to use put statement and get two lines? > >9 data _null_; >10 a='first line / second line'; >11 put a=; >12 run; > >a=first line / second line >NOTE: DATA statement used (Total process time): > >I would like the following though: > >a=first line >second line > >I can certainly break the string apart, and use put like this >put st1 / st2 / st3... >Just wondering if it can be done more easily like split='/' in proc >report? > >Thanks > >Ya


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