Date: Tue, 6 Dec 2005 13:11:40 -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: Retain the order
Content-Type: text/plain; charset="iso-8859-1"
Hello Guys I need do something like this
%macro getlists ( data = w ) ;
/* get the following lists from dictionary files */
%let ordlist = x z y ;
%let alllist = x x_d z y y_d ;
%let numlist = x ;
%let chrlist = y ;
%mend getlists ;
to make list general I am doing this
proc sql noprint ;
select distinct(name) into : list separated by ' '
from dictionary.columns
where libname = "WORK"
and memname = "W"
and format ^= " ";
select name into :clist separated by " "
from dictionary.columns
where libname = "WORK"
and memname = "W"
and type = "char"
and format ^= " ";
select name into :nlist separated by " "
from dictionary.columns
where libname = "WORK"
and memname = "W"
and type = "num"
and format ^= " "
%let ordlist = &list ;
%let numlist = &nlist ;
%let chrlist = &clist ;
%put &ordlist;
%put &numlist;
%put &chrlist;
%let newlist =
%sysfunc(tranwrd(&ordlist;,%str( ),%str(__d ))) ;
%put &newlist;
;
quit;
my log looks like this
%put &ordlist;
T d x y
%put &numlist;
x d
%put &chrlist;
y T
%let newlist =
%sysfunc(tranwrd(&ordlist;,%str( ),%str(__d ))) ;
%put &newlist;
T__d d__d x__d y
I need help at putting the values of &ordlist and &newlist together to
make it do something like this
%let alllist = x x_d z y y_d ;