[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: My  date format
From:       Peter Crawford <peter.crawford () DB ! COM>
Date:       2001-05-31 16:09:12
[Download RAW message or body]

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".

Regards



Datum:         31/05/2001 15:42
An:            SAS-L@listserv.uga.edu




Antwort an:    DavidJohnson@halifax.co.uk

Betreff:       Re: My  date format
Nachrichtentext:


Drako's email appears below:

SAS-L Digest - 31 May 2001 - Special issue (#2001-673)

Hi Drako,

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,
Year4.);

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
Format procedure.

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';
10352      Output;
10353    End;
10354  Run;

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.
10356  Run;

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.

Kind regards


** ##*

David Johnson
*     07080 81 8399
*     sasuser@dkvj-cons.com
*   http://www.dkvj-cons.com
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

Hello,

I must create date format. I write something like this:

proc format lib=work;

picture mydate

'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?


Many Thanks



------------------------------------------------------------------------------
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.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic