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.
The following code outputs a work file that is not the same as when I send it to HTML. When run to the screen, the COMPUTE column shows 4-35 for the 1st record as desired. When run to a file, the original field value is pre-pended to the 4-35 resulting in 34354-35.
Would someone mind testing my code to see if my code is wrong... ...or if I have a 7.6.7 problem...
APP PREPENDPATH IBISAMP APP FI DNL012H01 DISK BASEAPP/DNL012H01 TABLE FILE CAR PRINT COMPUTE R1B01/A8 = EDIT(WEIGHT,'$$$9-99'); AS 'TEST' COUNTRY CAR MODEL BODYTYPE SEATS DEALER_COST RETAIL_COST SALES LENGTH WIDTH HEIGHT WEIGHT WHEELBASE FUEL_CAP BHP RPM MPG ACCEL
ON TABLE NOTOTAL ON TABLE HOLD AS DNL012H01 FORMAT ALPHA END
File Output...
34354-35 ENGLAND JAGUAR V12XKE AUTO CONVERTIBLE 2 42002-00 ENGLAND JAGUAR XJ12L AUTO SEDAN 5 40000-00 ENGLAND JENSEN INTERCEPTOR III SEDAN 4 22412-41 ENGLAND TRIUMPH TR7 HARDTOP 2 20500-50 JAPAN DATSUN B210 2 DOOR AUTO SEDAN 4 22192-19 JAPAN TOYOTA COROLLA 4 DOOR DIX AUTO SEDAN 4 23053-05 ITALY ALFA ROMEO 2000 GT VELOCE COUPE 2 23203-20 ITALY ALFA ROMEO 2000 SPIDER VELOCE ROADSTER 2 25905-90 ITALY ALFA ROMEO 2000 4 DOOR BERLINA SEDAN 4 37007-00 ITALY MASERATI DORA 2 DOOR COUPE 2 25715-71 W GERMANY AUDI 100 LS 2 DOOR AUTO SEDAN 5 24004-00 W GERMANY BMW 2002 2 DOOR SEDAN 5 24004-00 W GERMANY BMW 2002 2 DOOR AUTO SEDAN 4 00-00 W GERMANY BMW 3.0 SI 4 DOOR SEDAN 5This message has been edited. Last edited by: bbollmann,
Brian Bollmann Spartan Light Metal Products WebFocus 7.6.4 / iSeries / WebSphere
Use SET HOLDLIST=PRINTONLY at the beginning of your procedure. The tells WF to only hold those items in the hold file that would also be displayed on the screen. So you won't get both the original AND the re-defined field.
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, 2007
One can use EDIT with a mask on a numeric field. Just know that the outcome is always alpha. See the following:
-* File bbollmann1.fex
DEFINE FILE CAR
SALES2/A3=EDIT(SALES,'999');
RCOST7/A3=EDIT(RCOST,'$$$$999');
END
TABLE FILE CAR
PRINT SALES SALES2 RCOST RCOST7
BY COUNTRY BY CAR BY BODY
END
COUNTRY CAR BODYTYPE SALES SALES2 RETAIL_COST RCOST7
------- --- -------- ----- ------ ----------- ------
ENGLAND JAGUAR CONVERTIBLE 0 000 8,878 878
SEDAN 12000 012 13,491 491
JENSEN SEDAN 0 000 17,850 850
TRIUMPH HARDTOP 0 000 5,100 100
FRANCE PEUGEOT SEDAN 0 000 5,610 610
ITALY ALFA ROMEO COUPE 12400 012 6,820 820
ROADSTER 13000 013 6,820 820
SEDAN 4800 004 5,925 925
MASERATI COUPE 0 000 31,500 500
JAPAN DATSUN SEDAN 43000 043 3,139 139
TOYOTA SEDAN 35030 035 3,339 339
W GERMANY AUDI SEDAN 7800 007 5,970 970
BMW SEDAN 8950 008 5,940 940
8900 008 6,355 355
14000 014 13,752 752
18940 018 14,123 123
14000 014 9,097 097
15600 015 9,495 495
This message has been edited. Last edited by: Danny-SRL,
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Brian, Darin is right. Because the compute uses a real field to calculate it's result, that real field is also retrieved from the database. When holding HTML this is an implicit noprint field. But when putting it into a hold file all fields used to create the result will be stored in the hold file. Unless you use SET HOLDLIST=PRINTONLY, or ON TABLE SET HOLDlIST PRINTONLY.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
If you can get your hands on a M/F focus manual of the 1980's, you will see that EDIT with a mask is said to also work on numeric fields. I hope that what is the the newer manuals is an omission, otherwise many legacy applications out there are going to suffer from a serious bout of upward compatibility.
Up till now - and during the last 25 years - there has never been a problem. But, of course, all that could change...
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
You can even use EDIT to convert from numeric to alpha, but there are differences between using EDIT and FTOA. With EDIT, it will treat a number as an integer and will not translate the decimal portion. EDIT also zero fills the number and can convert a number up to 9 digits. FTOA blank fills the new field and can convert up to 16 digits and will retain decimal values. You can also convert from an alpha to a numeric but the same restrictions apply.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
The issue doesn't really have anything to do with the EDIT function. How did we get there? He just wanted to know why he saw additional fields in his hold file that did not display in his report.
He's redefined a real field using the same name so the report only prints the column once, but when you ON TABLE HOLD it would hold both the original real field used in the DEFINE and the newly defined value. SET HOLDIST=PRINTONLY solves the problem.
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, 2007