|
"Roland" <roland@rashleigh-berry.fsnet.co.uk> wrote in message
news:bi9peb$glu$1@newsg3.svr.pol.co.uk...
> It's an interesting macro. You could have dispensed with the library
> parameter and just let the user put it as part of the dataset name like
> LIB.DSNAME . I would have preferred a pure macro code solution so you
> didn't have any data steps or procedural steps in it.
>
> I have macros to do something similar but it doesn't cater for variables
of
> the form x1-x10 and tt_: .
>
> data test;
> a=1;c=2;e=3;
> run;
>
> %put >>> %match(%varlist(test),a b c d e f);
>
> >>> a c e
Macros can be linked to from
http://www.datasavantconsulting.com/roland/sasautos.html
> "Mariusz Gromada" <mariusz.gromada@wp.pl> wrote in message
> news:bi9a6d$1fi$1@julia.coi.pw.edu.pl...
> > Hello!
> >
> > I have had an idea (interesting I hope) and I have created a SAS
> > macro-program based on it (sorry for my english). It is working quite
> > well. To see details (code, many examples) please click on this link:
> >
> > http://atraktor.ask33.net/sas/variablesselection.html
> >
> > A little introduction:
> >
> > %VariablesSelection(Variables,DataSet<,LibName=><,VType=>);
> >
> > Macro returns (in %global VariablesFound) common list of variables for:
> >
> > - list of variables (given in Variables)
> > and
> > - variables in data set (given in DataSet)
> >
> > Parameters:
> >
> > Variables - your list of variables.
> > Variables =
> > 1) var1 var2 x1-x20 tt_: d1 g6 k: (etc...)
> > or 2) _all_ (if _all_ then VType has no impact)
> > or 3) _numeric_ (if _numeric_ then VType has no impact)
> > or 4) _character_ (if _character_ then VType has no impact)
> >
> > DataSet - name of the data set
> >
> > LibName (optional) - name of the library with your DataSet (default =
> WORK)
> >
> > VType (optional) - specifies selected variables type (default = all)
> > VType =
> > 1) all
> > or 2) num
> > or 3) char
> >
> >
> > Regards,
> > Mariusz Gromada
> >
> > PS. I will be very grateful for any comments (remarks).
> >
> > --
> > Mariusz Gromada
> > http://atraktor.ask33.net/
> >
>
>
|