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 (February 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 29 Feb 2008 04:02:47 -0500
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: read out a string

On Fri, 29 Feb 2008 09:27:46 +0100, Stefan Pohl <stefan.pohl@ISH.DE> wrote:

>Dear sas-group, > >I want to read out the information in a string IDs who looks like this > >IDs >obs1: [1 2] [3 3] [4 4] [5 5] [6 6] [7 7] [8 8] [9 9] >obs2: [1 4] [5 5] [6 6] [7 7] [8 8] [9 9] >obs3: [1 4] [5 5] [6 8] [9 9] >obs4: [1 9] > >One first idea for a macro readout: > >%MACRO readout(data); > >*obs1; > >%DO i=1 TO 8; > > DATA readout1; > SET &data; > WHERE ID in (1,2); *here the string IDs has to be read out; > RUN; > > .... > >%END; > >%MEND readout; > >How can I read out the information in the [...]? > >Best regards, Stefan.

Hi Stefan, first I can say, that a macro in that environment might not a good idea, second: mixing macro- and datastep code is a very bad idea!

%do i=1 to 8;

will never do what you want, whatever it is.

One question: what are that "IDs"? What do you want to get? Maybe it would be easier to understand, if you provide the desired result, instead of the method you try to get it.

Gerhard


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