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] EDIT(field,'99999999999999999999'); stops at first blank space

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] EDIT(field,'99999999999999999999'); stops at first blank space
 Login/Join
 
Silver Member
posted
From this post, Pat (PBrightwell) posted:
quote:
When using EDIT in FOCUS or WebFOCUS you only need to mask the positions that you are using. So to extract the first 5 postitions of any string you would need:
S/A5=EDIT(Y,'99999');

IF you want the second 5, you would need
S/A5=EDIT(Y,'$$$$$99999');

You only need to mask the entire string if the characters you want are at the end.


My problem is that the field I am editing is defined as VARCHAR and teh EDIT stops when it hits a blank. So, if the field contains the string
quote:
This message goes on and on and on and on...
, I should be getting back
quote:
This message on and
. Instead I get
quote:
This
.

How can I ensure that I will get the full 20 characters?

Thank you,
Brad.

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


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Guru
posted Hide Post
Can you please post your code snippet.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Silver Member
posted Hide Post
DEFINE FILE IWNEWS 
TXT/A20 = EDIT(NEWS_TXT,'99999999999999999999'); 
END  


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Guru
posted Hide Post
Please post the field definition in the .mas file.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Virtuoso
posted Hide Post
I would use SUBSTRV() rather then EDIT()
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
Hello brad,
Do you want the first 20 characters irrespective of whatever value is in that field or is it something else?
thanks
Badri


WF 7.6.11,
oracle 11g ,windows
PDF , excel, AHTML
 
Posts: 17 | Registered: February 12, 2013Report This Post
Member
posted Hide Post
I agree with j.gross.
USE SUBSTR() if its a fixed length field
OR SUBSTV() if the field is of variable lengths as defined in ur master file.

Thanks
Badri


WF 7.6.11,
oracle 11g ,windows
PDF , excel, AHTML
 
Posts: 17 | Registered: February 12, 2013Report This Post
Silver Member
posted Hide Post
RSquared, the field is defined as follows:
FIELD=NEWS_TXT          ,NEWS_TXT          ,A200V  ,A200V,MISSING=OFF,$  


badri,
Correct, I want the first 20 postions of the field regardless of value.

j.gross & badri,
I modified the code in my DEFINE as follows:
NEWS_TXTV/A200V = TRIMV('T',NEWS_TXT, 200,' ', 1, NEWS_TXTV);
ALEN/I4 = LENV(NEWS_TXTV,ALEN); 
TXT/A20V = SUBSTV(ALEN, NEWS_TXTV, 1, 20, TXT);                  

and had the same results. I am only getting characters up to the first blank space. NEWS_TXT, on the database contains: This is a test of the Information Warehouse News Message entry system and table. If this had been an actual Information Warehouse News Message, you would have been informed of something meaningful.

What is returned is: This


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Expert
posted Hide Post
Try This:
  
X_NEWS_TXT/A200 = NEWS_TXT;
X_NEWS_20/A20   = SUBSTR(200, XNEWS_TXT, 1, 20, 20, 'A20'); 


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Thank you all for the replies. I have determined the problem was between the seat and the keyboard. It actually had to do with another piece of the define which builds the html I am returning to the page:
TXTBOX1/A69 = '<input type=text size="25" maxlength="25" value='||TXT;
TXTBOX2/A86 = TXTBOX1||' name='||''''|MTXT||''''|' id='||'''';  
TXTBOX3/A121 = TXTBOX2||MTXT||''''|' readonly="readonly"'; 
TXTBOX/A156 = TXTBOX3||' style="background-color:#cccccc;">';   

When I worked these DEFINE lines as follows:
TXTBX1/A41 = '<input type=text size="25" maxlength="25"';             
TXTBX2/A81 = TXTBX1||' value='|''''|TXT||''''|' name='|''''|MTXT;     
TXTBX3/A102 = TXTBX2||''''|' id='|''''|MTXT||''''|' readonly=';       
TXTBOX/A147 = TXTBX3||'"readonly" style="background-color:#cccccc;">';  

I get the data back that I am expecting and it works whether I use:
PARA_TXT/A210 = PARAG(200, NEWS_TXT, '~', 20, PARA_TXT); 
TXT/A20 = GETTOK(PARA_TXT, 210, 1, '~', 20, TXT);          
or
NEWS_TXTV/A200V = TRIMV('T',NEWS_TXT, 200,' ', 1, NEWS_TXTV);   
ALEN/I4 = LENV(NEWS_TXTV,ALEN);                                 
TXT/A20V = SUBSTV(ALEN, NEWS_TXTV, 1, 20, TXT);                   
or
TXT/A20 = EDIT(NEWS_TXT,'99999999999999999999');  

The only difference being the first one does not split in the middle of a word which is fine.


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Platinum Member
posted Hide Post
Incidentally, you might want to try something like this:

-SET &QT = '''' ;
  


and then use &QT instead of the 4 quote marks. I find this a little easier on the eyes.

EricH
 
Posts: 164 | Registered: March 26, 2003Report 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] EDIT(field,'99999999999999999999'); stops at first blank space

Copyright © 1996-2020 Information Builders