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.
DEFINE FILE xxx key_val/A3V= IF ((SUBJ EQ 'REL') and (CRSE IN ('100','200'))) THEN '1A' ELSE IF ((SUBJ EQ 'ENG') and (CRSE IN ('100','200'))) THEN '1B' ELSE ...etc key_desc/A60V= IF ((SUBJ EQ 'REL') and (CRSE IN ('100','200'))) THEN 'Desc for REL' ELSE IF ((SUBJ EQ 'ENG') and (CRSE IN ('100','200'))) THEN 'Desc for ENG' ELSE ...etc
As you can see, the IF statements are identical, it is just the field name and values that differ. If there anyway to achieve something like the following:
key_val/A3V, key_desc/A60V= IF ((SUBJ EQ 'REL') and (CRSE IN ('100','200'))) THEN '1A','Desc for REL' ELSE IF ((SUBJ EQ 'ENG') and (CRSE IN ('100','200'))) THEN '1B','Desc for ENG' ELSE ...etc
This may be in the lserv somewhere, but I do not even know how to decribe what to search for. Is what I am trying to do even possible?
Thanks all for your help. PaulThis message has been edited. Last edited by: paulI,
Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010 Test: I wish we had one!
All kinds of ways to do this but I don't know of a function that gets you there.
How about:
DEFINE FILE XXX
KEYVALDESC/A63 =
IF ((SUBJ EQ 'REL') and (CRSE IN ('100','200'))) THEN '1A Desc for REL' ELSE
IF ((SUBJ EQ 'ENG') and (CRSE IN ('100','200'))) THEN '1B Desc for ENG' ELSE
etc....
KEYVAL/A3V = EDIT(KEYVALDESC,'999');
KEYDESC/A60V = EDIT(KEYVALDESC,'$$$999999999999999999999999999999999999999999999999999999999999');
END
You can only assign values to one virtual field at a time within a Compute/Define. And that's certainly true for most languages I know. Though I can see the value in having the functionality you suggest.
Anyway, here's my take on one of at least 10 different efficient ways...or more...to do it:
KEYVAL/A3V =IF NOT CRSE IN(100,200) THEN ' ' ELSE DECODE SUBJ('REL' '1A' 'ENG' '1B' ELSE ' ');
KEYDESC/A60V=DECODE KEYVAL('1A' 'Desc for REL' '1B' 'Desc for ENG' ELSE ' ');
In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
From an ongoing maintenance perspective, I would suggest not making the define too complex, as someone else may come in the work on the fex and not understand what is being done.
Thank you prarie and microfich. Both solutions worked. I used microfich's because it removed one whole series of 'IF' statements which was my goal. Thanks you again.
Thanks davSmith, that was the term I was looking for....virtual field.
Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010 Test: I wish we had one!