| Date: | Mon, 21 Aug 2006 09:32:58 +0200 |
| Reply-To: | yom <yomsas@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | yom <yomsas@GMAIL.COM> |
| Subject: | Re: Create variable list |
|
| In-Reply-To: | <129a50e0608201559ie5852a5mc97e06cd4739eaa1@mail.gmail.com> |
| Content-Type: | text/plain; charset=ISO-8859-1; format=flowed |
Thank you very much to all for your answers !
yom
2006/8/21, Joe Whitehurst <joewhitehurst@gmail.com>:
>
> Or, alternatively, for a less Antiquated solution, do this in the
> appropriate environment:;
>
> dcl list toto;
> toto=makelist();
> dsid=open('toto','v);
> do i=1 to attrn(dsid,'nvars');
> rc=setitemc(toto,varname(toto,i),i,'y');
> end;
>
> Now you will have all your variable names in a powerful SAS Component
> Language list where you can quickly conditionally generate and /or
> execute code with the aid of a modern debugger and detail performance
> analysis tool--yields performance statistics on single statments or
> functions.
>
> Joe
>
> On 8/19/06, Howard Schreier <hs AT dc-sug DOT org> <nospam@howles.com>
> wrote:
> > On Fri, 18 Aug 2006 10:47:59 +0200, yom <yomsas@GMAIL.COM> wrote:
> >
> > >Thank you very much Gwenael ?
> > >Is it normal it takes a long time to be executed (about 30 seconds) ?
> > >
> > >yom
> > >
> > >
> >
> > Since you are interested in just one table with a known name and from a
> > particular library, there is no need to go through the metadata for
> other
> > tables. So run PROC CONTENTS against that one table with the OUT option,
> and
> > process that output instead of SASHELP.VCOLUMN.
> >
> > >2006/8/18, Gwenael Besnier <gwen_1973@hotmail.com>:
> > >>
> > >> Hi,
> > >>
> > >> use the SASHELP.VCOLUMN:
> > >>
> > >> data toto;
> > >> var1=1; var2k=1; var3k='A'; var4=1; var5k=1;output;
> > >> run;
> > >>
> > >> proc sql noprint;
> > >> select NAME into :varlist separated by ','
> > >> from SASHELP.VCOLUMN
> > >> where upcase(LIBNAME)='WORK' and upcase(MEMNAME)='TOTO'
> > >> and TYPE='num' and index(upcase(NAME),'K')>0;
> > >> quit;
> > >>
> > >> %put &varlist.;
> > >>
> > >> HTH
> > >> Gwen
> > >>
> > >>
> > >> >From: yom <yomsas@GMAIL.COM>
> > >> >Reply-To: yom <yomsas@GMAIL.COM>
> > >> >To: SAS-L@LISTSERV.UGA.EDU
> > >> >Subject: Create variable list
> > >> >Date: Fri, 18 Aug 2006 09:55:08 +0200
> > >> >
> > >> >Dear All,
> > >> >
> > >> >I have a table which contain a lot of variables. What I would like
> to do
> > >> is
> > >> >to create a list of the variables whose type is numeric and whose
> name
> > >> >contains the letter K. Do you know if there is an easy way to do it?
> > >> >
> > >> >Thank you very much in advance!
> > >> >
> > >> >Best regards,
> > >> >
> > >> >yom
> > >>
> > >> _________________________________________________________________
> > >> Sie suchen E-Mails, Dokumente oder Fotos? Die neue MSN Suche Toolbar
> mit
> > >> Windows-Desktopsuche liefert in sekundenschnelle Ergebnisse. Jetzt
> neu!
> > >> http://desktop.msn.de/ Jetzt gratis downloaden!
> > >>
> > >>
> >
>
|