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 am running the following fex in our test environment as we are upgrading from 7.7.02 to 7.7.03.
TABLE FILE CAR PRINT MODEL COUNTRY CAR ON TABLE SAVE AS CARTEST WHERE CAR='BMW' END
I get the following file layout
FIELDNAME ALIAS FORMAT LENGTH MODEL MODEL A24 72 COUNTRY COUNTRY A10 30 CAR CARS A16 48 TOTAL 150
In 7.7.02 I got. FIELDNAME ALIAS FORMAT LENGTH MODEL MODEL A24 24 COUNTRY COUNTRY A10 10 CAR CARS A16 16 TOTAL 50
I need my output file in this format still. How do I keep this the same? I have been told it is UTF-8 related but I am not an expert on this. If it is, then we do need this set on but it is impacting our existing code.
I hope someone can advise me on what to do.
Many thanks.This message has been edited. Last edited by: Kerry,
7.7.02, Linux PDF, HTML, Excel
Posts: 8 | Location: Newark, UK | Registered: June 07, 2011
TABLE FILE CAR PRINT MODEL COUNTRY CAR ON TABLE SAVE AS CARTEST WHERE CAR='BMW' END
Try ON TABLE SAVE AS CARTEST FORMAT ALPHA
0 NUMBER OF RECORDS IN TABLE= 6 LINES= 6 ALPHANUMERIC RECORD NAMED CARTEST 0 FIELDNAME ALIAS FORMAT LENGTH MODEL MODEL A24 24 COUNTRY COUNTRY A10 10 CAR CARS A16 16 TOTAL 50
Vivian Perlmutter Aviter, Inc.
WebFOCUS Keysheet Rel. 8.0.2 (Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2 Focus since 1982 WebFOCUS since the beginning Vivian@aviter.com
You can check the NLS settings in your WF environment with this command:
? LANG
Comparing the settings in your old and new WF environments will at least indicate whether something has changed in this area (e.g., code page settings).
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Jack. Tried that. No difference. Vivian. I now have the following: FEX
-* File CARTESTZ.fex APP FI CARTEST DISK ras_sa/cartest.ftm (LRECL 50 SET EXTHOLD=ON -RUN TABLE FILE CAR PRINT CAR.CARREC.MODEL CAR.ORIGIN.COUNTRY CAR.COMP.CAR WHERE CAR EQ 'BMW'; ON TABLE SAVE AS CARTEST FORMAT ALPHA END
OUTPUT
NUMBER OF RECORDS IN TABLE= 6 LINES= 6 ALPHANUMERIC RECORD NAMED CARTEST FIELDNAME ALIAS FORMAT LENGTH MODEL MODEL A24 72 COUNTRY COUNTRY A10 30 CAR CARS A16 48 TOTAL 150
Same result
Dan.
In carrying out our upgrade to 7.7.03, we changed this setting to 65001 - Unicode (UTF-8). In 7.7.02, this is not set. (Results seen in WebFOCUS Admin Console - NLS Settings). We had to change to UTF-8 because in 7.7.02 regional and special characters were causing FEXs to crash when the string was longer then 100 characters or something like that. IBI advised upgrade. Apparantly, this problem with UTF-8 and multiplying field lengths exists in 7.7.02 as well.
Using UTF8 triples characters regardless of version. But 7.7.02 has a bug in UTF8 coding which caused an error with regional\special characters. IBI advised an upgrade and the 7.7.03 version does not have the bug - all characters supported correctly, but has side-effects like we have encountered.
Unless we find a better solution, we are currently changing all FEXs that read or write external text files that interface to other systems. To do this, for reading records, we read the whole record into 1 field and then SUBSTR that field out into the actual fields in the FEX. For writing, we concatenate all fields into 1 field. The interfaces should then remain unaffected when reading the text files delivered, except the record length has tripled in size.
7.7.02, Linux PDF, HTML, Excel
Posts: 8 | Location: Newark, UK | Registered: June 07, 2011
I don't know exactly how you are "reading" the values from the SAVEd file, but it might be worth while taking a look at -READFILE because length specifications are not necessary.
TABLE FILE CAR
PRINT
CAR.CARREC.MODEL
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
WHERE CAR EQ 'BMW';
ON TABLE HOLD AS CARTEST
END
-*
-RUN
-READFILE CARTEST
-TYPE &MODEL &COUNTRY &CAR
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
The reading of the file is being carried out outside of Webfocus. Webfocus is just extracting the data and saving into a text file. The same situation occurs if Webfocus is reading a text file. It expects a 2 char field to be 6 chars in length. Also, you need to specify an lrecl or when reading the file it will read one rec and skip two recs. Annoying really. IBI looking into it but that was the middle of last week and still no solution, so progressing with the work around.
7.7.02, Linux PDF, HTML, Excel
Posts: 8 | Location: Newark, UK | Registered: June 07, 2011
Response from IBI is that this is normal behaviour for UTF-8, so my advice to all is be careful. All of your interfaces will have to be amended when reading from or writing to a text file to be used outside of Webfocus.
7.7.02, Linux PDF, HTML, Excel
Posts: 8 | Location: Newark, UK | Registered: June 07, 2011
My recollection is that (with some obvious restrictions) you can use MAINTAIN to read or write a fixed format file. If so, using a synonym with ACTUAL = AnnB you should be able to read and write ASCII files as required.This message has been edited. Last edited by: j.gross,
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005