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
Replacing Text
 Login/Join
 
<twerl>
posted
I need to edit a FOCUS dataset. Within a field that captures the street address, I need to amend "street" to "St". Is there a way to do this to all the records where "street" occurs in the field while leaving the rest of the text in that field unchanged.
 
Report This Post
Platinum Member
posted Hide Post
�Why not use a little MODIFY or MAINTAIN?

Example (replace bold texts with proper values):
--------------------------------------------------
MAINTAIN FILE table

-* Read - All rows with 'Street'.
FOR ALL NEXT key fields INTO STK
WHERE ADDRESS EQ 'Street'

-* Process - Change ADDRESS value to 'St.'.
REPEAT STK.FOCCOUNT I/I5 = 1 ;
STK(I).ADDRESS = 'St.' ;
ENDREPEAT I=I+1 ;

-* Update.
FOR ALL UPDATE table.ADDRESS FROM STK(1)

-* Errors.
TYPE "ERROR: <FOCERROR "
END
-RUN
--------------------------------------------------

Regards,
Mikel
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Expert
posted Hide Post
quick and dirty way that works like a charm
Add a define to the bottom of the master file which you utilize in reading the database.
(1)Use the userwritten subroutine POSIT to find the location in the field "STREETADDRESS" of the string "Street".
Posit will return an integer. If the integer is 0, the string doesn't exist in the field.
(2)Use the routine SUBSTRING to split the address field into two parts, the part before the "street" and the part after. Use the POSIT integer minus 1 as the endpoint of the first string, and POSIT integer plus 7 as the startpoint of the second half.
(3) glue the whole thing back together
STREETADDRESS/a20=firstpart | 'St.' | secondpart.
Remember that the three parts don't have to add up to 20, just as long as they are <= 20.
You can do all this in defines in the master.
When you give the exact same name to the resultant field "STREETADDRESS" that exists inthe master itself, then every read against that file will use the last-found value in the master of whatever you define; So in this case, referencing STREETADDRESS will always give you the new one. This is a very handy technique for cleaning icky data, especially if it comes from an outside source and is refreshed alot. You can clean out funky special characters this way...lots of cool things you can clean up.
If you need help doing it this way, holler back.
The user-written subroutines booklet is the 4th book in the 5.2 manual set. If you're on 43x, you'll need to order if off IBI's bookstore website.
There's also an OVERLAY function
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
oops let me clarify where that book is.
If you're 52x its the 'USING FUNCTIONS' manual.
If you're 43x its actually included in the developing apps manual, both part of the standard manual set for webfocus.
cheers.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders