Focal Point
[CLOSED] Reformat Calendar Prompting Results

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

August 27, 2020, 09:27 AM
Doug
[CLOSED] Reformat Calendar Prompting Results
We use the following -SET command in a lot in our fexes to prompt the user for a date, and they seem to like the calendar prompt.

-SET &START_DT = &START_DT.(|FORMAT=YYMD).Select Start Date.QUOTEDSTRING;

However, the problem is the resulting date value is formatted like this: ‘August 26 2020’ which is nice for display, but not for screening within the WHERE statements or DM Commands like DATEADD, etc or other dialogue manager friendly for other functions like DATECVT, DATEMOV, etc.
Do you know of a way to change the format returned by the calendar, such as the YYMD format?
We’ve discovered defines work to convert it, but we need to convert it in DM and not a fex.
Thanks, Doug

This message has been edited. Last edited by: Doug,




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
August 27, 2020, 12:41 PM
Tom Flynn
Hey Doug,
Here's the LONG way - lol:

  
-SET &ALPHA_DT = 'August 26 2020';
-SET &GET_MONTH = GETTOK('&ALPHA_DT.EVAL', &ALPHA_DT.LENGTH, 1, ' ', 9, 'A9');
-SET &MTH_OUT =   DECODE &GET_MONTH (
-                 'January'   '01'
-                 'February'  '02'
-                 'March'     '03'
-                 'April'     '04'
-                 'May'       '05'
-                 'June'      '06'
-                 'July'      '07'
-                 'August'    '08'
-                 'September' '09'
-                 'October'   '10'
-                 'November'  '11'
-                 'December'  '12');

-SET &FMT_YYMD  = GETTOK('&ALPHA_DT.EVAL', &ALPHA_DT.LENGTH, 3, ' ', 4, 'A4') || 
-                 &MTH_OUT ||
-                 GETTOK('&ALPHA_DT.EVAL', &ALPHA_DT.LENGTH, 2, ' ', 2, 'A2');
-TYPE &FMT_YYMD
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 27, 2020, 02:55 PM
Doug
Thanks Tom... But, is there a way to change what the calendar actually outputs? Like, in good ol' days of the 'Calendar Control' settings in the 'HTML Composer'?
August 27, 2020, 03:02 PM
Tom Flynn
Sorry Doug, I did while at Fordham w/App Studio.
There was definitely a way to format the output.
Don't have that anymore - using Dev Studio.


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 27, 2020, 03:20 PM
Doug
NP Tom, Another one (feature) bites the dust...
August 27, 2020, 03:40 PM
Doug
I was also told that "If the fields are correctly and consistently typed in the metadata this manipulation becomes moot." So, it's all about Synonyms... I hope.
August 31, 2020, 09:06 AM
jgelona
Tom, I'm not the last person still using Dev Studio? (I could use App Studio but I don't like it at all).


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
August 31, 2020, 10:32 AM
Tom Flynn
Hey John,
LOL!!! Nope, there are a few of us left - personally, adapted to it for a few years.
Now in my LAST job, and, it's more of a SQL shop with WebFOCUS generating the output...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe