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 want to replace the occurrences of a string in another string by referencing a fieldname instead of a fixed string value.
As far as I can tell, the STRREP function only allows the entry of a value in the command line, and therefore it can only search for and replace one particular string in all of my records. I would like for this string to change its value according to a particular field that is unique to each record, the record that also contains the string that is the subject of the search and replace.
...but it limits the value of the string that can be replaced to just one name. Instead, I would like to use the fieldname FIRST_NAME to vary the string value with each record and remove that particular name from the comment text. I have not been able to get the following coding structure to work, but it sort of indicates what I am trying to accomplish.
I've also considered OVRLAY and some other functions; however, in my case I would need to vary the starting position of the substrings to be replaced by each record, and as far as I can tell those functions require fixed starting positions for each record as well.
It seems relatively straightforward with the STRREP function, but I do not know if it is possible to make WebFOCUS read a variable string value by referencing a fieldname, not to mention whether this is possible within this function. Any suggestions on how this could be accomplished?This message has been edited. Last edited by: jltz83,
DEFINE FILE CAR
CNTR/I9 WITH MODEL = IF LAST CNTR EQ 0 THEN 65 ELSE LAST CNTR + 1 ;
CHAR/A1 = HEXBYT(CNTR,'A1') ;
NEWMODEL/A50 = STRREP (24,MODEL,1,CHAR,3,'???', 50,'A50') ;
END
TABLE FILE CAR
PRINT MODEL
CNTR
CHAR
NEWMODEL
END
Variable Chars
DEFINE FILE CAR
CNTR/I9 WITH MODEL = IF LAST CNTR EQ 3 THEN 1 ELSE LAST CNTR + 1 ;
STR/A3 = SUBSTR(24,MODEL,1,CNTR,CNTR,'A3') ;
NEWMODEL/A50 = STRREP (24,MODEL,ARGLEN(3,STR,'I1'),STR,3,'???', 50,'A50') ;
END
TABLE FILE CAR
PRINT MODEL
CNTR
STR
NEWMODEL
END