format dates to December 23rd, 2009

Don't think there is anything available to do that, however you could write a simple function that you pass in a date and it returns a string formatted as you like.

You would set up a character variable with 12 extents initialised to the 12 months and you would then strip out the day, month and year from the input date using the month to select the relevant extent from the months variable.
The tricky bit is getting the correct append to the day but again probably simplest putting them into an extent 31 variable and select based on the day.
 
Thanks so much for the reply. new to progress, not very familier with syntax. Could you help with the function? maybe a simple sample of the function with only a coupld of month and 2 days in it? then i can add the rest of the code in.
Thanks so much!!!!
 
Here is the function :)

Code:
FUNCTION dispdate RETURNS CHARACTER
  ( INPUT ipdate AS DATE ) :
/*------------------------------------------------------------------------------
  Purpose:  
    Notes:  
------------------------------------------------------------------------------*/
DEF VAR cmonth AS CHARACTER FORMAT "X(14)" EXTENT 12 INIT
  ["January","February","March","April","May","June","July","August","September","October","November","December"].
DEF VAR cday AS CHARACTER FORMAT "X(4)" EXTENT 31 INIT
  ["1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th","17th",
   "18th","19th","20th","21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th","31st"].
DEF VAR iday AS INTEGER.
DEF VAR imonth AS INTEGER.
DEF VAR iyear AS INTEGER FORMAT "9999".
DEF VAR cfulldate AS CHARACTER FORMAT "X(40)".
 
  ASSIGN iday = DAY(ipdate)
         imonth = MONTH(ipdate)
         iyear = YEAR(ipdate).
  ASSIGN cfulldate = cmonth[imonth] + " " + cday[iday] + " " + STRING(iyear,"9999").
  RETURN cfulldate.   /* Function return value. */
END FUNCTION.
    
 
DISPLAY dispdate(TODAY - 3) FORMAT "X(40)".

The display statement is an example of how you call the function you can of course pass in any date you like.
 
Back
Top