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     Editing Large Text Fields

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Editing Large Text Fields
 Login/Join
 
Silver Member
posted
I've received the following message:

(FOC397) LENGTH OF FIELDS ON FOCUS FILE SEGMENT EXCEEDS 4000 BYTES:

My text field is 7,000 in length. I want to separate this 7,000 field into 2-3,500 length fields.

Does anyone know the code that will do this for me? Using the typical define with EDIT(field,'99999') is not an option here for obvious reasons.

Would appreciate any ideas to work around this problem.

Thank you, vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Expert
posted Hide Post
This will do the trick:
-* SUBSTR(inlength, 
parent, start, end, sublength, 
outfield) <br />FIELD1A/A500 = 
SUBSTR(4000, 
FIELD1,    1,  500, 500, 'A500')
FIELD1B/A500 = SUBSTR(4000, FIELD1,  
501, 1000, 500, 'A500');
FIELD1C/A500 = SUBSTR(4000, 
FIELD1, 1001, 1500, 500, 'A500');
and so on...

This message has been edited. Last edited by: <Mabel>,
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis,
I like the way you always explain what you are doing...rather then just a bunch of random numbers.
-* SUBSTR(inlength, parent, start, end, sublength, outfield) FIELD1A/A500 = SUBSTR(4000, FIELD1, 1, 500, 500, 'A500');

Thanks...
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
You're welcome.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
Francis,

Will try this tomorrow. Thank you! I appreciate your quick response.

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Silver Member
posted Hide Post
I tried what you suggested, Francis. Here's what I entered:

TEXTA/A500 = SUBSTR(4000, IMPAIRMENTRECOMMENDATION, 1, 500, 500, 'A500');

And this is the error message I get:

(FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED

My field is defined as A7000. What am I missing here??

Thanks, vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Virtuoso
posted Hide Post
If you are sure it is the substring command that is generating the error, is the field name spelled correctly?

Using "-SET &ECHO=ALL;" helps me debug the wierd ones.
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
Thanks, Leah. I added that SET statement and do see all the code which helps in viewing just what is going on when the code fails.

But I'm still stumped by this one. Double checked the field spelling and all looks ok.

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Virtuoso
posted Hide Post
Vickie, Have you tried replacing the 'A500' with the name of the output field.

TEXTA/A500 = ........,TEXTA);

Also, I know this sounds silly, but make sure your zeros are really zero. I've been bit by that before.
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
Leah,

I saw that scenario and I tried it, I think! I've tried so many things. I'll try again to be sure. And the letter vs number thing, yeah, checked all that too. Very frustrating.

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Platinum Member
posted Hide Post
What's the format for the 7,000 character field in the master -- actual and usage?
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Silver Member
posted Hide Post
Both are A7000.

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Virtuoso
posted Hide Post
Vickie,

Me again. Was talking to a fellow programmer and he agrees that maybe the error is not the substring but something just before it such as a missing semi-colon in another define. He looked at the syntax, he uses it all the time to parse large strings when he doesn't want to create an mfd to look at parts of a file record.

Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
If the field you are supplying to the SUBSTR function is 7000 characters, the first parm supplied to the function should be 7000 not 4000.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Silver Member
posted Hide Post
Thanks, I did try that but still get the same error.

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Platinum Member
posted Hide Post
I did a search on tech support for a similar problem and didn't find anything. At this point, may be worth opening a case.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Silver Member
posted Hide Post
Thanks codermonkey and everyone else for responding. I may have to do that.

In my reading I see mention of CLOB. Will this help me in anyway?

vickie
 
Posts: 37 | Location: Springfield, MA | Registered: December 03, 2004Report This Post
Expert
posted Hide Post
Unfortunately, it appears that the
SUBSTR function only works on fields
of 4096 characters or less, anything
higher and you get the misleading FOC280 message.<br /><br />Here's my test code:
DEFINE FILE CAR<br />
TEST1/A4096 = MODEL || 'ASADSADSSAASASASSSADASDSDSA
DASDASDSADSADSADSADSADASDSA';
 SUBSTR(inlength, parent, start, end, 
sublength, outfield) 
FIELD1A/A500 = SUBSTR(4096, 
TEST1,    1,  500, 500, 'A500');
FIELD1B/A500 = SUBSTR(4096, TEST1,  
501, 1000, 500, 'A500');
FIELD1C/A500 = SUBSTR(4096, TEST1, 
1001, 1500, 500, 'A500');<br />END
TABLE FILE CAR<br />PRINT <br />
FIELD1A<br />FIELD1B<br />END
Maybe some manipulation
of the Master may work. Try
changing the alpha field to a
text field (that probably won't
work with the SUBSTR). I'm not
sure of the CLOB data type,
never worked with them, but that might work.<br /><br />Good luck.

This message has been edited. Last edited by: <Mabel>,
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Vickie,

Since the problem seems to be that your field is more than 4096 characters, have you tried simply breaking it up into two A3500 fields in the master? If that master is being used by some update program, and can't be changed, you can simply create a second master to point to the same physical file.

Actually, now that I think of it, you could define that string as several A500 fields in the master itself. Unless I'm missing something.
 
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005Report 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     Editing Large Text Fields

Copyright © 1996-2020 Information Builders