Date: Wed, 8 Oct 2003 14:42:22 GMT
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roger Lustig <trovato@VERIZON.NET>
Subject: Re: counting with letters / labelling a sequence with letters ???
Content-Type: text/plain; charset=us-ascii; format=flowed
Have you considered using a format?
<insert data step here>
format chart alpha.;
Now, if the variable itself needs to be alpha, you can use the format in
the data step:
length xchart $1;
xchart = put(chart,alpha.);
Finally, what happens when the number of charts exceeds 26?
Tomislav Svoboda wrote:
> Hi everyone,
> is there a way for counting using letters rather than numbers? (e.g.
> counter = 'a';counter +1 = 'b' etc.) I need to label charts for the
> same subject using a sequence of letters rather than a sequence of
> numbers e.g. where the first chart is chart a (rather than chart 1),
> the second chart is chart b (rather than chart 2) etc.
> I have the following sample code that I would like to modify for this
> data temp;
> input subject @@;
> 1 1 1 2 3 3 10 10 10 8 8 8
> Proc sort; by subject; run;
> data temp2;
> set temp;
> by subject;
> if first.subject then chart = 1;
> chart + 1;
> proc print;run;
> (If you run this, it labels charts as 1,2,3... I need to label them
> a,b,c ...)