Prev: About sgpanel
Next: help w do loop
From: Arthur Tabachneck on 14 Dec 2009 20:44 Lewis, Unfortunately, I'm not familiar with IML. However, that said, can't you solve your problem by using the keep data step option in your 'use' statement? E.g., use mydata (keep=x1-x50); HTH, Art --------- On Mon, 14 Dec 2009 20:00:27 -0500, Lewis Jordan <lewjord(a)UGA.EDU> wrote: >I have searched and scoured SAS help and the listserv to solve this problem. Surely there is a simpler solution. > >Consider a data set with the variables: dummy1,dummy2,x1,x2,...,x50. > >I would like to read in only the x1-x50 variables into PROC IML. Is there a way to specify to read in x1-x50 only? For example: > >Proc IML; >use mydata; >read all var {x1-x50} into x; >OR >read all var {x1:x50} into x; > > >I don't want to write out: > >read all var {x1 x2 x3 ... x50} into x; > >I know, I know, that it is easy to do the following: > >%macro readit(); > >Proc IML; >use my data; > %do i=1 %to 50; > read all var {x&i} into tmpX; > X=X||tmpX; > %end; > >BUT THERE HAS TO BE AN EASIER WAY!!!!! > >Thanks for the help, > >LCJ
From: Dale McLerran on 15 Dec 2009 01:40 Yes, you can use the keep option as Art suggests to restrict the available data to just the set of variables that are desired. However, using purely IML syntax, one can read in the variables x1-x50 using the following code: proc iml; use mydata; read all var ('x1':'x50') into x; ... HTH, Dale --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra(a)NO_SPAMfhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 --------------------------------------- --- On Mon, 12/14/09, Arthur Tabachneck <art297(a)NETSCAPE.NET> wrote: > From: Arthur Tabachneck <art297(a)NETSCAPE.NET> > Subject: Re: The Woes of PROC IML > To: SAS-L(a)LISTSERV.UGA.EDU > Date: Monday, December 14, 2009, 5:44 PM > Lewis, > > Unfortunately, I'm not familiar with IML. However, > that said, can't you > solve your problem by using the keep data step option in > your 'use' > statement? > > E.g., use mydata (keep=x1-x50); > > HTH, > Art > --------- > On Mon, 14 Dec 2009 20:00:27 -0500, Lewis Jordan <lewjord(a)UGA.EDU> > wrote: > > >I have searched and scoured SAS help and the listserv > to solve this > problem. Surely there is a simpler solution. > > > >Consider a data set with the variables: > dummy1,dummy2,x1,x2,...,x50. > > > >I would like to read in only the x1-x50 variables into > PROC IML. Is there a > way to specify to read in x1-x50 only? For example: > > > >Proc IML; > >use mydata; > >read all var {x1-x50} into x; > >OR > >read all var {x1:x50} into x; > > > > > >I don't want to write out: > > > >read all var {x1 x2 x3 ... x50} into x; > > > >I know, I know, that it is easy to do the following: > > > >%macro readit(); > > > >Proc IML; > >use my data; > > %do i=1 %to 50; > > read all var {x&i} into tmpX; > > X=X||tmpX; > > %end; > > > >BUT THERE HAS TO BE AN EASIER WAY!!!!! > > > >Thanks for the help, > > > >LCJ >
|
Pages: 1 Prev: About sgpanel Next: help w do loop |