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 (March 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 26 Mar 2004 12:03:46 -0500
Reply-To:     Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:      Re: SAS question
Content-Type: text/plain; charset=ISO-8859-1

To get *precisely* what was requested:

%substr(%sysfunc(intnx(month,%sysfunc(today()),-1),monyy7.),1,1)%substr(% sysfunc(lowcase(%sysfunc(intnx(month,%sysfunc(today()),-1),monyy7.))),2,6);

That capitalizes only the initial letter of the month name.

Is there a more direct way?

I think the initial request included making this available in all programs. I suppose the answer to that is to have and invoke an autoexec.sas file and to place the above code in it.

On Fri, 26 Mar 2004 10:29:41 -0500, SAS Bigot <sas_bigot@ML1.NET> wrote:

>Actually, replace the YYMMN6. format with MONYY7. to get exactly the >format you want. > > >----- Original message ----- >From: "Harry Droogendyk" <harry.droogendyk@RBC.COM> >To: SAS-L@LISTSERV.UGA.EDU >Date: Fri, 26 Mar 2004 08:31:01 -0500 >Subject: Re: SAS question > >Is reporting month always the previous month ? > >%let reporting_month = >%sysfunc(intnx(month,%sysfunc(today()),-1),yymmn6.); >%put &reporting_month; > >-----Original Message----- >From: Schechter, Robert S [mailto:robert.schechter@ASTRAZENECA.COM] >Sent: Friday, March 26, 2004 8:05 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: FW: SAS question > > >Hi fellow SAS-L readers, > >I was asked by a colleague: > >> In PC Sas can I set up an auto global macro variable that contains the >> reporting month and how do you do it? >> I want to give it a value 'Feb2004' this month and use it with all my sas >> programs. Next month I would change it to 'Mar2004' then run all my sas >> programs. >> >> Thanks, >> Dick. > >------------------------------------------------------------ >This e-mail may be privileged and/or confidential, and the sender does >not >waive any related rights and obligations. Any distribution, use or >copying of >this e-mail or the information it contains by other than an intended >recipient >is unauthorized. If you received this e-mail in error, please advise me >(by >return e-mail or otherwise) immediately. > >Ce courrier électronique est confidentiel et protégé. L'expéditeur ne >renonce >pas aux droits et obligations qui s'y rapportent. Toute diffusion, >utilisation >ou copie de ce message ou des renseignements qu'il contient par une >personne >autre que le (les) destinataire(s) désigné(s) est interdite. Si vous >recevez >ce courrier électronique par erreur, veuillez m'en aviser immédiatement, >par >retour de courrier électronique ou par un autre moyen. > >============================================================ > >-- >http://www.fastmail.fm - Access your email from home and the web


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