Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Dialogue Manager DEFAULT "today's date"

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Dialogue Manager DEFAULT "today's date"
 Login/Join
 
Member
posted
Hello All,

First time poster here. I've done a lot of searching on the forums but can't solve my problem. I want to have the DEFAULT value for a date paramater to be today's date.

In dialogue manager, I tried many attempts but nothing works

I would assume something like this:
-DEFAULT &DATETO = &YYMD;

would return an actual date, but it doesn't.

Can anyone give me some tips?

Thanks,
Josh

This message has been edited. Last edited by: <Kathryn Henning>,




WebFOCUS 8004
Windows Server 2008 R2 Standard 64-bit
All Outputs
 
Posts: 14 | Registered: December 21, 2012Report This Post
Expert
posted Hide Post
Hi Josh,

Welcome to the forum.

Have you tried:

-DEFAULT &DATETO = &YYMD.EVAL ;


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Just curious but why won't this work?
-SET &DATETO=&YYMD;


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
Well, obviously because it would override any value that was entered through the parameter.

You can work around that with approaches like below, but frankly it's kind of annoying that -DEFAULT doesn't evaluate expressions.
-DEFAULT &DATETO = FOC_NONE;
-SET &DATETO = IF &DATETO EQ FOC_NONE THEN &YYMD ELSE &DATETO;


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Member
posted Hide Post
Thanks Wep5622 that did work. I don't think I would have got to that myself.

Waz - thanks but that suggestion didn't work. The procedure hung up when I tried. Maybe it works in some situations but not others?




WebFOCUS 8004
Windows Server 2008 R2 Standard 64-bit
All Outputs
 
Posts: 14 | Registered: December 21, 2012Report This Post
Expert
posted Hide Post
Josh,

What sub version of 7.6 are you using?

I've just run Waz's code on 7.6.11 and it works fine.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
I think you will find that -DEFAULT is processed prior to evaluating amper variables.

I think its logical as -DEFAULT prepares amper variables, i.e. default.

The .EVAL is the way around this, I have used it for years and its always worked.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
moi, aussi.
decades.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
quote:
Originally posted by Tony A:
Josh,

What sub version of 7.6 are you using?

I've just run Waz's code on 7.6.11 and it works fine.

T


Hi Tony and Waz. Sorry that signature is incorrect.

I am using WF 8004. Signature updated.




WebFOCUS 8004
Windows Server 2008 R2 Standard 64-bit
All Outputs
 
Posts: 14 | Registered: December 21, 2012Report This Post
Guru
posted Hide Post
Hi Josh Morel,

I have 8004, ran Waz's code and it works.

-DEFAULT &DATETO = &YYMD.EVAL ;
-TYPE &DATETO


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
Isn't the reason for that to work because the amper-variable contains the value &YYMD.EVAL though, and not the actual value of &YYMD (today: 20131202)?

With that in place, the amper-variable expression would get evaluated wherever the amper-variable gets used and it would appear to have set the default to the desired expression result.

I'm sure there are some cases where that distinction would actually matter, but I can't think of any right now, which makes it kind of hard to create a test-case to prove this one way or the other... Takers?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
amper-variable contains the value &YYMD.EVAL though


If you turn &ECHO on and run the code you will see that the .EVAL is evaluated before the -DEFAULT.

-SET &ECHO=ALL;

-DEFAULT &DATETO = &YYMD.EVAL ;



The ECHOed output is:

-SET &ECHO=ALL;
-DEFAULT &DATETO = 20131203 ;
-RUN


If you -TYPE the value you will see that the date is there, if it was the .EVAL you would see that instead.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
It is an interesting conundrum as to what the DEFAULT of &DATETO will contain with a &YYMD.EVAL.

Realistically, DEFAULT does not evaluate, it only holds what the value entered is. This is correct, as Wep5622 understands.

If you remove the .EVAL, then &DATETO will be &YYMD when seen.

So theoretically &DATETO contains &YYMD.EVAL, and when seen, with a -TYPE or any other DM function, will be the evaluated value. A bit like Hiesenberg's uncertainty principle. It is impossible to actually prove either way.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Consider this:

-DEFAULT &DATETO = &YYMD ;

-SET &DATETO = &DATETO | '.EVAL' ;

-TYPE &DATETO


Is this different to your assumption ?

I think the only way to prove this one way or another is to turn tracing on and check to see what actually happens.

I think what you will find is that if the .EVAL is part of the code and not the contents of the variable, it will be evaluated, if its part of the variable it will not.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Perhaps what happens could be made more obvious by comparing the performance of the assignment of a static value to whatever happens when this using .EVAL.

For example:
-DEFAULT &STATIC = 20131203;
-DEFAULT &DYNAMIC = &YYMD.EVAL;

-SET &DATETIME = HCNVRT(HGETC(10, 'HYYMDs'), '(HYYMDs)', 24, 'A24');
-TYPE Start looping dynamic assignment at: &DATETIME

-REPEAT :LOOP_DYN FOR &N FROM 1 TO 1000000;
-SET &X = &DYNAMIC;
-:LOOP_DYN
-TYPE Value: &X

-SET &DATETIME2 = HCNVRT(HGETC(10, 'HYYMDs'), '(HYYMDs)', 24, 'A24');
-TYPE End looping dynamic assignment at: &DATETIME2
-TYPE Start looping static assignment at: &DATETIME2

-REPEAT :LOOP_STT FOR &N FROM 1 TO 1000000;
-SET &X = &STATIC;
-:LOOP_STT
-TYPE Value: &X

-SET &DATETIME3 = HCNVRT(HGETC(10, 'HYYMDs'), '(HYYMDs)', 24, 'A24');
-TYPE End looping static assignment at: &DATETIME3


quote:

Start looping dynamic assignment at: 2013/12/03 11:05:35.940
Value: 20131203
End looping dynamic assignment at: 2013/12/03 11:05:44.018
Start looping static assignment at: 2013/12/03 11:05:44.018
Value: 20131203
End looping static assignment at: 2013/12/03 11:05:52.799


So, the dynamic DEFAULT took 8.781s, while the static DEFAULT took 8.958s.
Those values are close enough together that it doesn't look like that .EVAL gets evaluated each time in the loop. That would mean that the .EVAL is indeed evaluated when the DEFAULT value gets assigned.

However, it is possible that DM is smart enough to see that it can cache the value after the first eval in the loop, in which case the above doesn't mean much...


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Consider the order of processing of the following code.

e.g.
-SET &DEST = 'GOTO EVAL' ;

-&DEST.EVAL

-EXIT
-EVAL
-TYPE At Eval


You will note that the amper variable is eval'ed before the DM line interpreted.

Is there someone in IBI that could answer this question ?, does -DEFAULT set the amper variable to '&YYMD.EVAL' or &YYMD's contents.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Interpretation of a fex file proceeds serially (except as modified by -GOTO or -REPEAT).

when parsing
-DEFAULT &DYNAMIC=&YYMD.EVAL;


the .EVAL interrupts the process; "&YYMD.EVAL" is replaced by the character-string value stored in &YYMD (e.g., "20131203"), and then parsing of the resulting line

-DEFAULT &DYNAMIC=20131203;


resumes where it was interrupted (after the equal sign); when the end of the line is reached, the -DEFAULT is executed, setting &DYNAMIC to '20131203' (if its value had not previously been -SET).

That all happens after the prior lines are scanned and executed, and before any subsequent lines are considered.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Dialogue Manager DEFAULT "today's date"

Copyright © 1996-2020 Information Builders