Date: Fri, 7 Nov 2008 13:57:28 -0500
Reply-To: SAS_learner <proccontents@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SAS_learner <proccontents@GMAIL.COM>
Subject: Is this right code for my problem ??
Content-Type: text/plain; charset=ISO-8859-1
Hello All,
What I am trying to do is check for a variable that ends " _blc" ( _bl0 :
), If there is one existing in a dataset then make that variable value = 0 (
I know it is against certain rules) What I am planning to do is down here,
but some how It is not giving me what I wanted. ERROR saying V_name is not
resolved and even if it resolves checking the variable using
%symexist(&v_name.) is it a right way ??
Right now I am Unix SAS (Ultra Edit) and has problem debugging my code.
data temp.test;
E1_blc = 1 ; Output ;
E_blc = 1 ; Output ;
K_blc = 1 ; Output ;
I_blc = 1 ; Output ;
T_blc1 = 1 ; Output ;
R_blc1 = 1 ; Output ;
EE= 1 ; Output ;
EE2 = 1 ; Output ;
Run;
/*Checking in Whole Library with out running the Proc Contents */;
Proc Sql Noprint ;
select Quote(Name) into : v_name Separated by " "
from Dictionary.Columns
where Upcase(Memname) = 'TEMP' and Upcase(name) like '_BLC%' ;
%put &V_name. ;
Quit ;
/*Checking in the dataset*/
Proc Contents data = Temp.Test Out = Temp.Content Noprint ; Run;
Proc Sql Noprint ;
select Name into : v_name Separated by " "
from Temp.Content
where name like '_blc%' ;
%put &V_name. ;
Quit ;
Options Symbolgen Mprint ;
Data temp.test1 ;
Set temp.test;
if %symexist(&v_name.) then do;
&v_name=0;
end;
Run;
Thanks for your time and Help
SL