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 (July 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 17 Jul 2002 09:35:12 -0400
Reply-To:   William Lu <luwp@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   William Lu <luwp@HOTMAIL.COM>
Organization:   Bell Sympatico
Subject:   Re: reconstituting string from array?

Hi Arthur, The coding below could give you the result. Regards,William DATA MAKESTR; SET READIT; ARRAY LET LET1-LET5; LENGTH STR_5 $ 5.; DO J=1 TO 5; * STR_5=SUBSTR(STR_5,J) || LET(J); STR_5=LEFT(TRIM(STR_5)||LET(J)); PUT J Z3.0 @10 STR_5 @20 LET(J); END; RUN;

"Arthur Ellen" <arte@panix.com> wrote in message news:ah3m3l$p9b$1@reader3.panix.com... > I'm trying to build a string from > an array of characters; I'v tried > using the concatenation operator alone > and then the SUBSTR function with > some odd results. > > My goal is ABCDE > > > DATA READIT; > ARRAY LET(5) $ 1.; > INPUT (LET1-LET5) ($CHAR1.); > PUT LET1-LET5; > *PUT (LET1-LET5)($CHAR1.); > CARDS; > ABCDE > ; > RUN; > > > DATA MAKESTR; > SET READIT; > ARRAY LET LET1-LET5; > LENGTH STR_5 $ 5.; > DO J=1 TO 5; > STR_5=SUBSTR(STR_5,J) || LET(J); > PUT J Z3.0 @10 STR_5 @20 LET(J); > END; > RUN; >


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