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.
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?
MalindaThis message has been edited. Last edited by: Malinda,
WebFOCUS 7.6.11 Windows all output (Excel, HTML, PDF)
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, 2007
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)
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).
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
Hope that helps, - Neftali.This message has been edited. Last edited by: njsden,
-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
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)
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.
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)