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     WRITING A READING A DATE OUT OF AND INTO A REPORT

Read-Only Read-Only Topic
Go
Search
Notify
Tools
WRITING A READING A DATE OUT OF AND INTO A REPORT
 Login/Join
 
Member
posted
Hi. I am wanting to create a report that will be able to write a date out to a file and then read that date as a parameter the next time the report is run. Our University wants to keep track of addresses that are updated and I would like to input the last run date begin date in the report to keep from overlapping.

Anyone have experience with this?

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


767
Windows Vista
HTML, EXCEL
 
Posts: 5 | Registered: October 02, 2009Report This Post
Virtuoso
posted Hide Post
You could write your report's last run date doing something like this:

FILEDEF H_LAST_RUN_DATE DISK c:\h_last_run_date.txt
-RUN
DEFINE FILE CAR
TODAY_DT/A8 WITH CAR = '&YYMD';
END
TABLE FILE CAR
PRINT TODAY_DT
WHERE RECORDLIMIT EQ 1
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS H_LAST_RUN_DATE
END
-RUN


To read that from the same report or another one, you just need to -READ from the file:

FILEDEF H_LAST_RUN_DATE DISK c:\h_last_run_date.txt
-RUN
-READ H_LAST_RUN_DATE &LAST_RUN_DT.A8.
-* Check for errors and if none was found, do something with &LAST_RUN_DT ...



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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Caveat from the sample above: you will have to be careful in a multi-user environment where different request operations may be attempting to concurrently write/read from the file.

It would be preferable to maintain that information in a database table where actual transaction control exists.

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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Hmmm, borrowing from Tony and other contributors' ideas, you could actually -WRITE the date to the file instead of the more elaborate TABLE FILE request I had initially suggested:

FILEDEF H_LAST_RUN_DATE DISK c:\h_last_run_date.txt
-RUN
-WRITE H_LAST_RUN_DATE &YYMD


Much, much simpler.

Don't forget to always check for errors after your -WRITE and -READ operations!



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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
So what would this response indicate:
(FOC340) DIALOGUE MANAGER -WRITE FILE NOT ALLOCATED OR FILEDEF'ED

I would eventually like to put the file out on a server so that it will be available for multiple users.


767
Windows Vista
HTML, EXCEL
 
Posts: 5 | Registered: October 02, 2009Report This Post
Virtuoso
posted Hide Post
quote:

-WRITE FILE NOT ALLOCATED OR FILEDEF'ED


That's what the FILEDEF command in the example is supposed to do. You will have to adjust it to use a path and filename consistent to your environment.

This is an example of a file you'd create in a Unix environment:
FILEDEF H_LAST_RUN_DATE DISK /report_data/h_last_run_date.txt
-RUN


And please, don't forget to issue -RUN after the FILEDEF command, otherwise Dialer Manager's -WRITE won't "know" FILEDEF exists.



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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
We are presently having some sort of domain security issues that won't allow users to create a file locally or on a share drive. I'll update when this is resolved.


767
Windows Vista
HTML, EXCEL
 
Posts: 5 | Registered: October 02, 2009Report This Post
Member
posted Hide Post
Here is what I have discovered.

To write a date out of Webfocus while using Vista, we are required to run Developer Studio as Administrator. I tried logging in as Administrator and caught errors. Tried setting Internet Explorer to run, default as Administrator and still caught errors. It wasn't until I set Developer Studio to run default as Administrator that I was able to successfully write out of webfocus.

Thanks for your patience


767
Windows Vista
HTML, EXCEL
 
Posts: 5 | Registered: October 02, 2009Report This Post
Expert
posted Hide Post
A bit late but ... how about adding a LAST_UPDATED column to your data rows? Then you could just TABLE FILE filename BY HIGHEST 1 LAST_UPDATED to find out when the file was last updated.

One advantage is that it keeps the date with the file and not elsewhere.

If it is a multi segment FOCUS DB then you could add the field to the top segment when the data storage overheads would be less than having it on each row and the date would apply to the entire file (when the file was last updated) as opposed to each row.

If you get into the habit of adding fields like this (also LAST_UPDATED_BY etc.) then you will find that auditible trails of updated data become easier when some auditor says "how can you tell who updated that data and when?".

T

This message has been edited. Last edited by: Tony A,



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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     WRITING A READING A DATE OUT OF AND INTO A REPORT

Copyright © 1996-2020 Information Builders