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]Getting a procedure to run 2 reports with different parameters

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Getting a procedure to run 2 reports with different parameters
 Login/Join
 
Platinum Member
posted
I have a procedure that I need to function like this:
1. Create hold file of students enrolled in a previous term
2. Create hold file of students enrolled in current term
3. Join 2 hold files and produce a report of students that are in the 1st hold file and not in the 2nd.

My problem is that when I create my 2 hold files I need to parameterize on term and when I run my 2nd hold file it seems to always revert to the parameters from the 1st hold file.

Is this even possible and how do you set this up?

Malinda

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


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
I have some questions for you Malinda:

1. How are you invoking the piece of code that creates the HOLD file(s)? via -INCLUDE or EXEC?
2. How are you implementing the parameters?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
This task could potentially be done with MATCH logic.

-* First perform whatever steps are necessary to determine current and previous terms - probably best via use
-* of Dialogue Manager statements that produce two ampersand variables (ex.: &CURR_TERM and &PRIOR_TERM).
.
.
MATCH FILE <filename>
 PRINT <column names>
 BY STUDENT_ID  (or whatever your key/s is/are)
 WHERE <term column> EQ '&PRIOR_TERM';  (remove single quotes if term column is numeric)
RUN
FILE <filename>
 PRINT <column names>
 BY STUDENT_ID
 WHERE <term column> EQ '&CURRENT_TERM';  (remove single quotes if term column is numeric)
 AFTER MATCH HOLD AS <holdname> OLD-NOT-NEW
END
-*
TABLE FILE <holdname>
 PRINT <column names>
 BY STUDENT_ID
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
Here is my code:

 TABLE FILE CSPRDSC_STDNT_ENRL
BY 'CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.EMPLID'
HEADING
""
FOOTING
""
WHERE CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.INSTITUTION EQ 'CSC01';
WHERE CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STRM EQ &STRM.(OR(FIND STRM,CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STRM IN csprdsc_stdnt_enrl)).Select previous term EQ.;
WHERE ( CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STDNT_ENRL_STATUS EQ 'E' ) AND ( CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.CRSE_GRADE_OFF NE 'W' );
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE HOLD AS CSCSTU1 FORMAT FOCUS INDEX 'CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.EMPLID' 
TABLE FILE CSPRDSC_STDNT_ENRL
BY 'CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.EMPLID'
HEADING
""
FOOTING
""
WHERE CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.INSTITUTION EQ 'CSC01';
WHERE CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STRM EQ &STRM.(OR(FIND STRM,CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STRM IN csprdsc_stdnt_enrl)).Select current/upcoming term EQ.;
WHERE ( CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.STDNT_ENRL_STATUS EQ 'E' ) AND ( CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.CRSE_GRADE_OFF NE 'W' );
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE HOLD AS CSCSTU2 FORMAT FOCUS INDEX 'CSPRDSC_STDNT_ENRL.CSPRDSC_STDNT_ENRL.EMPLID'  


Then I would take these 2 hold files and left outer join them and then include a where statement to pull the emplids from the first file that are not in the second.


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
Malinda, you are only using 1 parameter: &STRM. That's why both HOLD files are giving you the same information.

Use 2 different variables and your data should be correct. In addition, try Dan's suggestion about MATCH .. OLD-NOT-NEW as it looks more "natural" than trying to implement an A-minus-B logic using JOIN (which would require short-path and testing for MISSING values).



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Oh, and if you use MATCH logic then you don't need your HOLD files to be FOCUS INDEX ....



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Malinda, how many records would you obtain for each student when querying CSPRDSC_STDNT_ENRL in any given term? just one?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
I still don't like the idea of querying the database *twice* to obtain pieces of data that could technically be retrieved in one single pass.

Would this work for you?


-DEFAULTS &PREV_TERM='2010-01';
-DEFAULTS &CURR_TERM='2010-02';
-*
-* Get students who were enrolled in the previous term, the current one or both
TABLE FILE CSPRDSC_STDNT_ENRL
SUM
COMPUTE IN_PREV_TERM_IND/A1 = IF STRM EQ '&PREV_TERM' THEN 'Y' ELSE 'N'; 
COMPUTE IN_CURR_TERM_IND/A1 = IF STRM EQ '&CURR_TERM' THEN 'Y' ELSE 'N'; 
BY EMPLID
WHERE STRM EQ '&PREV_TERM' OR 'CURR_TERM'
ON TABLE HOLD AS HSTUDENTS
END
-*
-* Print students enrolled in the previous term but not in the current one
TABLE FILE HSTUDENTS
PRINT EMPLID
WHERE IN_PREV_TERM EQ 'Y' AND IN_CURR_TERM EQ 'N'
END



That would be more efficient that going to the database twice and in addition you avoid using JOIN and/or MATCH altogether. I'll leave the auto-prompting or whatever approach you use to capture parameters up to you Wink

Hope that helps,
- Neftali.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
neftali,

Can you code this using the gui or have to use the text editor?

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
Oh boy, what was I thinking? My brain seems to start shutting down Friday afternoons.

The code I posted earlier today makes no sense. I'll rework it and will post it back. As for your question, you should be able to use the GUI.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
This should do what I had in mind:

-DEFAULTS &PREV_TERM='2010-01';
-DEFAULTS &CURR_TERM='2010-02';

DEFINE FILE CSPRDSC_STDNT_ENRL
IN_PREV_TERM_IND/I4 = IF STRM EQ '&PREV_TERM' THEN 1 ELSE 0; 
IN_CURR_TERM_IND/I4 = IF STRM EQ '&CURR_TERM' THEN 1 ELSE 0; 
END 
TABLE FILE CSPRDSC_STDNT_ENRL
SUM
        IN_PREV_TERM_IND
        IN_CURR_TERM_IND
BY EMPLID
WHERE STRM EQ '&PREV_TERM' OR 'CURR_TERM'
ON TABLE HOLD AS HSTUDENTS
END

TABLE FILE HSTUDENTS
PRINT EMPLID
WHERE IN_PREV_TERM GT 0 AND IN_CURR_TERM EQ 0
END



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
I agree, you should never go to your database/file multiple times if at all possible.

Good One


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
Glenda, I can see that your Production environment is 5.3.6. Suddenly, I don't feel that lonely anymore Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
Neftali, you're missing a whole pile of amazing features between 5.3.4 and 5.3.6! Big Grin


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
Virtuoso
posted Hide Post
Confused I am?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Razzer



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
neftali,

sorry it took me so long to respond...keep getting pulled away.

In coding this with the gui....is there a way so that other users could run this through the dashboard and select the prev term and current terms themselves or will this always have to be hard coded?


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Expert
posted Hide Post
quote:
WHERE STRM EQ '&PREV_TERM' OR 'CURR_TERM'

Malinda, if Neftali's generic code works for you, there isn't any reason you couldn't prompt for the terms that you want on your report. Or you could prompt for one term and calculate the other in the program.

BTW, there is an ampersand missing in the above line of Neftali's code. It should be &CURR_TERM.


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
Oops, you're right Ginny! Thanks for pointing that out. Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
Thank you all! I think this just might work for me. I have some other values I need to work in as well but this gets me the main population of students I need. I will work from there!

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report 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]Getting a procedure to run 2 reports with different parameters

Copyright © 1996-2020 Information Builders