Date: Tue, 7 Mar 2000 15:47:59 -0500
Reply-To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject: Re: WORD WRAP
Content-Type: text/plain; charset="windows-1252"
> From: Jamil Ibrahim [mailto:jibrahim@IR.UMSMED.EDU]
> i HAVE THIS VARIABLE THAT IS 165 CHARACTER LONG CALLED TOPICS
> I WANT TO PUT IT IN 2 LINES AND WRAP IT TO THE NEXT LINE AT
> THE 132 CHARACTER AND NOT BREAKING A WORD INTO TWO HALVES IN
> TWO LINES .
> LIKE IF THE WORD ASSESSMENT IS AT 125. I WANT IT TO GO TO NEXT LINE.
>
>
> I TRIED THIS CODE. IT DID NOT WORK.
> TOPIC =TRIM(TOPICS1) || ' ' || TOPICS2;
> Length V1 $ 100;
> Length V2 $ 100;
> V1=substr(TOPIC,1,100);
> V2=substr(TOPIC,101,70);
> POSPACE=index(V2,' ');
> if TOPIC > 1 then do;
> V1=trim(V1) || substr(V2,1, POSPACE-1);
> V2=substr(V2,POSPACE+1);
here the algorithm:
read in Topics165
look for a blank starting at 132
Col = 133;
do until(substr(Topics165,Col,1) eq ' ');Col = Col -1;
end;
Topics132 =
substr(Topics165,1,Col);
Topics133 = substr(Topics165,Col);
end;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
---> cheerful provider of UNTESTED SAS code!*! <---
|