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 (September 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 21 Sep 2008 05:24:33 -0700
Reply-To:     "xieanran@gmail.com" <xieanran@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "xieanran@gmail.com" <xieanran@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: problem with macro
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=GB2312

On 9月19日, 下午8时33分, giorgio.tad...@GMAIL.COM (giorgio taddia) wrote: > Good morning everyone, > I have to made a dataset for each letter of the alphabet like this > data a; > set dsin; > where test like "a%"; > run: > data b; > set dsin; > where test like "b%"; > run: > i can't use a format with a macro variable > > I thought to create an array with all the letters and do loop... > thank you in advance. > -- > Giorgio Taddia > Phone:+051909582 > Mob.Phone:+393351235903 > Skype:giorgio.taddia

I hope following scripts can help you.

data letter; input name $; cards; a b c d e f g h i j k l m n ; run;

%macro letters(n_a); data &n_a; set dsin; where test like "&n_a. %"; run; %mend;

data _null_; set letter; call execute (cats('%letters(',name,')')); run;


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