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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
If...Else problem.
 Login/Join
 
Silver Member
posted
I'm getting an error for a conditional statement I'm using, and I don't udderstand why webfocus is having problem with it. Here's my code:

COMPUTE DIVISIONCODE1/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9');

COMPUTE DIVISIONCODE2/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');
PAYROLLORGANIZATIONCODE
L2NAME
POSITIONNAME
LUPOSITIONTYPEID
DISTRIBUTIONPERCENT
EXPANSIONOPTIONFULL
OCCUPANTNAME
GRANTNUMBER
CATEGORYCODENAME
WHERE L2NAME EQ '&DIVISIONNAME.().DIVISIONNAME.';
-IF &DIVISIONNAME EQ '5201'
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE1;
-ELSE
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE2;


Any help would be greatly appreciated .


WebFocus 7.1
Developer Studio
 
Posts: 35 | Location: Tallahassee,Florida | Registered: March 16, 2007Report This Post
Virtuoso
posted Hide Post
Robab

I suppose you have left out some part of the program and this is a FEX that starts with TABLE FILE xxx

You are mixing DM commands (starting with - ) with TABLE commands.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
As Frank says, you are mixing DM with core FOCUS. Check out the various posts that have already dealt with the differences between these two "languages".

Then you might understand why you need to do this -

COMPUTE DIVISIONCODE1/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9');

COMPUTE DIVISIONCODE2/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');
PAYROLLORGANIZATIONCODE
L2NAME
POSITIONNAME
LUPOSITIONTYPEID
DISTRIBUTIONPERCENT
EXPANSIONOPTIONFULL
OCCUPANTNAME
GRANTNUMBER
CATEGORYCODENAME
WHERE L2NAME EQ '&DIVISIONNAME.().DIVISIONNAME.'
-SET &Div_Column = IF &DIVISIONNAME EQ '5201' THEN 'DIVISIONCODE1' ELSE 'DIVISIONCODE2';
WHERE PAYROLLORGANIZATIONCODE EQ &Div_Column

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Hi Frank,

Thank you for responding.
What I'm trying to accomplish here is to filter my data based on the value of L2Name column. I am using a launch page that uses a drop down box generated with the L2Name, and once I capture that I want to filter the data based on it. Now I'm thinking may be I can use a procedure just to generate a combo box with L2Name and another procedures that checks for the value of L2Name(and I don't know how to refer to a variable in another procedure) and execute a different focexec based on the value of L2Name. I have a deadline to meet by the end of today. The idea seems to be easy, I just don't know how to make it work in Webfocus!!
Any advice?


WebFocus 7.1
Developer Studio
 
Posts: 35 | Location: Tallahassee,Florida | Registered: March 16, 2007Report This Post
Guru
posted Hide Post
What if you change:

-IF &DIVISIONNAME EQ '5201'
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE1;
-ELSE
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE2;


to:

]-IF &DIVISIONNAME EQ '5201' GOTO TEST1;
-GOTO TEST2
-TEST1
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE1;
-GOTO CONT1
-TEST2
WHERE PAYROLLORGANIZATIONCODE EQ DIVISIONCODE2;
-GOTO CONT1
-CONT1


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Guru
posted Hide Post
Oops! Music

The ] should be removed from the beginning of my code.

Sorry.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Silver Member
posted Hide Post
Tony, I took your suggestion. I modified my code to:

TABLE FILE spdisplaypositiondistributiontwo
PRINT
COMPUTE DIVISIONCODE1/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9');NOPRINT

COMPUTE DIVISIONCODE2/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');NOPRINT
PAYROLLORGANIZATIONCODE
L2NAME
POSITIONNAME
LUPOSITIONTYPEID
DISTRIBUTIONPERCENT
EXPANSIONOPTIONFULL
OCCUPANTNAME
GRANTNUMBER
CATEGORYCODENAME
WHERE L2NAME EQ '&DIVISIONNAME.DIVISIONNAME.'
-SET &Div_Column = IF &DIVISIONNAME EQ '5201' THEN 'DIVISIONCODE1' ELSE 'DIVISIONCODE2';
WHERE PAYROLLORGANIZATIONCODE EQ &Div_Column


Now I'm getting this error:

COMPUTED FIELDS CAN ONLY BE REFERENCED IN A WHERE TOTAL
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND


WebFocus 7.1
Developer Studio
 
Posts: 35 | Location: Tallahassee,Florida | Registered: March 16, 2007Report This Post
Silver Member
posted Hide Post
This is what I ended up using and it worked( I had to use define instead of edit:

-DEFAULT &DIVISIONNAME = FOC_NONE;
-* File DisplayPositionDivisionAllReport.fex
DEFINE FILE spdisplaypositiondistributiontwo
-*DIVISIONCODE1/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9');
-*DIVISIONCODE2/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');

PAY_ORG_CODE/A4 = IF L2NAME EQ '5201' THEN
EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9') ELSE
EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');
END
TABLE FILE SPDISPLAYPOSITIONDISTRIBUTIONTWO
-*COMPUTE DIVISIONCODE1/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9');
-*COMPUTE DIVISIONCODE2/A4 = EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');
-*-SET &Div_Column = IF &DIVISIONNAME EQ '5201' THEN 'DIVISIONCODE1' ELSE 'DIVISIONCODE2';
-*WHERE PAYROLLORGANIZATIONCODE EQ '&Div_Column.EVAL';
-*WHERE PAYROLLORGANIZATIONCODE EQ DIV_COLUMN;
PRINT
PAY_ORG_CODE AS 'Payroll Organization Code'
L2NAME NOPRINT
POSITIONNAME
LUPOSITIONTYPEID NOPRINT
DISTRIBUTIONPERCENT AS 'Distribution Percent'
EXPANSIONOPTIONFULL AS 'Expansion Option'
OCCUPANTNAME AS 'Occupant Name'
GRANTNUMBER AS 'Grant Number'
CATEGORYCODENAME AS 'Category Code Name'
WHERE L2NAME EQ '&DIVISIONNAME';


WebFocus 7.1
Developer Studio
 
Posts: 35 | Location: Tallahassee,Florida | Registered: March 16, 2007Report This Post
Expert
posted Hide Post
quote:
PAY_ORG_CODE/A4 = IF L2NAME EQ '5201' THEN
EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$$9') ELSE
EDIT(L2NAME, '99$$') || EDIT(L2NAME, '$$9$');


Unless I'm missing something, couldn't you simplify your EDIT to:

 PAY_ORG_CODE/A4 = IF L2NAME EQ '5201' THEN
EDIT(L2NAME, '99$9') ELSE EDIT(L2NAME, '999$');
 


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Robab,
There are multiple ways you could handle this, with and without using DM code. If this works for you, great job.

One thing I noticed is that you've gone from two WHERE statements in you first fex (L2NAME and PAYROLLORGANIZATIONCODE) to only one in your last post (for L2NAME). You would get different results, but maybe that was intended because you've also changed the values of the output column (PAY_ORG_CODE)?


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
Silver Member
posted Hide Post
Hi Darin,

Thank you for responding, and yes I was going to eventually use one output column based on the selected value from L2Name.


WebFocus 7.1
Developer Studio
 
Posts: 35 | Location: Tallahassee,Florida | Registered: March 16, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders