Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Delete data out of focus database

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Delete data out of focus database
 Login/Join
 
Platinum Member
posted
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,


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Platinum Member
posted Hide Post
I'm sorry, I forgot to add that this database needs all of 2009 data to be deleted.
Thanks,

Joe


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
You will have to look up MODIFY FILE in the documentation - documentation on the Mainframe version of WebFOCUS would be your best bet.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You can also use an option of REBUILD to do a bulk delete.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Master
posted Hide Post
You could also use Maintain:

This is psuedo-code

MAINTAIN FILE
FOR ALL NEXT keyfields INTO STK
WHERE DATE = '2009'
FOR ALL DELETE keyfields FROM STK
END

Remember to make a back up of the data first.

Mark Derwin
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Thanks for your help.

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


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
Joe,

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, 2004Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
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, 2006Report This Post
Platinum Member
posted Hide Post
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:

FILENAME=WKLYGFOC,SUFFIX=FOC,$
SEGNAME=SEG01,SEGTYPE=S1,$
FIELDNAME=PPNUMBER, 0XX, A8,FIELDTYPE=I,$
FIELDNAME=FULLNAME, 001, A35,$
SEGNAME=SEG02,SEGTYPE=S2, PARENT=SEG01,$
FIELDNAME=WEEK_OF, 002, MDYY, FIELDTYPE=I,$
FIELDNAME=MARKETTEAM, 029, A40, $
FIELDNAME=ANSWERED, 003, I8C, $
FIELDNAME=AVGTALK, 004, I4, $
FIELDNAME=DNIN, 007, I5, $
FIELDNAME=DNOUT, 008, I6, $
FIELDNAME=MARKET, 009, A20, $
FIELDNAME=TEAM, 010, A20, $
FIELDNAME=TTLSTAFFED, 012, D9.2, $
FIELDNAME=WAITTIME, 013, D9.2, $
FIELDNAME=AUXPERCENT, 014, D8.2, $
FIELDNAME=UTILIZATION,015, D8.2, $
FIELDNAME=PTFT, 019, A1, $
FIELDNAME=ACWTIME, 025, I6, $
FIELDNAME=TOPSKILL, 026, A3, $
FIELDNAME=AVGHOLDTIME,027, I8, $
FIELDNAME=TRANSFERRED,028, I8, $

Thanks!


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Master
posted Hide Post
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, 2003Report This Post
Virtuoso
posted Hide Post
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, 2006Report This Post
Virtuoso
posted Hide Post
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, 2005Report This Post
Platinum Member
posted Hide Post
Thanks for all the suggestions. I will go ahead and constuct something and try to get this to work. I'll report back with the results. Thanks again!


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Delete data out of focus database

Copyright © 1996-2020 Information Builders