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     [solved] prompting pre-calculated values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[solved] prompting pre-calculated values
 Login/Join
 
Guru
posted
Good morning, everyone.

I am comparing material costs between two given dates. I like to have the first date default to the latest date in a file as the "current date" and "previous date" will be all other dates in the file within the current fiscal year. If possible, allow some special dates such as "begining of the year", "last cost rollup date" or "previous updated date". These special values will be determined after user selection.
Not every date is saved in my file.

Here is my input screen:
Current Cost Date: 09/24/08 - (latest date in my file, display only)
Date Comparing to: "previous updated date"
"last cost rollup date"
"beginning of the month"
"beginning of fiscal year"
10/02/07
10/03/07
...
09/23/08 - (may be allow them to enter a date instead of scrolling down the drop down list box)

The dates I like to derive from is CCDATE in:

FILENAME=IT0307P, SUFFIX=DB2 ,
REMARKS='IT0307P - Rep Unit Top Level Cost Snapshots', $
SEGMENT=IT0307P, SEGTYPE=S0,
DESCRIPTION='IT0307P - Rep Unit Top Level Cost Snapshots', $
FIELDNAME=REPUNIT, ALIAS=REPUNIT, USAGE=A15, ACTUAL=A15,
TITLE='REP UNIT', DESCRIPTION='REP UNIT', $
FIELDNAME=CMATTL, ALIAS=CMATTL, USAGE=P21.8, ACTUAL=P10,
TITLE='Total Cur Mat TL', DESCRIPTION='Total Cur Mat TL', $
FIELDNAME=CCDATE, ALIAS=CCDATE, USAGE=P8, ACTUAL=P4,
TITLE='UPDATED,DATE', DESCRIPTION='UPDATED DATE', $
FIELDNAME=CCTIME, ALIAS=CCTIME, USAGE=A8, ACTUAL=A8,
TITLE='UPDATED,ITME', DESCRIPTION='UPDATED TIME', $


I have trouble constructing the display values in HTML.

I know this is not a new issue. I hope someone can help me on this. Thanks.


Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Guru
posted Hide Post
Looks like I have asked something impossible.

I changed my html to have 3 variables to make my life a little easier.

1) "current date" - I created a procedure to return the current date as the control values for the drop-down list box.
2) "special dates" in radio buttons
3) a text box for the 2nd date parm if user not to choose special dates.

My problem is that the procedure retuns blank value for the current date. When I run the proceudre by itself I got the date:
(I have trouble loading up the xml output generated from my procedure)

Does anyone know what is wrong?

Thanks.

Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Virtuoso
posted Hide Post
Hua

What do you mean by "the current date" ?

If that is "today" than the amper variable "&YYMD" should give you that default value.

If it is something from your database you can read that value with a small table request and put it in an amper value. But that will not be a dynamic field you can use in a simple way within a fex.
There is however a workaround.

Create that value and write it to an external file. Use that external file as an included piece of code.

The include file should look like

-DEFAULT &CCD='09222008';
-DEFAULT &LRD='09182008';
-DEFAULT &BOMD='09012008';
-DEFAULT &BOFY='04012008';


I'm not sure if this is what you needed, but it might help you a bit.

The Begin Of Month can also be calculated based on the current date with the formula "DATEMOV". Begin of the year to, begin of Fiscal year should be possible too, but is not a basic formula.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Guru
posted Hide Post
Frank,

Thanks for replying. I know I made things complicated.

I should be able to calculate the special dates once the control is pass back to my procedure.

The current date is the latest date in the file, which is not necessarily &YMD. I have a procedure to figure out this date from the file, but having trouble displaying this date on the HTML prompting.

Here is my code to return the latest date in the file:
SET HOLDLIST PRINTONLY
TABLE FILE IT0307P
SUM
'MAX.IT0307P.IT0307P.CCDATE'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD FORMAT FOCUS
ON TABLE SET HTMLCSS ON
END
DEFINE FILE HOLD
DSP_DATE/A8=EDIT(CCDATE,'$$$$99/99/') | EDIT(CCDATE, '$$99');
END
TABLE FILE HOLD
PRINT
'HOLD.SEG01.DSP_DATE'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET HTMLCSS ON
END

My intent to provide this date so that I don't have to validate the user-entered date against my file, because I'm not familiar with java scripts. I could have this date as hidden default but the user should know which date it is.


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Guru
posted Hide Post
The problem might have to do with "cache run time data" being unchecked. I tried to check it, and it wouldn't let me.


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Virtuoso
posted Hide Post
Hua

You are trying to create an XML file that only needs to hold the highest used date in your table?

And in that table it has a format of I8YYMD and you want to display it as 'MM/DD/YY' is that correct?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Guru
posted Hide Post
Yes.


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Virtuoso
posted Hide Post
in that case it can be done in one step

SET HOLDLIST=PRINTONLY
DEFINE FILE IT0703P
DF_START_DX/YYMD = DATECVT(CCDATE,'I8YYMD','YYMD');
DF_START_DT/MDYY = DATECVT(CCDATE,'I8YYMD','MDYY'); 
END
TABLE FILE IT0703P
SUM MAX.DF_START_DT
BY HIGHEST 1 CCDATE NOPRINT
ON TABLE PCHOLD FORMAT XML
END


I think that will create the proper hold file.

(I can not test it, have no focus software available at this moment.)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Guru
posted Hide Post
Frank,

Yours is much better codes than mine and is retruning the right date. I still have the same problem showing it on HTML.

Thanks.

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report This Post
Master
posted Hide Post
quote:
FIELDNAME=CCDATE, ALIAS=CCDATE, USAGE=P8, ACTUAL=P4,
TITLE='UPDATED,DATE', DESCRIPTION='UPDATED DATE', $


Your date is stored as a packed number. Remember that on the AS400 a P fieldtype is really packed. The first thing you will have to do is convert this back to a date. I don't think your edit will work. Try:
DEFINE FILE IT0703P
-* UNPACK THE DATE
CCDATE1/I8=CCDATE;
-* CONVERT IT TO A DATE (NEEDS TO USE THE STORED FORMAT EITHER YYMD OR MDYY)
CCDATE2/I8YYMD=CCDATE1;


-* FROM HERE YOU CAN USE EDIT OR DATECVT TO MANIPULATE
END


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Thank you Pat,

I took note of the date format.

My friend dhaggen pointed out that I need two values in the XML file, one for the display value and one for the return value.

Thank you everyone for helping me out!

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report 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     [solved] prompting pre-calculated values

Copyright © 1996-2020 Information Builders