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
help with functions
 Login/Join
 
Gold member
posted
Hi all,
I'd like to upcase a string that has a comma in it like a string 'This is good, but make it better.' How can I do an upcase on it?
I have it like this:
&STR = 'This is good, but make it better.'
-SET &STRLEN=&STR.LENGTH;
-SET &TMPLNGTH = 'A' || &STR1LEN;
-SET &UPSTR = UPCASE(&STRLEN,&STR, &TMPLNGTH );

this wont work because the string has upcase.

Also after upcase, I need to use strrep function on this to take out the comma.
Can somebody help with both functions?
Thanks,

KK


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Expert
posted Hide Post
-SET &ECHO=ALL;

-SET &STRING1 = 'This is good, but make it better.';

-SET &STRING1A = STRIP(&STRING1.LENGTH, &STRING1, ',', 'A&STRING1.LENGTH');

-SET &STRING1B = UPCASE(&STRING1A.LENGTH, &STRING1A, 'A&STRING1A.LENGTH');

-TYPE GOOD: &STRING1
-TYPE BETTER: &STRING1B


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
Gold member
posted Hide Post
comma in the string represents 2 inputs though. so if I have something like this:
1, 2, 3, 4, 5 in a string, those each word seperated by commas are to be treated as input for something to search on..


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Expert
posted Hide Post
I don't understand. You said you wanted to "take out the comma".


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
Gold member
posted Hide Post
sorry, somehow it got posted before I finished typing. Sorry for the confusion, let me explain the whole thing what I was trying to accomplish.
Yes. Comma(s) will be taken out before or after the whole string is upper cased. those commas will be replaced with an OR.
For example, if input string is
'Web, Focus, Sort, Search' etc
I am turning it into a where statement something like
WHERE DESCRIPTION EQ 'WEB' OR 'FOCUS' OR 'SORT' OR 'SEARCH';

for the end-user, s/he will be inputting the string 'Web, Focus, Sort, Search' in a text area on a lunch page.

to get that where statement, the requuirements are that they should be up-cased, and replace comma with an or for each comma.

What is the best way to get this done?
Thanks so much in advance,
KK


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Virtuoso
posted Hide Post
Have you considered the multiselect or in a drop down list?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
yes but wont work since there are just so many. The users will type in for their input in a text area box.


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Expert
posted Hide Post
kk,
how about the OVRLAY function to replace the , with an ' OR '.
Do you hve the 4th manual in the series, the FUNCTIONS manual? Have a look thru the entire section on TEXT functions. Good stuff there.
The POSIT and/or GETTOK functions you might like, as well.
The UPCASE function should be working fine for you, i can't see why it won't.
I perfer the ARGLEN function to the &var.LENGTH way. I get a more accurate answer. the .LENGTH will count trailing blanks...
-s.




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
Expert
posted Hide Post
STRREP will do the job for you -
-SET &StrInput  = 'Web, Focus, Sort, Search';
-SET &StrOutput =
- UPCASE(100,''''||STRREP(&StrInput.LENGTH,&StrInput,2,', ',6,''' OR ''',98,'A98')||'''','A100');
-? &Str

Although I would suggest a method with (possibly) less effort would be to change your WHERE field EQ to WHERE field IN and then have your list comma seperated and within braces -
WHERE DESCRIPTION IN ('WEB','FOCUS','SORT','SEARCH')

BTW, please update your signature (see the "sticky" topic on the topic list page) so that we can gauge our responses to you, knowing your platform and release.

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
kmafu,

Your original statement is incorrect, the ',' had nothing to do with the UPCASE working. The problem was with your code.

-SET &STR = '#Web#,#Focus#,#Sort#,#Search#';
-SET &UPSTR = UPCASE(&STR.LENGTH,'&STR.EVAL','A&STR.LENGTH');
-* Convert # to '
-SET &UPSTR = CTRAN(&UPSTR.LENGTH,'&UPSTR.EVAL',35,39,'A&STR.LENGTH');


Now your WHERE becomes

WHERE DESCRIPTION IN (&UPSTR)

This message has been edited. Last edited by: jgelona,


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
Thanks very much, All!
I will definitely try these answers. Will post back following up on this if I have more questions later today or tomorrow.
Again, Thanks!
KK


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Virtuoso
posted Hide Post
quote:
for the end-user, s/he will be inputting the string 'Web, Focus, Sort, Search' in a text area on a lunch page.


Why not just use JavaScript to do this?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Expert
posted Hide Post
Stefaans
they work just fine. all the way thru 762.
the specs are very specific.
code tightening over the versions may have caused any problems you have encountered.
If you follow the rules, they work like a charm.
-s.




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
THIS SHOULD BE IN THE MANUAL WOULD SAVE A GREAT DEAL OF TROUBLE.

The problem people get with functions not working with dm is that dm will try and establish the datatype on the fly thus '0' will be translated to double precision.

Force the issue by coding your alpha arguments using

(a) ASIS
(b) Concatenation of a blank on the end (dont worry if the string goes past its length )
eg '0' | ' ' will always be treated as string.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Silver Member
posted Hide Post
Hi All
I have started working on this one, but am busy at work. I think Susannah is the closest.
What I am working on is to take the string and POSIT the comma and shorten the string to Posit + 1 to end of string. The use ARGLEN to determine the length of the new string.
As this is Dialogue manager, either use this in a repeat loop or a goto until the length of the string is LE to 0.
The main point is to write the part from the beginning of the string to just before the comma (each time) TO A FILE.
THEN

TABLE FILE MYFILE
PRINT *
WHERE DESCRIPTION IN FILE EXTERNAL FILE.
END
This should cater for predicate values less than 4000 chars long.
I have had to do this many times over the past 18 years

This message has been edited. Last edited by: Stefaans,


WebFOCUS 7.7.01 Windows, TSO 7.0
 
Posts: 43 | Registered: April 18, 2007Report This Post
Expert
posted Hide Post
"Savannah"...i like it...i'm changing my handle right away!




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
Silver Member
posted Hide Post
Oh Susannah, I am so sorry Smiler but I know that you are a big enough person to tolerate a typo.
sincerest regards Steve


WebFOCUS 7.7.01 Windows, TSO 7.0
 
Posts: 43 | Registered: April 18, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders