| Date: | Tue, 12 Jan 2010 15:49:02 -0500 |
| Reply-To: | Toby Dunn <tobydunn@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Toby Dunn <tobydunn@HOTMAIL.COM> |
| Subject: | Re: macro-variables |
|
Im not sure Id use macro variables here as an optimal approach but if I
had too try this:
Proc SQL ;
Select Jaarym Into : Values Separated by ' '
From DSYM ;
Quit ;
Data Need ;
Set Have ;
If ( Testing EQ 'Y' ) And ( PAS In ( &Values ) ) Then Do ;
..... Code Here ....
End ;
Run ;
On Tue, 12 Jan 2010 05:20:48 -0800, laika <michel.verheyen@AXA.BE> wrote:
>Hi,
>
>I create in de code below a number of macro-variables, depenting on
>the number of records in dsym.
>
>DATA _NULL_ ;
> SET dsym END = eof ;
> CALL SYMPUT(CATS("perio"||left(_N_)),PUT(jaarym,6.)) ;
> If eof THEN CALL SYMPUT('total',PUT(_N_,6.)) ;
>RUN ;
>
>I want to build 'macrobuild' and afterwards use these macro-variable
>in the next data-step in the IF statement, when for example the dsym-
>dataset contains 2 records.
>
>macrobuild = (pas EQ &perio1 OR pas EQ &perio2)
>IF (Testing EQ 'Y') AND macrobuild then DO ;
>(IF (Testing EQ 'Y') AND (pas EQ 2009 OR pas EQ 2010) then DO ;)
>
>I hope that my explanation is clear.
>
>Tx
|