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.
Can anyone tell me if it's possible to use -INCLUDE within an IF ... THEN statement?
For instance: If I had a list of specific EMP_IDs that I wanted to use regularly in defines for multiple FOCEXECs Something like this:
MY_EMP_LIST/I1 = IF EMP_ID EQ -INCLUDE app/emplist THEN 1 ELSE 0 ;
app/emplist only contains the EMP_IDs with "OR" separating each. No semicolon at the end, no WHERE at the beginning. This way, it could use it in a WHERE statement or a define.
Thanks much.
Bob
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8
As Jimster says, the -INCLUDe will not work in the way you are wanting. What may work is to just read emplist.fex into a parameter using a -READ. You would need a filedef to point to the fex and then -READ EMPLIST &VALLIST.A200.
and in your DEFINE MY_EMPLIST/I1=IF EMP_ID EQ &VALLIST THEN 1 ELSE 0;
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
You might also consider having a fex (to EX or -INCLUDE) to read and SAVE the list of values [SAVE would automatically issue the filedef for you], and then code
where var in file (savename);
in the reports.
That should give you code that painter can handle.
(Can your values have imbedded blanks?)
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Different flavor? This way you can have your list of acceptable values in a hold file. Sounded like you did not have too many values to store. Make sure if you want to keep this file aorund a while - set it up accordingly. In this example I just used 'hold' to illustrate the concept. Hope this can be of help.
Ira aix 533 WF 533(P) 537(D) 762(T)
--------------------------------- TABLE FILE CAR BY COUNTRY WHERE COUNTRY EQ 'ITALY' OR 'W GERMANY' OR 'FRANCE' ON TABLE HOLD AS HOLD2 END TABLE FILE CAR PRINT CAR RCOST DCOST BY COUNTRY AND COMPUTE PROFIT/D12.2 = RCOST - DCOST ; IF COUNTRY EQ (HOLD2) END
MY_EMP_LIST/I1=IF EMP_ID EQ -INCLUDE app/emplist THEN 1 ELSE 0;
NOTE: You will need at least one value in the -INCLUDE
If you change the first statement to
MY_EMP_LIST/I1=IF EMP_ID EQ '99999'
where '99999' is a EMP_ID that will always be in the report you would then have the ability to have no values in the app/emplist program. Be aware though that the app/emplist program must exist.
the problem with using IN FILE was that the contents of the file was something like 'VAL1' OR 'VAL2' OR 'VAL3' OR 'VAL4'
That would not work with IN FILE unless the file looked like VAL1 VAL2 VAL3 VAL4
I was just going with what Bob already had in his file. Otherwise I would go with something like Ira (and others) suggest.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
DL, thought I captured the concept above. One thing I should've pointed out is there's a byte limiitation when using 'IF Field eq (ddname)'. Using a decode in a define expands that by 10x the value to something like 32,000 bytes. Ira