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.
Hello, I have an old FOCUS database that needs to be updated. I'm not familar with updating and deleting records out of a Focus Database. Is this possible?This message has been edited. Last edited by: Kerry,
I used this, however it will delete all records both 2008 and 2009 related to ppnumber in the entire file within the date criteria. I want to delete only PPNUM at the date level criteria. I still want the PPNUM records with the other dates.
MAINTAIN FILE Wklygfoc -* Read records to delete into stack. FOR ALL NEXT PPNUMBER INTO STK WHERE WEEK_OF EQ '03/01/2009'; TYPE " -* Delete all records from stack. FOR ALL DELETE PPNUMBER FROM STK ; TYPE "ERROR: END
I would add that any suggestions you find here are used at your own risk. As Mark suggested, take a back-up of the file before you start.
To reiterate the point, you use what is suggested here at your own risk.
With that out of the way ....
To use MAINTAIN you should ensure that you are licensed correctly - it's an additional cost product.
Using the REBUILD function will reorganise your data, thus keeping it in it's most efficient state. Don't forget that you can also use REBULD, REORG, DUMP and then LOAD to achieve your goal.
REBUILD, REBUILD with selection criteria actually performs a pseudo data extract, dumping the data into a temporary file. The FOCUS file is then deleted and created afresh before the data is reloaded. You could perform a similar function yourself to help you understand it better, however, with a multi segment file you need to ensure your extract uses key fields to ensure correct summations and ordering etc.
One final thing, if you don't know the product then try and learn more than the fundementals about it first. If you end up deleting more than you intended you can only blame yourself!!
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
Another possibility is to first create a table requests that lists all the records you want to delete. You can then first visually check the records to ensure that those indeed are the records to delete. It also gives you the possibility to narrow or widen your asearch criteria, before anything gets altered in your database. When the request is correct, add ON TABLE HOLD FORMAT ALPHA to it. Then use this hold file as input to either maintain or modify to delete the records. For modify it would be something like:
MODIFY FILE FOCUSFILE
FIXFORM FROM HOLD
MATCH keyfields
ON MATCH DELETYE
DATA ON HOLD
END
And for maintain, see previous posts.
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
A further point to take into consideration would be if your FOCUS file is a multi-path hierarchy. If this is the case, I would go with Gerard's suggestion (GamP). You will need one table request for each path, if not for each segment.
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
Thanks for all suggestions. I do have the data backup no problem. I'm cleaning up some of our reporting and this particular report stored data in a FOC database. I did not create it and I'm not too familar with master files and segments - but I'm using this particular issue as a learning exersice. Here is the Master file layout:
With Maintain you delete from the lowest level. Also, do you want ALL the dates for 2008? Then you would do this:
MAINTAIN FILE Wklygfoc FOR ALL NEXT PPNUMBER WEEK_OF INTO STK WHERE WEEK_OF GE '01/01/2008' AND WEEK_OF LE '12/31/2008' FOR ALL DELETE PPNUMBER WEEK_OF FROM STK END
That should do it.
Mark
Posts: 663 | Location: New York | Registered: May 08, 2003
If you did not purchase MAINTAIN, revert to TABLE and MODIFY:
TABLEF FILE WKLYGFOC
IF WEEK_OF FROM '01/01/2008' TO '31/12/2008'
PRINT PPNUMBER WEEK_OF MARKETTEAM
ON TABLE HOLD
END
MODIFY FILE HOLD
FIXFORM FROM HOLD
MATCH PPNUMBER
ON MATCH CONTINUE
ON NOMATCH REJECT
MATCH WEEK_OF MARKETTEAM
ON MATCH DELETE
ON NOMATCH REJECT
DATA ON HOLD
END
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
I notice the ALIAS values are all numeric; that's odd, and could be dangerous -- will WF interpret 001 as an integer, or as a reference to FULLNAME?
In any event, here's a Modify equivalent to Mark's Maintain code:
-* hold the keys for segments to be deleted
TABLEF FILE WKLYGFOC
PRINT
PPNUMBER
WEEK_OF MARKETTEAM
WHERE WEEK_OF GE '01/01/2008';
WHERE WEEK_OF LE '12/31/2008';
ON TABLE HOLD AS DEL
END
-* summarize
TABLE FILE DEL
WRITE
CNT.MARKETTEAM
FST.PPNUMBER
FST.MARKETTEAM
BY WEEK_OF
ON TABLE SUMMARIZE
END
-* delete the lower-segment instances
MODIFY FILE WKLYGFOC
FIXFORM FROM DEL
MATCH PPNUMBER
ON NOMATCH REJECT
ON MATCH CONTINUE
MATCH WEEK_OF MARKETTEAM
ON NOMATCH REJECT
ON MATCH DELETE
DATA ON DEL
END
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005