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] Attaching a text file to a WHERE statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Attaching a text file to a WHERE statement
 Login/Join
 
Member
posted
I want to filter by a given set of account numbers. The unique set numbers about 4000. Can I attach a text/spreadsheet file to a WHERE statement so I can filter on those 4000 unique numbers? How do I do it?

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


WebFOCUS 7.6.4
Windows XP
 
Posts: 12 | Registered: June 17, 2008Report This Post
Expert
posted Hide Post
Documentation > Creating Reports With WebFOCUS Language > Selecting Records for Your Report > Reading Selection Values From a File

These two usage notes are important:

quote:
# For IF, the total of all files can be up to 32,767 literals, including new line and other formatting characters. Lower limits apply to fixed sequential and other non-relational data sources.
# For WHERE, the file can be approximately 16,000 bytes. If the file is too large, an error message displays.


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
Member
posted Hide Post
Here is the message I get when I used a WHERE statement:

WARNING: FILE (EOCs) IS EMPTY
...RETRIEVAL KILLED
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0


WebFOCUS 7.6.4
Windows XP
 
Posts: 12 | Registered: June 17, 2008Report This Post
Expert
posted Hide Post
You have to FILEDEF the file and it must be on the server:

FILEDEF SELECT1 DISK SELECT1.TXT
-RUN

-WRITE SELECT1 ENGLAND
-WRITE SELECT1 JAPAN

TABLE FILE CAR
SUM SALES
BY COUNTRY
IF COUNTRY EQ (SELECT1)
END


FILEDEF SELECT1 DISK SELECT1.TXT
-RUN

-WRITE SELECT1 ENGLAND
-WRITE SELECT1 JAPAN

TABLE FILE CAR
SUM SALES
BY COUNTRY
WHERE COUNTRY IN FILE SELECT1
END


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
Member
posted Hide Post
You can't see my files but this query gave the error message from before:

FILEDEF EOCS DISK EOCS.PRN

DEFINE FILE GLACCOUNTAMOUNTS
FIRST_TOKEN/A2 = GETTOK(ACCOUNTID, 25, 1, '.', 2, FIRST_TOKEN);
MID_TOKEN/A4 = GETTOK(ACCOUNTID, 25, -2, '.', 4, MID_TOKEN);
LAST_TOKEN/A4 = GETTOK(ACCOUNTID, 25, -1, '.', 4, LAST_TOKEN);
END

TABLE FILE GLACCOUNTAMOUNTS
SUM
CREDIT
DEBIT
BY FIRST_TOKEN
BY MID_TOKEN
BY LAST_TOKEN

WHERE DATETIME EQ DT(2010/09/30 00:00:00.000);
WHERE ACCOUNTCLASSTYPE EQ 'EXPENSE';
WHERE LAST_TOKEN IN FILE EOCS;

ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE PCHOLD FORMAT EXL2K
END

I didn't put single quotes around the data on the .PRN file believing them to be formated at text anyway.


WebFOCUS 7.6.4
Windows XP
 
Posts: 12 | Registered: June 17, 2008Report This Post
Expert
posted Hide Post
FILEDEF EOCS DISK EOCS.PRN


Since you do not provide an Application or Directory path, this FILEDEF allocates the file to the temporary directory.

My example might have been misleading - I was creating my filter file "on the fly", hence the temporary directory was OK. Your filter file already exists somewhere - you have to point the FILEDEF to it:

FILEDEF EOCS DISK d:\dir1\dir1a\EOCS.PRN

or

FILEDEF EOCS DISK baseapp/EOCS.PRN


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
Member
posted Hide Post
I did and I get the same answer.

FILEDEF EOCS DISK C:\IBI\APPS\USERFILES\EOCS.PRN

DEFINE FILE GLACCOUNTAMOUNTS
FIRST_TOKEN/A2 = GETTOK(ACCOUNTID, 25, 1, '.', 2, FIRST_TOKEN);
MID_TOKEN/A4 = GETTOK(ACCOUNTID, 25, -2, '.', 4, MID_TOKEN);
LAST_TOKEN/A4 = GETTOK(ACCOUNTID, 25, -1, '.', 4, LAST_TOKEN);
END

TABLE FILE GLACCOUNTAMOUNTS
SUM
CREDIT
DEBIT
BY FIRST_TOKEN
BY MID_TOKEN
BY LAST_TOKEN

WHERE DATETIME EQ DT(2010/09/30 00:00:00.000);
WHERE ACCOUNTCLASSTYPE EQ 'EXPENSE';
WHERE LAST_TOKEN IN FILE EOCS;

ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE PCHOLD FORMAT EXL2K
END


WARNING: FILE (EOCS) IS EMPTY
...RETRIEVAL KILLED
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0


WebFOCUS 7.6.4
Windows XP
 
Posts: 12 | Registered: June 17, 2008Report This Post
Expert
posted Hide Post
The C drive must be on the reporting server.


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
Expert
posted Hide Post
Are you able to read aline from the EOCS file with the commands

-READ EOCS &Line.A10.
-TYPE &Line


If you get an error, then perhaps the file is not in this location.

This assumes each line in the file is at least 10 chars long.

You could also try doing a directory listing of C:\IBI\APPS\USERFILES\ in the program to see if the file exists.


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
Member
posted Hide Post
OK, I found my problem. The query was reading off the server and the filedef was pointing to my local. I had to copy the file to the server and then do the filedef. Thanks for your help!


WebFOCUS 7.6.4
Windows XP
 
Posts: 12 | Registered: June 17, 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] Attaching a text file to a WHERE statement

Copyright © 1996-2020 Information Builders