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     EDIT Question - extracting characters

Read-Only Read-Only Topic
Go
Search
Notify
Tools
EDIT Question - extracting characters
 Login/Join
 
<M_RIOS75>
posted
I would use the following code to extract the last 2 characters for the field I need which in this case FIELD1=A10

FIELD2/A2 = EDIT(FIELD1,'$$$$$$$$99');

But the field value I'm working with can be anywhere from A10 to A28 (field is A28), how can I make this dynamic; pulling off the last 2 characters on that field?
 
Report This Post
Platinum Member
posted Hide Post
Hi Marvin,

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
-*

Jim


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
 
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005Report This Post
Gold member
posted Hide Post
Using Functions Pg. 5-54 :

DEFINE FILE ...
-*** First trim the trailing blanks...
FLD1_TRIM/A28V = TRIMV('T', ORIGINAL_FLD, 28, ' ', 1, FLD1);
-*** Then find the true length of the data...
FLD1_LGTH/I2 = LENV(FLD1_TRIM, FLD1_LGTH);
-*** Calculate the Starting Position...
FLD1_START/I2 = FLD1_LGTH - 2 ;
-*** Substring to get the result...
FLD1_LAST2/A2 = SUBSTV(28, ORIGINAL_FLD, FLD1_START, FLD1_LGTH, FLD1_LAST2);
END


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
 
Posts: 65 | Location: Chicago, IL | Registered: July 26, 2007Report This Post
<M_RIOS75>
posted
Thanks for the replies! I found the first response easier to follow although they were both helpful. Thanks again.
 
Report 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     EDIT Question - extracting characters

Copyright © 1996-2020 Information Builders