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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Obtaining the Right 2 char of the value in a field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Obtaining the Right 2 char of the value in a field
 Login/Join
 
Platinum Member
posted
I need to capture the right 2 char of the value in a field. The length of the values in the field is not consistent. There are 136 pages on the forum with the word right and a succesful search is not possible.

For example,

abcde - 02
abc - 03
abcdefghij = 04
abcdefgh - 05

I want the right 2 char which happen to be numbers in the case. What would be used to capture these values?

Thank you

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




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
Virtuoso
posted Hide Post
Look at this Post
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
Hi Geri, You could try something like the following:-

This example uses a single blank space as a delimiter to break an address line into tokens and returns the last token, which is the zip code:

TABLE FILE EMPLOYEE
PRINT ADDRESS_LN3 AND COMPUTE
LAST_TOKEN/A10 = GETTOK(ADDRESS_LN3, 20, -1, ' ', 10, LAST_TOKEN) ;
AS 'LAST TOKEN,(ZIP CODE)'
WHERE TYPE EQ 'HSM'
END

The example produces the following report:

PAGE 1
LAST TOKEN
ADDRESS_LN3 (ZIP CODE)
----------- ----------
RUTHERFORD NJ 07073 07073
NEW YORK NY 10039 10039
FREEPORT NY 11520 11520
NEW YORK NY 10001 10001
FREEPORT NY 11520 11520
ROSELAND NJ 07068 07068
JERSEY CITY NJ 07300 07300
FLUSHING NY 11354 11354


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 196 | Location: London, UK | Registered: December 06, 2005Report This Post
Virtuoso
posted Hide Post
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
COMPUTE LAST2/A2 = SUBSTR(24, MODEL, ARGLEN(24,MODEL,'I2')-1, ARGLEN(24,MODEL,'I2'), 2, LAST2);
END
Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
The example from your post worked perfectly!

Thank you

>>>>>>>>>>>
Here's an example using the CAR file and the CAR field(A16).

-*
DEFINE FILE CAR
RJUST_CAR/A16 = RJUST(16, CAR, RJUST_CAR);
LAST2_CAR/A2 = EDIT(RJUST_CAR,'$$$$$$$$$$$$$$99');
END
-*
TABLE FILE CAR
PRINT
CAR
RJUST_CAR
LAST2_CAR
BY COUNTRY
END




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Obtaining the Right 2 char of the value in a field

Copyright © 1996-2020 Information Builders