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] Reading from a file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Reading from a file
 Login/Join
 
Guru
posted
I've got a simple problem but haven't done this often enough to know what all the issues are. I wouldn't ask if I wasn't up against a deadline.

I need to read a string from a text file. The string is 20100130. It's the only thing in the file. I've done something similar ON TABLE

I'm sure there are extra things that must be done when reading a file from scratch, but I'm not sure what they are. I've read lots of posts this morning, so far, they provide examples of the READ right after a ON HOLD. I haven't found anything (not sure if it's different) that speaks to using an existing file.

ON TABLE TABLENAME
PRINT FIELD
HOLD AS TEMPNAME FORMAT ALPHA
END
-RUN
-READ TEMPNAME &TEMVAR.A8.


The above works just fine, this is the first time I've tried to read an existing file. Heres what I have so far:
APP FI MAXPOST DISK guidedbi/bi_max_post_date.txt

-READ MAXPOST &MAXDate.A8.
-? &MAX
-EXIT

I get this error message:
0 ERROR AT OR NEAR LINE 3 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC339) DIALOGUE MANAGER -READ FAILED: CHECK FILEDEF OR ALLOCATION FOR: -READ MAXPOST &MAXDate.A8.

Any help would be appreciated.

This message has been edited. Last edited by: Kerry,
 
Posts: 291 | Location: Greater Cincinnati  | Registered: May 11, 2005Report This Post
Virtuoso
posted Hide Post
Try adding -RUN right after APP FI ... You can then attempt to -READ from it.

Is "guidedbi" a defined application path in your environment?

-Neftali.



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
Guru
posted Hide Post
Yes, guidedbi is in APP SHOWPATH
 
Posts: 291 | Location: Greater Cincinnati  | Registered: May 11, 2005Report This Post
Guru
posted Hide Post
-RUN worked. Thanks so much.
 
Posts: 291 | Location: Greater Cincinnati  | Registered: May 11, 2005Report This Post
Virtuoso
posted Hide Post
You may also try substituting FILEDEF for APP FI. I always use the former since it allows to map files not only to application paths under "approot" but also to any physical location.

This should have the same effect as APP FI:
FILEDEF MAXPOST DISK quidedbi/bi_max_post_date.txt


or, in case you need access to a file sitting "anywhere" that is neither a directory under approot nor a mapped directory:

FILEDEF MAXPOST DISK C:\DataFiles\bi_max_post_date.txt


Don't forget the -RUN statement right after the file mapping and before -READ.

Hope that helps!
- Neftali.



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
Expert
posted Hide Post
Neftali, you can use the APP MAP command to map to alternate file locations.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Thanks Ginny! I use APP MAP in production reports when there is a need for accessing content outside the regular approot location, that is, until I manage to convince the WF administrator to map those locations directly in the global or user profiles in the Reporting Server.

For a "quick" solution and out of laziness I've taken the not-so-good practice of using FILEDEF to hard-wire the file location there.

You're point is very valid Ginny and using APP MAP should be the way to go for the sake of keeping code that is clean and most importantly maintainable.



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
Expert
posted Hide Post
And modern. Smiler


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Very Smiler


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 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     [SOLVED] Reading from a file

Copyright © 1996-2020 Information Builders