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     Multiple DECODE files

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Multiple DECODE files
 Login/Join
 
Member
posted
Is it possible to use different DECODE files based on the value of a field?

For example,

APP FI MCEDMA PLANNING/mcedma.txt
APP FI MCFDMA PLANNING/mcfdma.txt
APP FI MSJDMA PLANNING/msjdma.txt
-RUN

DEFINE FILE CAR
OPDIV/A3 = DECODE COUNTRY(ENGLAND 'MCE' FRANCE 'MCF' JAPAN 'MCJ');
DMASTORE/A140 = IF OPDIV EQ 'MCE' THEN DECODE SEATS(MCEDMA) ELSE
IF OPDIV EQ 'MCF' THEN DECODE SEATS(MCFDMA) ELSE
IF OPDIV EQ 'MSJ' THEN DECODE SEATS(MSJDMA);
END

I get a FOC553 error message when I try this.

Thanks,

Joe
 
Posts: 22 | Registered: October 13, 2006Report This Post
Guru
posted Hide Post
What exactly are you trying to accomplish? What do you want your output to contain?


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Platinum Member
posted Hide Post
Hi Joe,
Having multiple DECODE files is fine so long as the total of all the DECODE files does NOT exceed the limit. Try cutting down the size of the files or only use two and see if it works then.
Rich


WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
 
Posts: 173 | Registered: November 16, 2005Report This Post
Member
posted Hide Post
Thanks Rich, I tried using just two and it still didn't work. It works as long as I use just one DECODE file, but I need to use different files depending on the country.

Glenda, What I'm trying to accomplish is to DECODE from different external files based on the value of a field. I do not always want to DECODE from the same file. So for England, I want to use one DECODE file, but for W Germany I want to use a totally different file for the DECODE.

Thanks,

Joe
 
Posts: 22 | Registered: October 13, 2006Report This Post
Member
posted Hide Post
Glenda,

Additionally, my output will contain whatever is in the file. For example the file allocated to MCEDMA could contain the following sample string:

2 'New York-Newark-Edison, NY-NJ-PA;New York;002-Brooklyn'

While the file allocated to MCJDMA could contain the same code, but with a different string:

2 'San Francisco-Oakland-Fremont;San Francisco;004-Southland'

So in my example, if ENGLAND is the country, the OPDIV define field will be equal to MCE and the DECODE file should be MCEDMA. I should get back 'New York-Newark-Edison, NY-NJ-PA;New York;002-Brooklyn' if SEATS is equal to 2.

However, if JAPAN is the country, the OPDIV define field will be equal to MCJ and the DECODE file should be MCJDMA. I should get back 'San Francisco-Oakland-Fremont;San Francisco;004-Southland' if SEATS is equal to 2.

Does that make more sense? The first file, MCEDMA only has 179 records. The second file, MCJDMA only has 171 records. One has approximately 11,000 bytes and the other has 10,000 bytes.

Thanks,

Joe
 
Posts: 22 | Registered: October 13, 2006Report This Post
Platinum Member
posted Hide Post
Joe,

Not sure what your problem is (don't even know what a FOC553 is), but I have information that might provide a hint. I created three data files and populated then with one string each (using the two from your example, and one other). I created them as .fex files, by the way, because that's easy to do in developer studio. Ran your code against those three files and had no problems. So I'm inclined to suspect one of two things. Either there is too much data in your decode files, or there's a problem with file format. Did you create them via a HOLD statement? If so, did you use format ALPHA (might help)?


dwf
 
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005Report This Post
Platinum Member
posted Hide Post
Hi Joe,
I simply created the two files, mcjdma.ftm and mcedma.ftm, added your 1 line of data to each and ran the request. It worked fine for me.
Rich


WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
 
Posts: 173 | Registered: November 16, 2005Report This Post
Expert
posted Hide Post
joe

your second decode is an incomplete if-then else-sequence. Might be contributing to the problem.
DMASTORE/A140 = IF OPDIV EQ 'MCE' THEN DECODE SEATS(MCEDMA) ELSE
IF OPDIV EQ 'MCF' THEN DECODE SEATS(MCFDMA) ELSE
IF OPDIV EQ 'MSJ' THEN DECODE SEATS(MSJDMA) ELSE 'XXX';

But in this case, one of your decode files is too large; from the mother ship, we read:
" 0(FOC553) A COMPUTATIONAL EXPRESSION IS TOO LARGE
A computational expression in a DEFINE, COMPUTE or -SET command is
too large (the limit is approximately 32K for the parsed version).
Split the computation up into two expressions, or issue the command
SET COMPUTE=OLD and retry."

and we get this incoming message from the big giant head by typing:
? 553

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




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
Guru
posted Hide Post
Joe,

Use multiple fields like this:

APP FI MCEDMA PLANNING/mcedma.txt
APP FI MCFDMA PLANNING/mcfdma.txt
APP FI MSJDMA PLANNING/msjdma.txt
-RUN

DEFINE FILE CAR
OPDIV/A3 = DECODE COUNTRY(ENGLAND 'MCE' FRANCE 'MCF' JAPAN 'MCJ');
TEMPA/A140 = DECODE SEATS(MCEDMA);
TEMPB/A140 = DECODE SEATS(MCFDMA);
TEMPC/A140 = DECODE SEATS(MCJDMA);
DMASTORE/A140 = IF OPDIV EQ 'MCE' THEN TEMPA ELSE
IF OPDIV EQ 'MCF' THEN TEMPB ELSE
IF OPDIV EQ 'MSJ' THEN TEMPC;
END

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Member
posted Hide Post
Thanks for all the responses.

It appears that it was the amount of data as RichH suggested. All of my files combined had over 44000 characters and the limit for DECODE is 32000.

Joe
 
Posts: 22 | Registered: October 13, 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     Multiple DECODE files

Copyright © 1996-2020 Information Builders