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 (January 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 28 Jan 2008 08:16:59 -0500
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: Actual month question
Comments: To: =?windows-1255?B?4uPpIOHvIODh6Q==?= <GADI_B@MALAM.COM>
In-Reply-To:  <BBA5D76FB046794FA7F01F8E02BFC1710103E81D@jer-mail1.jer.ad.malam.com>
Content-Type: text/plain; charset="UTF-8"

Gadi

Cool! It made me think for a second that there is another solution that follows yours. Here's a demo for the 12 months of the year:

data; do mon_num = 1 to 12; mname = put( (mon_num-1)* 31 ,monname.); output; end; run;

proc print; run;

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

גדי בן אבי <GADI_B@MALAM.COM > To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Re: Actual month question

01/28/2008 07:53 AM

Please respond to גדי בן אבי <GADI_B@MALAM.COM >

You could also use something like: mname = put(mdy(mon_num,1,1992),monname.);

Gadi

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gadi Ben-Avi Sent: Monday, January 28, 2008 2:28 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Actual month question

1. Create a format using PROC FORMAT to translate the number to Month Name 2. Use Select and When to create a new variable based on the value that contains the Month Name.

If you have a sas date value, you can use the MONNAMEw. format to get the month name.

gadi <jeli0703@hotmail.co.uk> wrote in message news:cddd775c-2398-4a06-b117-71a828080512@h11g2000prf.googlegroups.com... >I have a set of values 1 to 12 and i need to return the actual month >corresponding to these numbers ie > > if i enter 2 my code will bring back February if i enter 12 my code > will bring back december ect > > im sure i have used it before but cant remember. > > please help

----------------------------------------- CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and/or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.


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