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 (December 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Dec 2004 13:03:06 -0500
Reply-To:     An Am <aarumugam@STTHOMAS.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         An Am <aarumugam@STTHOMAS.EDU>
Subject:      Re: concatenated string problem
Comments: To: Toby Dunn <Toby.Dunn@TEA.STATE.TX.US>

No. It did not work.

%DO I = 1 %TO &TOTDRUGS;

DATA DRUG_&&DRUG&I; LENGTH BLINE_DRUG $ 6.; BLINE_DRUG="Anbu"; SET CDOSE;

IF IVAR&&DRUG&I =1 THEN DO; BLINE_DRUG= "&&DRUG&I" || BLINE_DRUG; END; RUN;

Thanks, An

On Fri, 10 Dec 2004 11:51:59 -0600, Dunn, Toby <Toby.Dunn@TEA.STATE.TX.US> wrote:

>An Am, > >Try the following: > >%DO I = 1 %TO &TOTDRUGS; > > DATA DRUG_&&DRUG&I; > LENGTH BLINE_DRUG $ 6.; > BLINE_DRUG="Anbu"; > SET CDOSE; > > IF IVAR&&DRUG&I =1 THEN DO; > BLINE_DRUG= "&&DRUG&I" || BLINE_DRUG; > END; >RUN; > >%END; > >HTH > >Toby Dunn > >"It's OK to figure out murder mysteries, but you shouldn't need to >figure out code. You should be able to read it." -Steve C McConnell > > > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of An >Am >Sent: Friday, December 10, 2004 11:44 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: concatenated string problem > > >Hi , > I want to get concatenated string in the BLINE_DRUG. >For example take values like John and smith; >In the first iteration I get John and in another iteration I get value >of smith . In the final output should be John smith. > >Here, if I have BLINE_DRUG= &&DRUG&I.;, BLINE_DRUG is just holding the >value of last iteration. But if I have BLINE_DRUG= &&DRUG&I. || >BLINE_DRUG; , BLINE_DRUG is empty. How will I concatenate? > >Help please. > > > %DO I = 1 %TO &TOTDRUGS; > DATA DRUG_&&DRUG&I; > LENGTH BLINE_DRUG $ 6.; > BLINE_DRUG="Anbu"; > SET CDOSE; > > IF IVAR&&DRUG&I. =1 THEN DO; > BLINE_DRUG= &&DRUG&I. || BLINE_DRUG; > END; > > RUN; > %END; > > >Thanks, >An

No. It did not work


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