Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Go
New
Search
Notify
Tools
Reply
  
Focus READ function
 Login/Join
 
Member
posted
Trying to use the read function to read a record from a file and use it as a parameter. There is one line in the file and it is 6 characters long. I also tried using a ( RECL 80 RECFM V spec on the FILEDEF, but no go. Here is what I have.

FILEDEF TERM DISK /export/home/issjy/data/term.ftm

-READ TERM &TERM1.A6.

TABLE FILE MYTABLE
PRINT COLUMN1
COLUMN2
IF COLUMN3 EQ &TERM1
ON TABLE HOLD AS MYTERMSTUFF FORMAT ALPHA
END

Looks simple but I'm list here
 
Posts: 5 | Registered: June 12, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
What OS are you on? I assume it's UNIX. Is your path correct?

Add a -RUN after the FILEDEF. FILEDEF will not execute before the -READ beacuse all Dialogue Manager commands execute before non Dialogue manager commands, unless a -RUN in encountered.

Add
-TYPE &TERM1
to see if the value was successfully read into the variable.


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, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
If you are trying to filter against a value stored in an external file you can do that without a –READ.
Use IN FILE - Selects records based on values stored in a sequential file.
You still need to filedef the external file.

WHERE COLUMN3 IN FILE TERM;


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I would definitely try Francis' suggestion first. That should do the trick. Spence's suggestion would also work and is an easy workaround in case you can't get it to work, but it would not be as efficient. I think it would have to keep reading the external file (TERM) over and over with each record - but I'm not sure of the internall processing WF uses for the IN FILE functionality. Additionally, the selection criteria could not be passed directly to the DBMS because of this, but using the &var it could.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Guru
posted Hide Post
You need a
-RUN
after the FILEDEF, before the -READ.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Reply With QuoteReport This Post
  Powered by Social Strata  
 


Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.