Date: Thu, 31 May 2001 17:09:12 +0100
Reply-To: Peter Crawford <peter.crawford@DB.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@DB.COM>
Subject: Re: My date format
Content-type: text/plain; charset=iso-8859-1
perhaps Drako has a practical request for the sas ballot
I don't know how many customers would like the EURFdate formats
extended beyond european languages(plus I notice in v8 on line doc,
Africaans), but the ballot survey provides one way of letting SAS
Institute know how important this might be.
When referring to currency formats I assume, below, David Johnson is
considering their INPUT, because for OUTPUT we can write a picture
format to prefix (or suffix) any value with a symbol of choice.
The EURO format feature set includes a "still to be documented (and
perhaps implemented in production)" feature which allows the Euro
symbol(?) to be defined by a debug string. This enables the equivalent
of a sterling informat to input and tolerate values prefixed by GBP(£) signs
Until Drako can persuade SAS Institute to extend DFLang and date
format support to the language of his preference, he may follow the
advice David has offered, and use a cntlin dataset for proc format.
Then at least he can avoid another program Ian Whitlock would neatly
categorise as "wallpaper".
Datum: 31/05/2001 15:42
Antwort an: DavidJohnson@halifax.co.uk
Betreff: Re: My date format
Drako's email appears below:
SAS-L Digest - 31 May 2001 - Special issue (#2001-673)
I gather 'STU' and 'LUY' are abbreviations for month names in a language
other than English. If your intention is to write a translation like
'Janvier', 'Fevrier' etc for months by date number, then you mightlike to
try the following:
. Create a character value format that converts the english month
names into the language you want to use
. Then apply a double formatting statement to your variable like so:
NewName = Put( Put( Date, MonName9.), MyDate.) || Put( Date,
I suppose I should be surprised that there isn't a native naming format for
months in various foreign languages... but then the currency of the largest
stock exchange in the world is only formatted in SAS by either mapping the
'$' symbol to a '£' symbol, or by using the Euro format!!!
The other solution I wrote a long time ago to a similar problem... (the SAS
format defined the taxation quarters differently to our own local taxation
rules) was to build the format using a data step and a CntlIn statement.
So if my data covered 1979 to 2001, I looped through that range of dates and
assigned them to a format value based on the year and part of the year.
Then that was loaded into a format library with the CntlIn option on the
10338 Data DATEFMT;
10339 Length Label $40;
10340 TYPE = 'N';
10341 FMTNAME = 'MYDATE';
10342 Do START = '01Jan1979'd to '31may2001'd By 1;
10343 END = START;
10344 If Put( START, MMDDYY4.) <= '0331' Then
10345 LABEL = Put( START - 365, Year4.) || '03';
10346 Else If Put( START, MMDDYY4.) <= '0630' Then
10347 LABEL = Put( START - 365, Year4.) || '04';
10348 Else If Put( START, MMDDYY4.) <= '0930' Then
10349 LABEL = Put( START, Year4.) || '01';
10350 Else LABEL = Put( START, Year4.) || '02';
NOTE: The data set WORK.DATEFMT has 8187 observations and 5 variables.
NOTE: The DATA statement used 0.63 seconds.
10355 Proc Format Lib = WORK CntlIn = DATEFMT;
NOTE: Format MYDATE has been output.
This solution starts the taxation year on 1 July and increments the quarters
into the next year. The tax year is still defined as 2000 if in 2001 the
date is before 30 June.
Not the most elegant solution, but it works, and as you can see, is fast.
* 07080 81 8399
This message is attributable to the sender and does not necessarily reflect
the view of Halifax Group plc or its subsidiaries.
Date: Thu, 31 May 2001 09:10:03 +0200
From: Drako <akepka@ELKA.PW.EDU.PL>
Subject: My date format
I must create date format. I write something like this:
proc format lib=work;
'01JAN00'd-'31JAN00'd = %0d'STY'%0y (datatype=date)
'01FEB00'd-'31FEB00'd = %0d'LUT'%0y (datatype=date)
But in this way I will have to write range for each month each year.
Do you know better solution?
Part of the Halifax Group, Halifax plc, Registered in England No. 2367076. Registered Office: Trinity Road, Halifax, West Yorkshire HX1 2RG. Represents only the Halifax Financial Services Marketing Group for the purposes of advising on and selling life assurance, pensions and unit trust business. The Marketing Group is regulated by the Personal Investment Authority. Switchboard 01422 333333.
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.