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
|