Focal Point
Focus READ function

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1841096472

March 05, 2008, 03:34 PM
l-moore
Focus READ function
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
March 05, 2008, 03:39 PM
Francis Mariani
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
March 05, 2008, 03:53 PM
Spence
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.
March 05, 2008, 04:22 PM
Darin Lee
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
March 05, 2008, 05:37 PM
N.Selph
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)