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 (June 1998, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 29 Jun 1998 23:31:47 +0100
Reply-To:   "Andrew J. L. Cary" <ajlcary@CARYCONSULTING.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Andrew J. L. Cary" <ajlcary@CARYCONSULTING.COM>
Subject:   Re: Quote in Macro Variables

Try the %BQUOTE function.

%LET DD=18941225; %LET DATE1= %BQUOTE('%SUBSTR(&DD,1,4)-%SUBSTR(&DD,5,2)-%SUBSTR(&DD,7,2)'); %LET DATE2= %BQUOTE("%SUBSTR(&DD,1,4)-%SUBSTR(&DD,5,2)-%SUBSTR(&DD,7,2)");

%PUT DATE1= &DATE1 ; DATE1= '1894-12-25' %PUT DATE2= &DATE2; DATE2= "1894-12-25"

Jensenk@my-dejanews.com wrote in message <6n87vg$463$1@nnrp1.dejanews.com>... >In article <1998062601155500.VAA16236@ladder03.news.aol.com>, > dnordlund@aol.com (DNordlund) wrote: >> >> >I have a date in a macro variable in the format yymmdd. I need a macro >> >variable that has 'yyyy-mm-dd' with the quotes around it. >> > >> >I have got to this point but can't seem to figure out how to get the quotes >> >around it. Any ideas? Thanks for the help. >> > >> >%let >> >newdate=19%substr(&olddate,1,2)-%substr(&olddate,3,2)-%substr(&olddate,5,2) >> > >> > >> >> Do you need to have single quotes ( 'yyyy-mm-dd') around the string, or will >> double quotes ("yyyy-mm-dd") work for you? If you can use the double quote >> mark, then just place one at the beginning and end of the string like this: >> >> %let >> newdate="19%substr(&olddate,1,2)-%substr(&olddate,3,2)-%substr(&olddate,5,2) "; >> >> Hope this helps, >> >> Dan Nordlund >> >Unfortunately, I need to have only the single quotes. Any Ideas? > >-----== Posted via Deja News, The Leader in Internet Discussion ==----- >http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum


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