|Date: ||Tue, 14 Feb 2006 02:30:57 +0000|
|Reply-To: ||toby dunn <tobydunn@HOTMAIL.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||toby dunn <tobydunn@HOTMAIL.COM>|
|Subject: ||Re: Substr from macro value|
|Content-Type: ||text/plain; format=flowed|
Harry is correct in that %scan was built for this. Also you dont need to
create another macro variable. Consider the following:
%Let Table1 = Mocca.Sep05 ;
Title2 "Reference period = %scan(&Table1,2,.)" ;
I think you will find this way more stable, easier to code, maintain, and
Subject: Substr from macro value
Date: Mon, 13 Feb 2006 16:49:23 -0800
This is probably embarrassingly elementary but I can't get a result.
Am trying to get a string from a simple macro value into a Title
%Let Table1 = Mocca.Sep05;
The month value varies so I want to take the five right side characters
into another macro to use in a Title statement. eg
%Let mnth = substr(&Table1,7,5);
Title2 "Reference period = &mnth.";
However everything I've tried crashes on the period in the Table1 macro
value, the log saying; "...Variable names of the form X.X must be
either FIRST.X or LAST.X."
Can someone please help an incompetent out on this?