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 have a 80 character field that I need to extract the last 15 positions (minus the peroid). For example, within - "xwzo abcde ghig - nbnbc uucucb 12345678-0728." I need to extract "12345678-0728" only. What can be entered into this field is dynamic but what is a constant is I need the last 13 positions minus the period. I looked at the "GETTOK" function but it didn't work. Any Ideas? Thanks
If the position within the 80-character field is fixed, all you need is SUBSTR, with appropriate (integer) arguments for start and end position and length of the portion to extract.
If location varies, and you want the tail end of the text, use ARGLEN to locate the end, and fashion expresions for the start/end column arguments accordingly.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I would go for the REVERSE function and I suggested a method in this topic - "Function for getting right two characters" last year, but there are earlier suggestions of a similar process from previous years.
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, 2004
Alternatively, you could solve this in your master file, provided the part you're interested in is always the last so many positions. The way to do this is to make this 80 character field a group field, and then create three fields in that group field: a field that hold the first 65 positions, next a field for the 14 you want, and last a field for the period. That way, just referencing the field will give you the portion you want, in stead of having to resort to functions to do the same thing. Mind you, this is only going to work if positions are fixed.
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
No different from what everyone else has already said, i'ld go REVERSE/SUBSTRing/REVERSE maybe with a POSIT before the SUBSTR, just to be sure. i think i remember having ageda last year with RJUST/SUBSTR for some reason, the RJUST just wouldn't do what i expected it to, i don't remember why. but the REVERSE was the bomb!
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I'm thinking maybe the "REVERSE" or "RJUST" functions may not trim trailing spaces ? That would make the "last" characters NOT be what you had expected, so "TRIM" the string first ?
I like the idea of re-defining the field with overlaying sub-fields, IFF the SUBSTR you want is fixed. It also saves a lot of processing time (i.e.: fewer function calls for all those SUBSTR, RJUST, POSIT, etc.)
I may post another separate request for info on a way to re-FIELD a records (is that called a "sub-mask" ?)
Thanks for a wealth of information from everyone !
If you read the link I posted above and also the inference by Waz, you will see that ARGLEN is used to obtain the "real" length of the incoming data so the string that is reversed is stripped of trailing blanks first. That way you are controling what you achieve.
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, 2004
Yes, although it wasn't clear if the ARGLEN automatically TRIMmed the string, and I was trying to avoid all that processing needed for multiple function calls.
Thanks for the link to your previous post, which answered this, ++ PLUS ++ answered a question about functions I was going to ask, and now I don't have to !