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     [SOLVED]Passing Parameters

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Passing Parameters
 Login/Join
 
Silver Member
posted
How do I pass parameters into another procedure. Here is the code for the procedure that will contain four values...


TABLE FILE DW_DIM_TM
PRINT
DW_DIM_TM.DW_DIM_TM.CALDTEI AS 'DST,DW_DIM_TM.DW_DIM_TM.CALDTEI'
WHERE DW_DIM_TM.DW_DIM_TM.CALDTEI EQ &PICKDATE;
ON TABLE HOLD AS HOLDINGFAST
END

TABLE FILE HOLDINGFAST
PRINT
COMPUTE STARTWEEK/YYMD = HOLDINGFAST.HOLDINGF.CALDTEI - 56;
COMPUTE ENDWEEK/YYMD = HOLDINGFAST.HOLDINGF.CALDTEI - 7;
ON TABLE HOLD AS BASEAPP/WEEKS
END

JOIN
INNER WEEKS.WEEKS.STARTWEEK IN WEEKS TO MULTIPLE DW_DIM_TM.DW_DIM_TM.CALDTEI
IN DW_DIM_TM TAG J0 AS J0
END

JOIN
INNER WEEKS.WEEKS.ENDWEEK IN WEEKS TO MULTIPLE DW_DIM_TM.DW_DIM_TM.CALDTEI
IN DW_DIM_TM TAG J1 AS J1
END

TABLE FILE WEEKS
PRINT
J0.DW_DIM_TM.CALFSYR AS 'BEGINYEAR'
J0.DW_DIM_TM.CALFSWK AS 'BEGINWEEK'
ON TABLE HOLD AS BASEAPP/STARTCOMPUTE
END

TABLE FILE WEEKS
PRINT
J1.DW_DIM_TM.CALFSYR AS 'ENDYEAR'
J1.DW_DIM_TM.CALFSWK AS 'ENDWEEK'
ON TABLE HOLD AS BASEAPP/ENDCOMPUTE
END

Here is the code that needs those values (2 year values i.e. 2015, 2016 & 2 week of the year values i.e. 51, 6) passed to...

TABLE FILE PWCS_WJEMPWKF
SUM
PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEHRST
PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJECSET
COMPUTE CasesPickedOnAvgPerWeek/D12.2 = PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJECSET / PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEHRST; AS 'CasesPickedOnAvgPerWeek'
BY LOWEST PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEYRN
BY LOWEST PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWKN
BY LOWEST PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJECDE
BY LOWEST PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJECVWDS
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJECDE CONTAINS '101' OR '201' OR '203' OR '217' OR '209' OR '501' OR '509';
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWH EQ ' 1' OR ' 7';
-*WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEYRN GE BEGINYEAR;
-*WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWKN GE BEGINWEEK;
-*WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEYRN LE ENDYEAR;
-*WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWKN LE ENDWEEK;
END

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Silver Member
posted Hide Post
I have tried several variations to get this working. Like using INCLUDE with READ and defining the READ. JOINS will not work in this case. Any help would be appreciated.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Expert
posted Hide Post
I don't understand the problem. The only variable (parameter) you specify is &PICKDATE.

This will get the column values into variables that you can use in the WHERE statements:

...
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
-RUN

TABLE FILE WEEKS
PRINT 
J0.DW_DIM_TM.CALFSYR AS 'BEGINYEAR'
J0.DW_DIM_TM.CALFSWK AS 'BEGINWEEK'
ON TABLE HOLD AS HSTARTCOMPUTE
END
-RUN

-READFILE HSTARTCOMPUTE

TABLE FILE WEEKS
PRINT
J1.DW_DIM_TM.CALFSYR AS 'ENDYEAR'
J1.DW_DIM_TM.CALFSWK AS 'ENDWEEK'
ON TABLE HOLD AS HENDCOMPUTE
END
-RUN

-READFILE HENDCOMPUTE
...
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWH EQ ' 1' OR ' 7';
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEYRN GE &BEGINYEAR;
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWKN GE &BEGINWEEK;
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEYRN LE &ENDYEAR;
WHERE PWCS_WJEMPWKF.PWCS_WJEMPWKF.WJEWKN LE &ENDWEEK;
...

This will work if the second part of the code you posted is either in the same program as the top part, or is in a fex that is included.

-READFILE reads one row of data and turns each column into a variable containing the value.

Depending on the format of your PWCS_WJEMPWKF columns, you may or may not have to include quotes around the variables.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
After some tweeking, this worked. Thanks! Have you ever thought about mentoring? I'd pay you for an hour once a week and we could Skype. Let me know.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Expert
posted Hide Post
Sounds like a new career I'll consider Smiler


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     [SOLVED]Passing Parameters

Copyright © 1996-2020 Information Builders