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     Using -INCLUDE within IF ... THEN

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using -INCLUDE within IF ... THEN
 Login/Join
 
Gold member
posted
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
 
Posts: 93 | Registered: February 20, 2008Report This Post
Guru
posted Hide Post
IIRC '-' (ie dash commands or dialog manager statements) are such that the dash must appear in column 1.

Have you considered a DECODE?


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
As long as you break the line before and after the -INCLUDE (so MR or dialog manager will recognize it and perform the substitution) it should work.

  
MY_EMP_LIST/I1 = IF EMP_ID EQ 
-INCLUDE app/emplist 
THEN 1 ELSE 0 ;

or simply
  
MY_EMP_LIST/I1 = 
  (EMP_ID EQ 
-INCLUDE app/emplist 
  );


The -include will need MRNOEDIT if the fex is executed in MR and the emplist resides on the EDA server.

Of course, you will not be able to open the fex in the painter.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Thanks to all.
To Jack Gross, I can't seem to get it to work by breaking the line so the dash is in column 1.

The -READ seems like a good option, but I'm really green here so I'm not sure how to use FILEDEF.

I was thinking I could create a DB2 table, join to that and when EMP_ID in my host table eq EMP_ID in my DB2, flag it. Thoughts?

Any additional advice would be appreciated.
Bob


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Gold member
posted Hide Post
Jack, I did get your advice to work!! I had a semicolon in my reference fex and then one at the end of my define field.

My apologies. I should have looked closer!


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Virtuoso
posted Hide Post
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, 2005Report This Post
Platinum Member
posted Hide Post
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


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Member
posted Hide Post
Here is a way you can do it.

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.


WebFOCUS 7.6.11
All Outputs
Windows 2003
 
Posts: 6 | Registered: July 03, 2008Report This Post
Platinum Member
posted Hide Post
I'm quite surprised that since Bobv's _INCLUDED'd file contains only the 'guts' of an OR sequence that nobody suggested
IF {fieldname} IN FILE ddname 

With this method his external file need contain only the list of field values and need not include the "OR"s.


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
 
Posts: 154 | Location: NY | Registered: October 27, 2005Report This Post
Virtuoso
posted Hide Post
Nobody?

quote:
where var in file (savename);


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Well, I guess I'll throw this into the pool:

NOT_IN_LIST/I1 = DECODE EMP_ID(EMPLIST ELSE 1);

DECODE assigns the value 0 to an employee whose EMP_ID appears in the file and 1 when EMP_ID does not appear in the file.

Straight out of the documentation!!!

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Platinum Member
posted Hide Post
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

aix 533 wf 533(p)


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 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     Using -INCLUDE within IF ... THEN

Copyright © 1996-2020 Information Builders