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 (December 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 2 Dec 2005 10:41:16 -0800
Reply-To:     SAS_my_life <subramanyam.phani@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         SAS_my_life <subramanyam.phani@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: How to drop One variable from all the datasets
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

Hello Richard,

I am trying to implement your sample code for dropping One variable from whole library , I am not sure what is the that I am doing wrong it keeps complaining like this

153 proc sql noprint; 154 select 'alter table ' || catx('.', libname, memname) || " drop &aberrant." 155 into :alters separated by ';' 156 from dictionary.columns 157 where libname="&lib" 158 and name="&aberrant" 159 ; NOTE: No rows were selected. 160 %put %superq(alters);

161 &alters; 162 quit

when there is column called OCTA_SEQ which I need to drop from whole library which is not null .

Just to this part on SAS v8 I am doing something like this ( I am doing two proc sql because the requirment is anything that is starting with SUPP should have all the variables expect for the OCTA_SEQ where as other datasets go through some other process and OCTA_SEQ should be dropped after that.

proc sql noprint; select distinct memname into : memname separated by ' ' from dictionary.members where lowcase(libname) = 'datout';

select distinct memname into : supps separated by ' ' from dictionary.members where lowcase(libname) = 'datin' and memname like 'SUPP%' ;

%let name = &memname; %let sname = &supps; %let mcount = &countmem; %let scount = &countsupp;

quit; *** Here I need to make the data step input each data set and output it out ***;

data datout.&&name; set datout.&&name; drop octa_seq; run;

data &&supps; set datin.&&supps; drop octa_seq; run;

but program is stopping after updating the first dataset I know I need to some how make my set statments in a loop but I am not quite sure how to do it , can you help me with it .

thanks for the time and help


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