Date: Fri, 22 Jan 2010 16:27:04 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Put to split a string into two lines ?
hi ... one idea ... not written to the LOG but to a file
input a : $20.;
b = translate(a,'0d'x,'/');
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
> He isn't asking that; he's asking how to put it out to the log without
> separate variables.
> Ya, I don't know of a way to do this. PUT doesn't operate on (most?)
> functions. You might be able to use some %sysfunc stuff to work around
> that, but it would be much messier than splitting it into variables first.
> On Fri, Jan 22, 2010 at 2:49 PM, SD_Data_Dude <firstname.lastname@example.org>wrote:
>> On Jan 22, 1:28 pm, ya.hu...@AMYLIN.COM (Ya Huang) 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
>> Learn about the scan function.