Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Full Date Conversion
Go
New
Search
Notify
Tools
Reply
  
[Solved] Full Date Conversion
 Login/Join
 
Platinum Member
posted
Is there a way to take a date like:

May 25, 2018

and convert it to YYMD or MDYY in WF8105 dialogue manager? I feel like there should be an easy way to do this but for the life of me i can't seem to get the function right.

Thanks for the help!

This message has been edited. Last edited by: Tim P.,


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
 
Posts: 141 | Location: Mclean, VA | Registered: December 04, 2012Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You'll have to decompose all the components using character functions first, and then assemble them into the YYMD. This would involve DECODE of the Month into the 2 digit month number. I'd start with SUBSTR and go from there.

How bad do you need this? It's a lot of code.


WebFOCUS 8206, Unix, Windows
 
Posts: 1660 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
yea decomposing the date and the concantenating it back together was about the only way i got close to what i needed.

It's not critical right now as i'm just fiddling around in the new 8203 portal page designer. If your content is driven by a date parameter, the control is predicated on that parameter but the default format in the control is as above and i don't see a way to change it.


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
 
Posts: 141 | Location: Mclean, VA | Registered: December 04, 2012Reply With QuoteReport This Post
Gold member
posted Hide Post
FOCUS has supported something called "natural dates" (constants) from forever, but to my knowledge this is not exposed in a user function. The code below will work on most platforms:

-DEFAULTS &INDATE = 'Jan 1, 2018' ;
FI MYFEX DISK myfex.fex (LRECL 80
DEFINE FILE CAR
MYDT/YYMD WITH COUNTRY = '&INDATE' ;
MYA/A8YYMD = MYDT ;
ACMD/A80 = '-SET ' | '&&' | 'WOW=' | '''' | MYA | '''' | ';' ;
END
TABLE FILE CAR
PRINT ACMD
IF RECORDLIMIT EQ 1
ON TABLE SAVE AS MYFEX
END
-RUN
EX MYFEX
-RUN
-TYPE DATE IS &&WOW
-EXIT


Once you have the global variable &&WOW, you can use any of the date functions from dialog mgr to get any date you want.


IBI Development
 
Posts: 57 | Registered: November 15, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Yea it looks like using the car file (or any other small temp table) may be the only way. I was kind of hoping for a solution that didn't involve bringing in a table but oh well.
Thanks for the help!


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
 
Posts: 141 | Location: Mclean, VA | Registered: December 04, 2012Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This could be a way to go:
 

-DEFAULT &Date1 = 'May 25, 2018';

 DEFINE FUNCTION TODATE(null/I1)
 DTEMDYY/MDYY = '&Date1';
 TODATE/A8MDYY = DTEMDYY;
 END
-RUN

-SET &Date2 = TODATE(.);
-TYPE &Date1 --> &Date2  


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 137 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Full Date Conversion

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.