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.
I have created a 1-record hold file and need to load its field values into variables. This is an MRE, and I'm having difficulty getting -READ to work. Evidently I need some assistance with either APP HOLD, APP FI, or FILDEF.
Please advise.
Thank you,
John
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006
I found the following example in another topic, and it worked fine: TABLE FILE CAR PRINT MAX.CAR ON TABLE HOLD END -RUN -READ HOLD &CAR.A16 -TYPE Car: &CAR
The problem is when trying to load into more than one variable: TABLE FILE CAR PRINT MAX.CAR MIN.CAR ON TABLE HOLD END -RUN -READ HOLD &CAR1.A16, &CAR2.A16 -TYPE Car: &CAR1.A16, &CAR2.A16
Why does this not work?
Thanks,
John
WF 7.7.03, Windows 7, HTML, Excel, PDF
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006
The likely reason that your initial attempt did not work, is that you did not put -RUN after your table request before your -READ statement.
Because -READ is dialogue manager it is executed in a pre-process situation (almost) and therefore you need to ensure that the table request is executed beforehand. The -RUN executes the stack that has been built upto that point and therefore ensures that the temp file is available to it.
Incidently, unless you want to run a table request against the temp file, use SAVE instead of HOLD as no master file description is created for it and the default save format is alpha. If you HOLD numeric data without specifying a format (e.g. ON TABLE HOLD FORMAT ....) the data will be held as internally formatted data which you will not be able to read properly using your -READ.
Now, the reason that your example is giving you JAGUAR, JAGUAR is that you are using PRINT where each row will be read and printed. You should notice that you get 10 rows of output into your temp file and each one relates to a CAR segment. If you use SUM instead then you will get only one line of output and also the result that you expect -
Car: Triumph, Alfa Romeo
TABLE FILE CAR
SUM MAX.CAR MIN.CAR
ON TABLE SAVE
END
-RUN
-READ SAVE &CAR1.A16, &CAR2.A16
-TYPE Car: &CAR1.A16, &CAR2.A16
T
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, 2004