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     [CLOSED]Run Procedure Multiple Times with Single Input Parameter

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Run Procedure Multiple Times with Single Input Parameter
 Login/Join
 
Gold member
posted
I have my HTML Launch page that asks the user for a TO and FROM date. I would like these parameters to run the same report, multiple times. The first time through it would run with the dates entered in the field.

The second run of the same report would be the same report subtract one year.

The third time would be the same report subtract 2 years.

I am not sure how to change the parameter and run the other two instances of the report. Any help would be appreciated.

Thanks,

Dave

This message has been edited. Last edited by: dburton,


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
 
Posts: 71 | Location: Kingston, ON | Registered: May 03, 2011Report This Post
Virtuoso
posted Hide Post
You could use a -REPEAT loop. Let's assume the variables coming from your launch page are named &DATE_FROM and &DATE_TO, in mmddyyyy format.

-SET &YEAR_FROM = EDIT(&DATE_FROM,'$$$$9999');
-SET &YEAR_TO   = EDIT(&DATE_TO,'$$$$9999');
-*
-REPEAT :ENDREPEAT1 FOR &I FROM 0 TO 2
-SET &BEG_YEAR = &YEAR_FROM - &I ;
-SET &END_YEAR = &YEAR_TO - &I ;
-SET &BEG_DATE = EDIT(&DATE_FROM,'9999$$$$') | &BEG_YEAR ;
-SET &END_DATE = EDIT(&DATE_TO,'9999$$$$')   | &END_YEAR ;
-*
TABLE FILE xxxx
 PRINT/SUM etc.
 BY etc.
 WHERE <xxxx.date_field> FROM '&BEG_DATE' TO '&END_DATE';
 ON TABLE HOLD/PCHOLD AS REPORT&I
END
-*
-:ENDREPEAT1

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
This would work. However, I don't think I explained my self properly.

I would have 3 different report frames on the HTML page with the same procedure referenced in each frame. For example, I select a date in YYMD format of '20110101' and that is assigned to the variable &DATE_FROM. The first report would run with that value in the first report frame. The second report would run with the value '20100101' in the second report frame and the third report would run with the value '20090101'. All by only clicking the Run button once.

I hope that helps explain things.

Thanks.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
 
Posts: 71 | Location: Kingston, ON | Registered: May 03, 2011Report This Post
Gold member
posted Hide Post
I'm looking to do the exact same thing. Did you get anywhere this since since last November?


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Virtuoso
posted Hide Post
I believe in the HTML Composter Hyperlink properties for a button, you can specify multiple actions. Each action allows you to specify a different target frame. If you have a separate focexec for each of the three reports, you could specify all three as actions for your RUN button. Your date value (&INPUT_DATE in the example below) would be passed as a parameter to all three focexecs. Each focexec would subtract the appropriate number of years from the input date before proceeding. To avoid having three different copies of the same report, each focexec could simply have a -INCLUDE for the report focexec and pass the appropriate date value. For example:

runexec1.fex:
-SET &REPORT_DATE = &INPUT_DATE ;
-*
-INCLUDE REPORT
-RUN

runexec2.fex:
-SET &INPUT_YEAR   = EDIT(&INPUT_DATE,'9999$$$$');
-SET &INPUT_MTHDAY = EDIT(&INPUT_DATE,'$$$$9999');
-SET &REPORT_YEAR  = &INPUT_YEAR - 1 ;
-SET &REPORT_DATE  = &REPORT_YEAR || &INPUT_MTHDAY ;
-*
-INCLUDE REPORT
-RUN

runexec3.fex:
-SET &INPUT_YEAR   = EDIT(&INPUT_DATE,'9999$$$$');
-SET &INPUT_MTHDAY = EDIT(&INPUT_DATE,'$$$$9999');
-SET &REPORT_YEAR  = &INPUT_YEAR - 2 ;
-SET &REPORT_DATE  = &REPORT_YEAR || &INPUT_MTHDAY ;
-*
-INCLUDE REPORT
-RUN


EDIT: I've never actually tried the above and I suppose it's possible running the three focexecs at the same time might have them stepping on each other. (Does WF initiate three agents or one?) So it might be necessary to chain the three frames so they run sequentially instead of concurrently. Just a thought...

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Kevin Patterson:
I'm looking to do the exact same thing. Did you get anywhere this since since last November?


Dan is right, it is easier to use 3 different procedures and use the same button and two input parameters to control all 3 outputs on the HTML page. So, that's exactly what I did. I took the same report and created 3 copies of it and then just modified the parameters for the dates to subtract a year or two depending on what I needed. The code i used is below.


 
first procedure: 
-SET &DATEFROM = IF &DATEFROM EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&DATEFROM.LENGTH,&DATEFROM,'/',&DATEFROM);
-SET &DATETO = IF &DATETO EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&DATETO.LENGTH,&DATETO,'/',&DATETO);
-SET &FROMDATE = IF &DATEFROM NE 'FOC_NONE' THEN EDIT(&DATEFROM,'9999$$$$')|'-'|EDIT(&DATEFROM,'$$$$99$$')|'-'|EDIT(&DATEFROM,'$$$$$$99') ELSE 'FOC_NONE';
-SET &TODATE = IF &DATETO NE 'FOC_NONE' THEN EDIT(&DATETO,'9999$$$$')|'-'|EDIT(&DATETO,'$$$$99$$')|'-'|EDIT(&DATETO,'$$$$$$99') ELSE 'FOC_NONE';

second procedure:
-SET &PDATEFROM = IF &PDATEFROM EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&PDATEFROM.LENGTH,&PDATEFROM,'/',&PDATEFROM);
-SET &PNDATEFROM = IF &PDATEFROM NE 'FOC_NONE' THEN EDIT(&PDATEFROM,'9999$$$$') ELSE 'FOC_NONE';
-SET &PNDATEFROM2 = IF &PNDATEFROM NE 'FOC_NONE' THEN &PNDATEFROM -1 ELSE 'FOC_NONE';
-SET &PDATEF = IF &PDATEFROM NE 'FOC_NONE' THEN &PNDATEFROM2||EDIT(&PDATEFROM,'$$$$9999') ELSE 'FOC_NONE';
-SET &PDATEFROM = &PDATEF;
-SET &PDATETO = IF &PDATETO EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&PDATETO.LENGTH,&PDATETO,'/',&PDATETO);
-SET &PNDATETO = IF &PDATETO NE 'FOC_NONE' THEN EDIT(&PDATETO,'9999$$$$') ELSE 'FOC_NONE';
-SET &PNDATETO2 = IF &PNDATETO NE 'FOC_NONE' THEN &PNDATETO -1 ELSE 'FOC_NONE';
-SET &PDATET = IF &PDATETO NE 'FOC_NONE' THEN &PNDATETO2||EDIT(&PDATETO,'$$$$9999') ELSE 'FOC_NONE';
-SET &PDATETO = &PDATET;
-SET &FROMDATE = IF &PDATEFROM NE 'FOC_NONE' THEN EDIT(&PDATEFROM,'9999$$$$')|'-'|EDIT(&PDATEFROM,'$$$$99$$')|'-'|EDIT(&PDATEFROM,'$$$$$$99') ELSE 'FOC_NONE';
-SET &TODATE = IF &PDATETO NE 'FOC_NONE' THEN EDIT(&PDATETO,'9999$$$$')|'-'|EDIT(&PDATETO,'$$$$99$$')|'-'|EDIT(&PDATETO,'$$$$$$99') ELSE 'FOC_NONE';

Third procedure:
-SET &P2DATEFROM = IF &P2DATEFROM EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&P2DATEFROM.LENGTH,&P2DATEFROM,'/',&P2DATEFROM);
-SET &PN2DATEFROM = IF &P2DATEFROM NE 'FOC_NONE' THEN EDIT(&P2DATEFROM,'9999$$$$') ELSE 'FOC_NONE';
-SET &PN2DATEFROM2 = IF &PN2DATEFROM NE 'FOC_NONE' THEN &PN2DATEFROM -2 ELSE 'FOC_NONE';
-SET &P2DATEF = IF &P2DATEFROM NE 'FOC_NONE' THEN &PN2DATEFROM2||EDIT(&P2DATEFROM,'$$$$9999') ELSE 'FOC_NONE';
-SET &P2DATEFROM = &P2DATEF;
-SET &P2DATETO = IF &P2DATETO EQ '' THEN 'FOC_NONE' ELSE '20'||STRIP(&P2DATETO.LENGTH,&P2DATETO,'/',&P2DATETO);
-SET &PN2DATETO = IF &P2DATETO NE 'FOC_NONE' THEN EDIT(&P2DATETO,'9999$$$$') ELSE 'FOC_NONE';
-SET &PN2DATETO2 = IF &PN2DATETO NE 'FOC_NONE' THEN &PN2DATETO -2 ELSE 'FOC_NONE';
-SET &P2DATET = IF &P2DATETO NE 'FOC_NONE' THEN &PN2DATETO2||EDIT(&P2DATETO,'$$$$9999') ELSE 'FOC_NONE';
-SET &P2DATETO = &P2DATET;
-SET &FROMDATE = IF &P2DATEFROM NE 'FOC_NONE' THEN EDIT(&P2DATEFROM,'9999$$$$')|'-'|EDIT(&P2DATEFROM,'$$$$99$$')|'-'|EDIT(&P2DATEFROM,'$$$$$$99') ELSE 'FOC_NONE';
-SET &TODATE = IF &P2DATETO NE 'FOC_NONE' THEN EDIT(&P2DATETO,'9999$$$$')|'-'|EDIT(&P2DATETO,'$$$$99$$')|'-'|EDIT(&P2DATETO,'$$$$$$99') ELSE 'FOC_NONE';


It might not be pretty but it works.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
 
Posts: 71 | Location: Kingston, ON | Registered: May 03, 2011Report 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     [CLOSED]Run Procedure Multiple Times with Single Input Parameter

Copyright © 1996-2020 Information Builders