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.
FI CFILE DISK E:\data\cntry.dat -RUN -READ CFILE &TRSH.A10. &CNTRY.A10. -* File CARCO.FEX TABLE FILE CAR PRINT COUNTRY CAR WHERE ( COUNTRY EQ '&CNTRY' ); END
hth,
drew
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003
-* File CARCO.FEX FI CFILE DISK C:\ISMDR\COUNTRY.DAT -RUN -READ CFILE &TRSH.A10. &CNTRY.A10. -* TABLE FILE CAR PRINT COUNTRY CAR WHERE ( COUNTRY EQ '&CNTRY' ); END
I get this error:
0 ERROR AT OR NEAR LINE 9 IN PROCEDURE MEMFEX FOCEXEC * (FOC295) A VALUE IS MISSING FOR: CNTRY
Is there some way to see if I am getting the correct data in &CNTRY?
Regarding the wanting to get the variable from a file. Is the only record in the file the value you want? If so if you filedef the file and then do a selection
filedef cntry ..... Table file car if country eq (cntry) ....
This is the method I use to find a set of items usually student records in my case, but you would get all of the 'car' entries in the cntry file so if you had japan and england in the file you would get all cars in japan and england.
Of course I may be completely missinterpreting what you want to do here.
Leah C.
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
First, I would like to thank both Drew and Leah for their suggestions and answer both of them at the same time.
Leah, I do only have 1 record with the country in it, but it's not in the first 10 positions of the record. The real file (I am using the CAR file just to see if I can get this to work) is a sequential file on the mainframe with the search criteria in positions 21 - 29.
Drew, if I run this:
-* File CARCO.FEX FILEDEF CFILE DISK C:\ISMDR\COUNTRY.TXT -RUN -READ CFILE &TRSH.A10.,&CNTRY.A10. -TYPE trash = &TRSH country = &CNTRY END
I get a message:
(FOC295) A VALUE IS MISSING FOR: TRSH
which would seem to indicate that there is something wrong with my file definition. I do have a sequential file defined on the mainframe which I eventually want to read if that would simplify things.
Please remove the comma (,) from your read statement.
Is the file C:\ISMDR\COUNTRY.TXT on the (windows) reporting server? or are you doing this from developer? If your webfocus is on the mainframe; then we need to define the file in a different way to webfocus.
I created a file on my (windows) reporting server with the contents :
Interesting.... This code: FI CFILE DISK C:\ISMDR\COUNTRY.DAT -RUN -READ CFILE &TRSH.A10. &CNTRY.A10. -TYPE trash = &TRSH shows: trash = 1234567890
This code: FI CFILE DISK C:\ISMDR\COUNTRY.DAT -RUN -READ CFILE &TRSH.A10. &CNTRY.A10. -TYPE country = &CNTRY shows: (FOC295) A VALUE IS MISSING FOR: CNTRY
which seems to indicate that I can read the file which is defined on the C: drive of the Test Server, but can't read 2 fields. I changed the type of the file from TXT to DAT to see if that made a difference, but eventually I would like to read a mainframe file that is defined to WebFocus if it's cleaner to skip the distributed file altogether.
Amazingly simple once you know the answer. Since I have FRANCE in my country field, I changed the second definition from A10 to A6 and it runs like a champ. Thank you very much.
Now, can I point this to a mainframe file? (I don't want to get greedy here - you've gotten me a long way down the road).
You need to have the file you are going to read available to the reporting server. Do you have the reporting server running on your mainframe where the file is? or what is your setup?
regards,
drew
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003
Then there are a few ways you could go; like using join with ALL=OFF or match file to select only the inner join data (OLD AND NEW). But I would think a simple approach might be:
TABLE FILE SEQT3 PRINT CNTRY ON TABLE SAVE END -RUN -IF &LINES EQ 0 GOTO ... ; TABLE FILE ... PRINT ... WHERE COUNTRY IN FILE SAVE ...
Please make sure that the format for the field from the first (mainframe) file CNTRY is identical to the format of COUNTRY; if not, change it to be so with a define.
This would also allow for multiple CNTRY values. (within the FOCUS limits for files to be used with WHERE)
hth,
drew
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003