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 (September 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 2 Sep 1999 11:44:28 -0400
Reply-To:   Bernard Tremblay <bernard@CAPITALE.QC.CA>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:   To: Torben Haslund <Torben.Haslund@VBIOL.SLU.SE>
From:   Bernard Tremblay <bernard@CAPITALE.QC.CA>
Organization:   Imaginasys enr.
Subject:   Re: Reading from a data set - to a macro variable
Comments:   To: SAS-L@LISTSERV.VT.EDU
Content-Type:   text/plain; charset=us-ascii

Hi Torben,

You should include the where with the dataset options to make it independent of the rest of your processing.

Try something like:

%let mnr=1; %let model = MODELS(where=(model_id=&mnr.));

This is OK if the dataset name is MODELS and you use the "data=sasdsn" on your proc statement. Example:

proc print data=&model; title "data of model &mnr"; run;

I hope it helps,

Bernard Tremblay

-- \\\|/// \\ - - // ( @ @ ) +-----oOOo-(_)-oOOo-------+--------------------------------------+ | Bernard Tremblay | | | La Capitale | Tel: (418) 646-2401 | | | Fax: (418) 646-5960 | | | Int: Bernard.Tremblay@capitale.qc.ca | +-------------------------+--------------------------------------+ | Imaginasys enr | Res: (418) 658-1411 | | | Int: bertrem@quebectel.com | +--------------Oooo-------+--------------------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_) Torben Haslund wrote: > > Dear SAS-Lers, > > I have a list of models to be tested in GLM or MIXED. The list is a SAS > data set, where each model has a MODEL_ID. I want to read one model at a > time into a macro variable using %let model= ...something.... > How can I do that? > > The SAS data set with the models: > OBS MODEL_ID MODEL N > > 1 1 block 1 > 2 2 trt 2 > 3 3 soil_ef1 3 > 4 4 soil_ef2 4 > 5 5 soil_ef3 5 > 6 6 soil_ef4 6 > 7 7 soil_ef5 7 > 8 8 soil_ef6 8 > 9 9 block trt 9 > 10 10 block | trt 10 > 11 11 block soil_ef1 11 > 12 12 block soil_ef2 12 > 13 13 block soil_ef3 13 > 14 14 block soil_ef4 14 > 15 15 block soil_ef5 15 > 16 16 block soil_ef6 16 > 17 17 block | soil_ef1 17 > 18 18 block | soil_ef2 18 > 19 19 block | soil_ef3 19 > 20 20 block | soil_ef4 20 > 21 21 block | soil_ef5 21 > 22 22 block | soil_ef6 22 > > I have tried the following, where MODELS is the above data set in > WORK-directory, and mnr is the model_id number . > > %let model=MODELS where model_id=&mnr.; > > If anybody has 'the simple and obvious' solution, please send me a note. > > torben > > ::::::::::::::::::::::::::::::::: > Torben Haslund > Department of Plant Biology > Swedish University of Agricultural Sciences > P.O. Box 7080 > S - 750 07 UPPSALA, Sweden > > E-mail address: Torben.Haslund@vbiol.slu.se > Home and postal address: Ostre Paradisvej 7B, > DK-2840 HOLTE, Denmark > Phone home: +45 4541 1198

-- \\\|/// \\ - - // ( @ @ ) +-----oOOo-(_)-oOOo-------+--------------------------------------+ | Bernard Tremblay | | | La Capitale | Tel: (418) 646-2401 | | | Fax: (418) 646-5960 | | | Int: Bernard.Tremblay@capitale.qc.ca | +-------------------------+--------------------------------------+ | Imaginasys enr | Res: (418) 658-1411 | | | Int: bertrem@quebectel.com | +--------------Oooo-------+--------------------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_)


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