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 a web interface that accepts multi-row adhoc data, mostly pasted from Excel by the users. A webfocus program then processes and loads the data into the database.
Currently I am using -WRITE within a loop to manually create the webfocus dataset, and it's working fine. Is there a better way, or a standard webfocus command that would create dataset off adhoc data?
Thanks!This message has been edited. Last edited by: bug,
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005
Note: the create file, will wipe the data each time, but comment that will only append new data too it.
-SET &FN = 'foccache/TestFile';
-*Create new db from sample db source. Not using any columns from the sample source, we will
-*generate new columns based on computes. The SET HOLDLIST=PRINTONLY above will ignore all NOPRINT columns.
-*NOTE: BY CAR NOPRINT is required, because at least 1 column must be within the query or it will error. :(
-TYPE &FNSource was found and will be used to generate new DB - &FN.EVAL.foc
TABLE FILE CAR
BY COMPUTE SOFTWAREVERSION/D9.3 = 1.000;
BY COMPUTE RELEASEDATE/M-D-YY = '01-01-2015';
BY COMPUTE ENVIRONMENT/A50V = 'Development';
BY CAR NOPRINT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS &FN FORMAT XFOCUS INDEX SOFTWAREVERSION
END
-FOUND
-*CREATE FILE will wipe all data from exists db, while MODIFY FILE populates the db with information stored in DATA.
-TYPE Generating data for - &FN.EVAL.foc
CREATE FILE &FN
MODIFY FILE &FN
FREEFORM SOFTWAREVERSION RELEASEDATE ENVIRONMENT
DATA
1.002,'01-01-2015','Development',$
1.003,'02-01-2015','Development',$
1.004,'03-01-2015','Development',$
1.005,'04-01-2015','Development',$
1.006,'05-01-2015','Development',$
END
-*Return all data from table.
TABLE FILE &FN
PRINT
*
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
-RUN
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
This is it! I remember seeing "CREATE" and "FREEFORM" somewhere, and this is a good example.
One more question: is it possible to specify the data type and/or create a MASTER FILE on the fly (in the fex program)? Here it seems the master file was created during the TABLE FILE CAR query.
Thanks Gavin!This message has been edited. Last edited by: bug,
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005
Another option is to build a master description, either permanently or in-line in the focexec, to read your adhoc data. Then simply use a TABLE FILE with the HOLD command below to create the FOCUS file in the desired app folder. No MODIFY is necessary and this will always overwrite any existing FOCUS file and its master description.
ON TABLE HOLD AS <appname>/<filename> FORMAT FOCUS/XFOCUS INDEX <fieldname>
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Hi Dan, can you elaborate how to build a master description on the fly? Thanks.
quote:
Originally posted by Dan Satchell: Another option is to build a master description, either permanently or in-line in the focexec, to read your adhoc data. Then simply use a TABLE FILE with the HOLD command below to create the FOCUS file in the desired app folder. No MODIFY is necessary and this will always overwrite any existing FOCUS file and its master description.
ON TABLE HOLD AS <appname>/<filename> FORMAT FOCUS/XFOCUS INDEX <fieldname>
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005
TABLE FILE CAR
SUM DEALER_COST/P8.2C AS 'TOTAL_DEALER_COST'
RETAIL_COST/P8.2C AS 'TOTAL_RETAIL_COST'
BY COUNTRY AS 'BY_COUNTRY'
BY CAR AS 'BY_CAR_NAME'
BY MODEL AS 'BY_CAR_MODEL'
ON TABLE HOLD AS BASEAPP/NEWMASTER FORMAT FOCUS INDEX COUNTRY CAR MODEL
END
It generates a new master file called NEWMASTER having the same name and definition as describe in the TABLE FILE code.
MartinY, your approach requires an existing data source. In my case, user can post different number of columns, and the data type is not known until data is received. What I need is to create a master file on the fly when a user uploads the data.