Date: Thu, 5 Mar 2009 06:58:36 -0600
Reply-To: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: I wanrt to use all variables in macro for the same process
but something is wrong !!
In-Reply-To: <eddd3ecc-b4e0-4542-b86b-e9502c73a4d9@e24g2000vbe.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
You don't need a macro. You don't want a macro. Maybe and array.
Most likely a FORMAT statement.
format <sas variable list> slashInTheMiddle3. ;
It looks like you have many variables with 2 character codes and for
some reason you want to put a / between the values.
I would use a FORMAT and not change the data. If you want to change
the data I would still use a fromat.
On 3/5/09, vrajeshrawal@gmail.com <vrajeshrawal@gmail.com> wrote:
> I am getting error as list of variables is seprated just by space and
> going much beyond the limits.....
>
> %macro variable(V_name);
>
>
> Proc Contents data=DAMODAR.GG_GENOTYPE_PHENOTYPE_2 out = Te_c (keep =
> name ) ;
> Run;
>
> Proc Sql Noprint ;
> Select Distinct name into : V_name separated by ' '
> from te_c ;
> Quit ;
>
> %mend variable;
>
>
>
> %macro snps (V_name);
>
> Data DAMODAR.GG_GENOTYPE_PHENOTYPE_3;
> length _ALL_ $3;
> set DAMODAR.GG_GENOTYPE_PHENOTYPE_2 ;
>
>
> if &V_name= "AA" then do; &V_name = tranwrd(&V_name,"AA","A/A");end;
> else if &V_name= "AT" then do; &V_name = tranwrd(&V_name,"AT","A/
> T");end;
> else if &V_name= "AG" then do; &V_name = tranwrd(&V_name,"AG","A/
> G");end;
> else if &V_name= "AC" then do; &V_name = tranwrd(&V_name,"AC","A/
> C");end;
>
> else if &V_name= "TA" then do; &V_name = tranwrd(&V_name,"TA","T/
> A");end;
> else if &V_name= "TT" then do; &V_name = tranwrd(&V_name,"TT","T/
> T");end;
> else if &V_name= "TG" then do; &V_name = tranwrd(&V_name,"TG","T/
> G");end;
> else if &V_name= "TC" then do; &V_name = tranwrd(&V_name,"TC","T/
> C");end;
>
> else if &V_name= "GA" then do; &V_name = tranwrd(&V_name,"GA","G/
> A");end;
> else if &V_name= "GT" then do; &V_name = tranwrd(&V_name,"GT","G/
> T");end;
> else if &V_name= "GG" then do; &V_name = tranwrd(&V_name,"GG","G/
> G");end;
> else if &V_name= "GC" then do; &V_name = tranwrd(&V_name,"GC","G/
> C");end;
>
> else if &V_name= "CA" then do; &V_name = tranwrd(&V_name,"CA","C/
> A");end;
> else if &V_name= "CT" then do; &V_name = tranwrd(&V_name,"CT","C/
> T");end;
> else if &V_name= "CG" then do; &V_name = tranwrd(&V_name,"CG","C/
> G");end;
> else if &V_name= "CC" then do; &V_name = tranwrd(&V_name,"CC","C/
> C");end;
>
>
> run;
>
> %mend SNPS ;
>
> %variable (V_name);
>
|