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] Generating and Printing Grades

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Generating and Printing Grades
 Login/Join
 
Member
posted
I have a WebFocus program that pulls grades. The issue is the table has repeating. Therefore, if the person took a course, received a grade, then the grade was updated or change, then there are several entries. I want it to give me the last (final) grade. In one of the tables there is a field called SHRTCKG_GRDE_CODE_FINAL but it pulls all the entries.

I need help so that it gives me the final grade per person per course per term.

Below is the program and some of the output:

I have adjusted it so that you can see the multiple entries for grades.

SET ALL = ON

JOIN PIDM_KEY IN AS_STUDENT_REGISTRATION_DETAIL TO SHRTCKG_PIDM IN SHRTCKG

DEFINE FILE AS_STUDENT_REGISTRATION_DETAIL
SEM/A15 = IF EDIT('&TERM', '$$$$99') EQ '60' THEN 'MAIN FALL' ELSE
IF EDIT('&TERM', '$$$$99') EQ '20' THEN 'MAIN SPRING' ELSE
IF EDIT('&TERM', '$$$$99') EQ '30' THEN 'MAIN SUMMER I' ELSE
IF EDIT('&TERM', '$$$$99') EQ '40' THEN 'MAIN SUMMER II' ELSE
IF EDIT('&TERM', '$$$$99') EQ '65' THEN 'FT SAM Fall/Win' ELSE
IF EDIT('&TERM', '$$$$99') EQ '25' THEN 'FT SAM Win/Spr' ELSE
IF EDIT('&TERM', '$$$$99') EQ '35' THEN 'FT SAM Spr/Sum' ELSE
IF EDIT('&TERM', '$$$$99') EQ '45' THEN 'FT SAM Sum/Fall' ELSE ' ';
YR1/A4 = EDIT('&TERM', '9999');
COURSE/A12 = SUBJ_CODE || COURSE_NUMBER || SECTION_NUMBER ;
COURSE1/A12 = IF SUBJ_CODE = 'CSC' THEN EDIT (COURSE , '999-999-999') ELSE
IF SUBJ_CODE = 'MIS' THEN EDIT (COURSE , '999-999-999') ELSE
IF SUBJ_CODE = 'HCM' THEN EDIT (COURSE , '999-999-999') ELSE
IF SUBJ_CODE = 'ART' THEN EDIT (COURSE , '999-999-999') ELSE EDIT( COURSE , '9999-999-999' ) ;
INSTRUCTOR/A77 = INSTRUCTOR_LAST_NAME || (', ' | INSTRUCTOR_FIRST_NAME);
INSTNAME/A20 = EDIT(INSTRUCTOR, '99999999999999999999');
STUDENT/A77 = LAST_NAME || (', ' | FIRST_NAME);
STUNAME/A30 = EDIT(STUDENT, '999999999999999999999999999999');
END


TABLE FILE AS_STUDENT_REGISTRATION_DETAIL
PRINT SHRTCKG_GRDE_CODE_FINAL AS 'GRADE'
BY COURSE1 AS 'COURSE'
BY INSTRUCTOR
BY CRN_KEY AS 'CRN'
BY STUDENT
BY ID
BY HIGHEST SHRTCKG_ACTIVITY_DATE
BY CLAS_DESC AS 'CLASS'
BY COURSE1 NOPRINT
WHERE TERM_CODE_KEY EQ '&TERM'
AND SHRTCKG_TERM_CODE EQ '&TERM'
AND REGISTERED_IND EQ 'Y'
AND ENROLLED_IND EQ 'Y'
AND SHRTCKG_GMOD_CODE EQ '0'
AND SECTION_NUMBER EQ 'D1' OR 'D2' OR 'D3' OR 'D4' OR 'D5' OR 'DE' OR 'D0' OR 'D5' OR 'D6' OR 'D41' OR 'D42' OR 'D43' OR 'D44' OR 'D45' OR 'D46' OR 'D47' OR 'D48' OR 'D49' OR '0D1' OR '0D2' OR '0D3' OR '0D4' OR '0D5'
AND COURSE_NUMBER IS-FROM '100' TO '299'
END

-*********This is a sample output *************-

CHEM-101-D1 Brown, Laura 3038 Alleye, Shari D14781867 2016/08/26 00:00:00 Senior WUA
WUA
2016/08/08 11:00:15 Senior FN
2016/08/08 10:59:49 Senior FN
Amko, Sam D14751203 2016/08/08 10:59:49 Senior A
2016/08/04 07:47:02 Senior B
Beck, Danita D14751887 2016/08/08 10:59:50 Senior A
Blow, Tim D14751696 2016/08/26 00:00:00 Senior WUA
WUA
2016/08/08 10:59:56 Senior FN
2016/08/08 10:59:50 Senior FN
Cole, Mya D14767317 2016/08/26 00:00:00 Sophomore WUA
WUA
2016/08/08 10:59:50 Sophomore FN
2016/08/04 07:46:52 Sophomore FN

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 27 | Registered: January 10, 2017Report This Post
Virtuoso
posted Hide Post
Please us the code tag, last icon from ribbon
</>
to embrace your code and sample data.

It gives you ability to indent and align.

Also what is what on your sample output. There is no title.

You have twice BY COURSE1 where the second is NOPRINT, so no need for it since the first one is BY COURSE1 why have it as the last one and NOPRINT ?

You PRINT SHRTCKG_GRDE_CODE_FINAL so all possible value will be displayed.
You may need an aggregation verb such as MAX or LST (or use SUM instead of PRINT) but since it's an alpha field, may not work as expected.
It will be better if you can have a numeric grade matching the alpha one. That way you'll be able to
 PRINT MAX.NUMGRADE NOPRINT
       SHRTCKG_GRDE_CODE_FINAL AS 'GRADE'

But still, it depends on the BY fields used. That could make the whole difference.

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
TABLE FILE AS_STUDENT_REGISTRATION_DETAIL
SUM
SHRTCKG_GRDE_CODE_FINAL AS 'GRADE'
BY COURSE1 AS 'COURSE'
BY INSTRUCTOR
BY CRN_KEY AS 'CRN'
BY STUDENT
BY ID
BY HIGHEST 1 SHRTCKG_ACTIVITY_DATE
BY CLAS_DESC AS 'CLASS'
BY COURSE1 NOPRINT
WHERE TERM_CODE_KEY EQ '&TERM'
AND SHRTCKG_TERM_CODE EQ '&TERM'
AND REGISTERED_IND EQ 'Y'
AND ENROLLED_IND EQ 'Y'
AND SHRTCKG_GMOD_CODE EQ '0'
AND SECTION_NUMBER EQ 'D1' OR 'D2' OR 'D3' OR 'D4' OR 'D5' OR 'DE' OR 'D0' OR 'D5' OR 'D6' OR 'D41' OR 'D42' OR 'D43' OR 'D44' OR 'D45' OR 'D46' OR 'D47' OR 'D48' OR 'D49' OR '0D1' OR '0D2' OR '0D3' OR '0D4' OR '0D5'
AND COURSE_NUMBER IS-FROM '100' TO '299'
END


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
Thank you so much Tom.

I think that did the trick.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: January 10, 2017Report 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] Generating and Printing Grades

Copyright © 1996-2020 Information Builders