Focal Point
date translation on &variable

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8041019331

November 09, 2005, 07:01 PM
pruittlr
date translation on &variable
I have an &variable (global) coming from a web page to the focexec. I want to use the &variable in the heading of my report. It's format from the web page is mm/dd/yy. I want to see the month spelled out, then the day, then the 4 digit year. Ex. January 1, 2005.

I know there is "tr", which is used something like this "MtrDYY", to make the Month spelled out. However, I can't seem to get it to work on an &variable. I put it in a define as such: ESDATE/MtrDYY=&&P_SDATE;. This gives me no error, but no output either.

Anyone have any ideas? Thanks for your help.
November 09, 2005, 07:23 PM
Francis Mariani
-SET &ECHO=ALL;

SET DEFCENT = 20
-RUN

-SET &DT1 = '12/31/04';

-SET &DT1A = EDIT(&DT1,'99$99$99');
-SET &DT2 = LCWORD(17,CHGDAT('MDY', 'MXDYY', &DT1A, 'A17'), 'A17') ;
-TYPE &DT1 &DT2

SET DEFCENT is to set the default century, which on my PC was defaulted to 19.

EDIT edits out the slashes.
CHGDAT changes the date format.
LCWORD creates a lower case Month name with the first character in Uppercase.
November 09, 2005, 08:14 PM
Noreen Redden
Francis is, of course, correct. The other way is to use your idea of the DEFINE, combined with Francis' EDIT to get rid of the slashes:

SET DEFCENT=19,YRT=50

-RUN

-SET &P_SDATE=EDIT(&&P_SDATE,'99$99$99');

DEFINE FILE fn

ESDATE/MtrDYY='&P_SDATE';
END
November 10, 2005, 12:16 PM
pruittlr
Thanks for the response. It's working now.
November 19, 2005, 10:23 PM
Vivian
You should consider the book almost 1001 Ways to Work with Dates in WebFOCUS...It will answer your questions on almost every kind of date transformation and date calculation. Comes with CD with all code on it. Check it out.
Regards,
Vivian
Publisher of books:
Focus Keysheet & WebFOCUS Keysheet


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com