Focal Point
[CLOSED] Date Conversion in Global Variable

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

February 02, 2012, 11:13 AM
ColdWhiteMilk
[CLOSED] Date Conversion in Global Variable
I have a global "SET" variable equal to '20100802', that now I'm trying to create a new global variable of '2010-08-02', and pass it to a web service as HYYMDm

Is the best solution to use the code below?

-SET &SMARTGOLIVE2 = DATECVT('2010-08-02', 'A10YYMD', 'HYYMDm');

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


Production - 7.6.4
Sandbox - 7.6.4
February 02, 2012, 01:24 PM
Dan Satchell
Function DATECVT cannot be used to create date-time values. I think function HINPUT is probably what you are looking for. By the way, "global" variables have two ampersands (ex. &&SMARTGOLIVE2) and local variables have just one ampersand.

EDIT: It just occurred to me that date-time functions like HINPUT probably don't work in Dialogue Manager. You may need to do the conversion inside a TABLE request or as a DEFINE function.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
February 02, 2012, 02:09 PM
ColdWhiteMilk
I guess I'm not asking this correctly.

Right now, I have:

-SET &SMARTGOLIVE = DATECVT('20100802', 'I8YYMD', 'I8YYMD');


I need the resulting value of &SMARTGOLIVE to be 2010-08-02, but be in HYYMDm format so that it can be passed to a web service parameter that is expecting that format.


Production - 7.6.4
Sandbox - 7.6.4
February 02, 2012, 03:00 PM
njsden
See this:

-DEFAULT &MYDATE = '20120802';
-SET &SMARTGOLIVE = HINPUT (8, &MYDATE, 12, 'HYYMDm');
-SET &DATEBACK = HCNVRT (&SMARTGOLIVE, '(H23)', 23, 'A23');

-TYPE Original: &MYDATE
-TYPE HYYMDm native format: &SMARTGOLIVE
-TYPE HYYMDm "human" format: &DATEBACK



Dialogue Manager can handle those data types but does your web service really expect the parameter in "native" format?

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.