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     WF Constraints? and FILEDEF question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
WF Constraints? and FILEDEF question
 Login/Join
 
Platinum Member
posted
I keep recieveing a COMPUTATION TOO LARGE ERROR... is there a constraint on how many computations there can be.

This happens in:

DEFINE FILE filename

field1/a255 = if field2 eq field 3 then ' '
eles if ......
....
...

and so on.
END

Is there a limit that WF has on this?

WF v. 535

Thank you!

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


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
in 52 DEFINEs are limited to a certain number of lines or a certain number of characters...
but its real easy to get around, and here's the way we all do it.
just keep the define going with a second define using the same name var name;
DEFINE FILE fieldname
field1/A255= IF ......yada yada
ELSE 'BLANK';
...now continue the define
field1/A255=IF field1 NE 'BLANK' THEN field1 ELSE...
..repeat this redefinition till you're done.
The cool thing is that when you reference your field in a TABLE statement, the LATEST value defined is the one pulled. Cool, huh?
TABLE FILE filename
SUM stuff BY field1
will pull the final version of that defined field.
I think i recall that i have fexes that hit this limit at around 41 IF..THENs in a single field defintion before i had to restart with a new statement, but i' don't recall exactly, anyway its not important.
Let us know if this fix works for you.
-sue




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Alternatively, use an external file decode to extend the number.

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, 2004Report This Post
Platinum Member
posted Hide Post
I'm not sure what you mean. Do you have an example?

Thank you for the response!


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Platinum Member
posted Hide Post
Susannah, I have been trying that exact way to do it, maybe I'm doing something else wrong. I'll keep working with it, I'm sure it's something small that I cannot see since I've been staring at it for so long.

this is what i have:

E_PosttaxAmt/A4 = IF TaxType EQ 'PRETAX' THEN ' '
ELSE IF
-INCLUDE RATEERROR1.FTM
THEN 'L078' ELSE ' ';

E_PosttaxAmt/A4 = IF E_PosttaxAmt NE ' ' THEN E_PosttaxAmt ELSE IF
-INCLUDE RATEERROR2.FTM
THEN 'L078' ELSE ' ';

E_PosttaxAmt/A4 = IF E_PosttaxAmt NE ' ' THEN E_PosttaxAmt ELSE IF
-INCLUDE RATEERROR3.FTM
THEN 'L078'
ELSE IF PosttaxAmtCalc EQ 0 THEN ' '
ELSE IF PosttaxAmtCalc EQ .02 THEN 'L000' ELSE ' ' ;


The Rateerror 1 2 and 3 are statements that are created on the fly with a limit of 180 lines each. I have tried to drop them down to 137, but I did this last year and it worked with 180 lines so I'm not sure why it isn't working now. Can you see anything I am doing wrong?

Also off subject, for FILEDEF's do you have to "close" it after you are done with it or? I don't want mine to hang... is that possible or do we not need to end a filedef once im done with it. Or clear it would be another question.

Thanks!

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


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
Firstly, you do not have to close a FILEDEF as it is released upon agent expiry (e.g. at the end of your fex).

To use an external decode instead of your if statements you can do something like -
FILEDEF DECODES DISK DECODES.DAT
-RUN
-WRITE DECODES 'ENGLAND' 'EUROPE'
-WRITE DECODES 'FRANCE' 'EUROPE'
-WRITE DECODES 'ITALY' 'EUROPE'
-WRITE DECODES 'W GERMANY' 'EUROPE'

TABLE FILE CAR
PRINT COMPUTE CONTINENT/A10 = DECODE COUNTRY(DECODES ELSE 'ASIA');
BY COUNTRY
END


Note that the alpha numeric values have singles quotes around them. This is not strictly necessary (I think) except when you have embedded spaces, but I would suggest that you always get into the habit of doing it because it's one less obvious problem to be sorted out later.

The external file can contain 32767 characters within it and the values must be seperated by a comma or a blank.

Good luck

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, 2004Report This Post
Platinum Member
posted Hide Post
Thanks Tony, I will try that.


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Platinum Member
posted Hide Post
I went ahead and implemented this and it works the way you said it would, but I needed something more like what Susannah had given.

Although the decode will work for me in alternate situations which I never thought of.

Thank you


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
Did you get Susannah's suggestion to work? as you don't say. If you still require more assistance then shout.

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, 2004Report This Post
Platinum Member
posted Hide Post
No, unfortunately I have about 7 different hold files to split up what I am trying to check in a small amount of sections and it still gives me that error.

Is it possible that the problem could be the amount of arguments in the IF statement? Or is there a total number of characters allowed for 1 if statement....

For example:

IF H eq 'h' OR P eq 'P' or .... about 8 different or's... with
THEN 'error' ELSE
IF ... another set of 8 or's

continued about 100 times?

Is that too much?

Thank you!


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
slfmr, still struggling? What happens if you just end your define after the first chunk of code?
quote:
E_PosttaxAmt/A4 = IF TaxType EQ 'PRETAX' THEN ' '
ELSE IF
-INCLUDE RATEERROR1.FTM
THEN 'L078' ELSE ' ';

Does your define execute properly up to this point? We're not sure whats in that RATEERROR1 file?
I've never actually seen an INCLUDE of an .FTM file, only of a .FEX file, in which case the
-INCLUDE statement would read just
-INCLUDE RATEERROR1
without any file extention. so i would have made my includable chunk of code by
FILEDEF RATEERROR1 DISK RATEERROR1.FEX
Just a thought, as i'm not reading exactly where your error is actually occuring.
As T says, you probably don't need to clear your filedef, but you can, if you want, and it might come in handy to know how
FILEDEF filename CLEAR




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Hi slfmr,

I agree with Susannah's that it will require knowledge of what is within your includes. If you have loads more IFs within it then I would say that you are breaking the limits so I would suggest trying to use a combination of alternates -

DEFINE FILE whatever
-* If, when it's PRETAX, you want to have no value then you need to set it to a value other
-* than the blank, as this will mean evaluation through ALL of the IF statements
-* which is inefficient
-* Try setting the ELSE value at the end of each set of tests to a value that you would not expect
-* to see in the final outcome.
-* Only in the very final IF statement would you actually set it to the blank

E_PosttaxAmt/A4 = IF TaxType EQ 'PRETAX' THEN ' '
ELSE IF somefield IN (1,2,3,4,5,6,7,8,9,44 .... etc.) THEN 'L078'
ELSE DECODE anotherfield(decodefile ELSE 'X');

.........

-* This is the final statement so set the ELSE value to blank
E_PosttaxAmt/A4 = IF E_PosttaxAmt NE 'X' THEN E_PosttaxAmt ELSE IF
more of the same ................
ELSE IF PosttaxAmtCalc EQ 0 THEN ' '

ELSE IF PosttaxAmtCalc EQ .02 THEN 'L000' ELSE ' ' ;
END


Hopefully that will help, if not then if you don't mind sending me an example of your INCLUDE file then I'll see if I can suggest the method.

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, 2004Report This Post
Platinum Member
posted Hide Post
The -Include .FTM file is basically created like this:

Define File MyFile
CONDITIONAL/A3 = IF CTR EQ 1 THEN ' ' ELSE 'OR';
CONDITIONAL2/A4 = 'AND';
FLAGCOUNTER/P8 = LAST FLAGCOUNTER + 1;
Equal/a2 = EQ;
Space/a1 = ' ';
Name/a3 = 'SSN';
TaxName/a15 = 'TaxType';
TaxType = ''''||Tax||'''';
AmtName/a15 = 'Amount';
CityName/a5 = 'City';
Zipname/a10 = 'ZipCode;
End

Table File MyFile
Print
CONDITIONAL
Name
Equal
SSN -*** where SSN here is actually the Value stored in that field
CONDITIONAL2
TaxName
Equal
TaxType -** where TaxType is the value in that field
CONDITIONAL2
AmtName
Equal
Amount -** where Amount is the value in that field
CONDITIONAL2
CityName
Equal
City -** where City is the value in that field
CONDITIONAL2
ZipName
Equal
Zip -** where Zip is the value in that field
WHERE FLAGCOUNTER LE 100 -***** so this limits the first 100 rows we check
-*** RATEERROR1 is the first 100, this goes on RATEERROR2 for the next etc....
ON TABLE HOLD AS RATEERROR1 FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END

Something like above... so that when we have later on

Define File NewFile
E_PosttaxAmt/A4 = IF TaxType EQ 'PRETAX' THEN ' '
ELSE IF
-INCLUDE RATEERROR1.FTM
THEN 'L078' ELSE ' ';
END

When you ECHO it, it shows up like this:
_PosttaxAmt/A4 = IF TaxType EQ 'PRETAX' THEN ' '
ELSE IF
-INCLUDE RATEERROR1.FTM
SSN EQ 456987458 AND TaxType EQ 'PRETAX' AND Amount EQ 5.34 AND City EQ 'San Francisco' AND ZipCode EQ '54896'
OR SSN EQ 456987458 AND TaxType EQ 'PRETAX' AND Amount EQ 5.34 AND City EQ 'Memphis' AND ZipCode EQ '54896'
OR SSN EQ 454512841 AND TaxType EQ 'AFTERTAX' AND Amount EQ 5.34 AND City EQ 'Boston' AND ZipCode EQ '54896'
OR SSN EQ 987546321 AND TaxType EQ 'PRETAX' AND Amount EQ 5.34 AND City EQ 'Dallas' AND ZipCode EQ '54896'
OR SSN EQ 123456789 AND TaxType EQ 'PRETAX' AND Amount EQ 5.34 AND City EQ 'Miami' AND ZipCode EQ '54896'
OR SSN EQ 987654321 AND TaxType EQ 'PRETAX' AND Amount EQ 5.34 AND City EQ 'South Beach' AND ZipCode EQ '54896'
OR SSN EQ 101001010 AND TaxType EQ 'AFTERTAX'AND Amount EQ 5.34 AND City EQ 'Las Vegas' AND ZipCode EQ '54896'
THEN 'L078' ELSE ' ';


So it searches New File to find a match for these SSN's in rate error 1... if not then it starts moves on to the next one:


E_PosttaxAmt/A4 = IF E_PosttaxAmt NE ' ' THEN E_PosttaxAmt ELSE IF
-INCLUDE RATEERROR2.FTM
THEN 'L078' ELSE ' ';


Where RATEERROR2.FTM has the next set of SSN's.


What was my problem was because of so many AND' ' AND ' ' AND ' ' it was telling me the computation was too large. What I have done is narrowed down my search criteria to a row number so I will say:

SSN EQ 456987458 AND RowNumber 17
OR SSN EQ 123456789 AND RowNumber 17
OR SSN EQ 987654321 AND RowNumber 17
OR SSN EQ 456987123 AND RowNumber 17
OR SSN EQ 147258963 AND RowNumber 17
THEN 'L078' ELSE ' ';

This DID NOT give me a computation too large, so I was thinking I had too many AND's in the IF Statement.

I am going to try what was suggested where instead of giving it a BLANK, I give it a value and then finally Blank it out in the end.

So if I try:

Taken from Tony's Example:
-* This is the final statement so set the ELSE value to blank
E_PosttaxAmt/A4 = IF E_PosttaxAmt NE 'X' THEN E_PosttaxAmt ELSE IF
more of the same ................
ELSE IF PosttaxAmtCalc EQ 0 THEN ' '

ELSE IF PosttaxAmtCalc EQ .02 THEN 'L000' ELSE ' ' ;
END

Then if all the If statements before were set to X, then in the End they will be set to Blank correct? (Cause I need it blank). I will try this for effeciency sake. Thanks for all your help, I hope my explanation clarified my problem. Currently I am not getting the computation too large error, but I had to limit the amount of ANDs.

Version 5.3.5


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 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     WF Constraints? and FILEDEF question

Copyright © 1996-2020 Information Builders