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 (October 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Oct 2008 09:17:00 -0400
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: Put records into marco variable
Content-Type: text/plain; charset=ISO-8859-1

what I'd do:

%let no=0; data _null_; INPUT account 8.; call symputx(cats("a",_n_),account); call symputx("no",_n_); CARDS; 1234 10011 1981985 ; RUN;

%macro doit; %do i=1 %to &no; PROC REPORT data=test ; WHERE account=&&a&i; RUN; %end; %mend;

%doit;

Gerhard

On Tue, 28 Oct 2008 11:23:57 +0100, Nili Nili <niliam@GMX.NET> wrote:

>Hello @all, > >I got a list with account numbers and one after the next should be execute in my program list.sas . In the program list.sas, the account number is a SAS macro variable. > >The result of this code it, the last account number is used in the program, only. > >Have anyone an idea how do I get all account numbers to be executed? >Thank you in advance. >Nili > >DATA acountno; > INPUT account 8.; >CARDS: >1234 >10011 >1981985 >; >RUN; > >FILENAME listA 'C:\:programs\list.sas'; > >DATA _NULL_; > SET accountno; >CALL SYMPUT (‘account’, account); > CALL EXECUTE ('%INCLUDE LISTA;'); >RUN; > >*Programm list.sas needs the accountno as SAS macro variable to work with.; >*Program LIST.SAS; > >%LET account= 1234; > >PROC REPORT data=test ; > WHERE account=&account; >RUN; > >-- >Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! >Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


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