Date: Thu, 10 Aug 2006 22:53:58 -0400
Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Subject: Re: dropping empty variable columns
In-Reply-To: <006601c6bcce$99466490$6400a8c0@DataSavant>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Gregg,
To answer your question, let me quote myself from an earlier post today:
: "In my ongoing, never ceasing efforts to seize every opportunity to
compare and contrast the antiquated macro language with SAS Component
Language to illustrate the overwhelming advantages offered by SAS
Component Language (over the antiquated macro language) for the more
alert members of SAS-L (the drowsy can just continue to ignore
please), let me point out that you can do exactly what you want to do
the way you want to do it with SAS Component Language.". And, let me
add, what goes for the drowsy also goes for the visceral reactors and
the cognitively simple.
Joe
On 8/10/06, Gregg P. Snell <gsnell@datasavantconsulting.com> wrote:
> SCL Joe,
>
> Did you think the original poster was intending to create an
> application/system or just looking for an ad-hoc solution?
>
> Gregg Snell
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Joe
> Whitehurst
> Sent: Thursday, August 10, 2006 3:06 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: dropping empty variable columns
>
> ...there? Where? Hell? Learne how to use SCL and stop mucking with the
> Antiquated Macro Language!
>
> On 8/10/06, toby dunn <tobydunn@hotmail.com> wrote:
> > %macro DropMiss( Lib = Work , Mem = , Vars = , DataOut = ) ; %Local
> > DropVars ;
> >
> > Ods Listing Close ;
> >
> > ODS OutPut OneWayFreqs = DropMissFreqs ;
> >
> > Proc Freq
> > Data = &Lib..&Mem ;
> > Table &Vars / Missing ;
> > Run ;
> >
> > Ods Listing ;
> >
> >
> > Data DropMissTemp ;
> > Set DropMissFreqs ;
> >
> > Var = Scan( Table , 2 , ' ' ) ;
> >
> > If ( Percent = 100 ) And ( ( Put( VValueX( Var ) , 8. -L ) = ' ' )
> > Or ( VValueX( Var ) = ' ' ) ) ;
> >
> > Run ;
> >
> >
> > Proc SQL NOPrint ;
> > Select Var Into : DropVars Separated By ' '
> > From DropMissTemp ;
> > Quit ;
> >
> >
> > %Put The following variables will be deleted : &DropVars ;
> >
> > Data &DataOut ;
> > Set &Lib..&Mem ( Drop = &DropVars ) ;
> > Run ;
> >
> >
> > Proc DataSets NoList ;
> > Delete DropMissFreqs DropMissTemp ;
> > Quit ;
> >
> >
> > %Mend DropMiss ;
> >
> >
> >
> > Data Test ;
> > Infile Cards ;
> > Input A B C D E $ F $ G $ H $ ;
> > Cards ;
> > . 1 1 . . A A .
> > 2 . 2 . B . B .
> > 3 3 . . C C . .
> > ;
> > Run ;
> >
> >
> > %DropMiss( Mem = Test , Vars = _All_ , DataOut = Test2 ) ;
> >
> >
> >
> > Vars Parameter Accepts the following Values :
> >
> > _All_ : Checks both Numeric and Character Variables
> > _Numeric_ : Checks Numeric Variables Only
> > _Character_ : Checks Character Variables Only
> > User Defined List : Checks Only the Variables in list
> >
> >
> >
> > The Macro could use some more work but it will get you there.
> >
> >
> > Toby Dunn
> >
> > Normal People Worry Me!!!!!
> >
> > I reject your reality and substitute my own!!!
> >
> >
> >
> >
> >
> > From: "ram.sasha@gmail.com" <ram.sasha@GMAIL.COM>
> > Reply-To: "ram.sasha@gmail.com" <ram.sasha@GMAIL.COM>
> > To: SAS-L@LISTSERV.UGA.EDU
> > Subject: dropping empty variable columns
> > Date: Wed, 9 Aug 2006 07:32:21 -0700
> >
> > I have 109 variables in a dataset and would like to drop those
> > variable columns that are blank or empty .I have to repeat this
> > process for 30 datasets with different variable names.
> > using drop or keep in the datastep is cumbersome.any ideas appreciated.
> >
> > Thanks
> >
>
|