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.
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
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
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.
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.
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, 2005
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: ? 553This 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, 2003
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