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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
UPDATE Records
 Login/Join
 
Platinum Member
posted
Help! I'm new to focus. I need to update a focus database. What I neeed to do seems basic? How do you for example update all records in field team that contain "night A" to "night b". I've been stuck for days. In Access this is a simple update query. Any example files that anyone can send me. Thanks,


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
In order to physically update the records,
you need to use the MODIFY command
so, best to download and read the MODIFY manual.
Its pretty straight forward.
You can temporarily redefine a field, withoug physically updating the records using a DEFINE
either in the master or in your fex
DEFINE FILE filename
MYFIELD/A20=IF MYFIELD CONTAINS 'night A' THEN 'night B' ELSE MYFIELD;
END
This approach just redefines the value for reporting purposes, without physical change.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Master
posted Hide Post
Joe
We have a product called Maintain. This product allows for easy Updates, Includes and Deletes. It is available in WebFOCUS and on the Mainframe. To do what you want, create a new procedure or Focexec. As long as the field is not a key field, updating is no problem.

MAINTAIN FILE
FOR ALL NEXT field1 INTO STK
WHERE field2 EQ 'night A'
COMPUTE I/I2=1;
REPEAT STK.FOCCOUNT
COMPUTE STK(I).field2 = 'night B';
COMPUTE I=I+1;
ENDREPEAT
FOR ALL UPDATE field2 FROM STK;
END

That's it. Here, file is the name of your file, field1 is the key field in the segment and field2 is the field that we are updating. I hope this helps.

Mark

This message has been edited. Last edited by: Maintain Wizard,
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
<DocServices>
posted
MODIFY is documented in the following manual:
FOCUS for Mainframe Maintaining Databases 7.3 (DN1001059.1003).
 
Report This Post
Platinum Member
posted Hide Post
Thanks, but I found out that Marketteam is unique and will not work. However, I think what I should do is the following:

TABLE FILE WKLYGFOC

BY PPNUMBER
BY WEEK_OF
BY MARKET
BY TEAM
WHERE WEEK_OF EQ '4/30/2006'
ON TABLE HOLD AS WGPJUNK
END


MAINTAIN FILE WKLYGFOC
FOR ALL NEXT WEEK_OF INTO STK
WHERE MARKET EQ 'Night'
WHERE TEAM EQ 'A'
COMPUTE I/I2=1;
COMPUTE I/I2=2;
REPEAT STK.FOCCOUNT
COMPUTE STK(I).MARKET = 'New';
COMPUTE STK(I).TEAM = 'Night Team';
COMPUTE I=I+1;
COMPUTE I=I+2;
ENDREPEAT
FOR ALL UPDATE MARKET FROM STK;
FOR ALL UPDATE TEAM FROM STK;
END

I need to update the field Market and the field team which are not unique. When I run this code I receive an error message. Any other help would be appreciated.

Thanks,


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
Do you have a license for the MAINTAIN product?
if not, that may explain the error.
MODIFY you don't need a license for




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
No, I do not have a license that I'm aware of. Can the Modify command update all records permanatly in the database. This is what I'll need to do.

Thanks,


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

Yes, MODIFY will permanently update records of your choosing. For some examples look in your IBINCCEN folder (or your Country equivalent) and look at those fexes that begin "load...". These are the fexes that are used to create the New Century Corp demo databases (All FOCUS). Some are multi segment DBs and you can see how navigating to a lower segment can take place.

But, before you venture forth into the land of MODIFY, what DB are you using as there might be altenatives (SQL UPDATE etc.)?

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
Master
posted Hide Post
If MARKET and TEAM are not keys, then this should work:

MAINTAIN FILE WKLYGFOC
FOR ALL NEXT WEEK_OF INTO STK
WHERE MARKET EQ 'Night'
and TEAM EQ 'A'
COMPUTE I/I2=1;
REPEAT STK.FOCCOUNT
COMPUTE STK(I).MARKET = 'New';
COMPUTE STK(I).TEAM = 'Night Team';
COMPUTE I=I+1;
ENDREPEAT
FOR ALL UPDATE MARKET TEAM FROM STK;
END
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Master
posted Hide Post
All, you sure about MODIFY not needing a license I was under the impression that MODIFY and MAINTAIN both required a license. IBI allows you to use modify for Temporary files in a TABLE request, but if it is not a temporary file then a license is required, and if the file is a FOCUS database then the FDS requires a license.




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
yep
Modify comes with; its the backbone of the whole shebang. its what makes focus focus.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders