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 (December 2002, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 30 Dec 2002 17:39:50 GMT
Reply-To:   julierog@ix.netcom.com
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Roger Lustig <trovato@BELLATLANTIC.NET>
Subject:   Re: Format Date
Content-Type:   text/plain; charset=us-ascii; format=flowed

Dear Maggie: You seem to have confused data set variables with macro variables.

The most important thing to remember when doing anything with macros--including learning how to use them is this:

===A macro writes code.===

So, your %LET statement is assigning a value to a macro variable, and that value will be treated as code.

When you use the macro variable in a TITLE statement (or anywhere else), it will insert code.

What code do you want there? The string

02DEC2002

Right?

So that's the value the macro variable needs to have. It's going to be text, because code is text. It's not going to be a SAS date, because you don't want a SAS date in your title--you want a text string.

%LET TRADE_DT=02DEC2002;

is the macro language statement that will put the string you want into the macro variable. And when you then use the macro variable within a statement, it will insert the string into the statement, and you will be using a macro to write code.

Best,

Roger Lustig

Maggie wrote: > Hi - I have a %LET statement which needs the input of a date, such as: > %LET TRADE_DT="02DEC2002"D; > > When I put the title in the charts, the title has the letter 'D' at the end > of the date. What can I do to remove the 'D' after the date? THanks! > > TITLE COLOR=BLUE "Chart on &TRADE_DT"; > > The output would be 12DEC2002D


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