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.
Hello, I am producing this report for several loans (LNKEY). I am simply trying to count up all loans and display in my subfooting. I am creating a field called counter in my define ...but I keep getting 1. could someone assist please
-*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------* -* File Name: PC - FHA - VA Loans Insured Within 60 Days of Closing Metric - 2860 * -* Deccription: This Report is at the Loan Level * -* PC - FHA - VA Loans Insured Within 60 Days of Closing Metric * -* * -* Date Written: 05/25/17 * -* Author: Timothy Brydie * -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* -*APP PATH IBISAMP -RUN SET PRINTPLUS=ON SET ASNAMES=ON -*SET BYDISPLAY=ON SET ALL=ON -SET &ECHO=ALL;
SET MSG=ON -*-SET &STARTDT='01/01/2005'; -*-SET &ENDDT='01/01/2020'; -* -**** 1st day of Previous month.******* -SET &DTE_PREV1=DATECVT((DATEADD((DATECVT(&YYMD,'I8YYMD','YYMD')), - 'M',-1)),'YYMD', 'I8YYMD'); -SET &CURMONTH = EDIT(&YYMD,'999999') | '01'; -SET &PREVMONTH = EDIT(&DTE_PREV1,'999999') | '01'; -* -**** Last day of Previous month **** -SET &CURMTH = EDIT(&DATEYYM, '9999$99') || '01'; -TYPE &CURMTH -SET &LSTDAYPMTH = AYMD(&CURMTH, -1, 'YYMD'); -*
-********* -* Prompts* -********* -PROMPT ='&STARTDT.Start Range in MM/DD/YYYY (Blank for 1st day of Prev Month):.'; -PROMPT ='&ENDDT.End Range in MM/DD/YYYY (Blank for Last day of Prev Month):.'; -IF &STARTDT EQ '' THEN GOTO GETDTS ELSE GOTO FINSQL; -GETDTS -SET &STARTDT=&PREVMONTH ; -SET &ENDDT=&LSTDAYPMTH; -*-RUN -*-EXIT -* -* -FINSQL -*** DB Engine being used SET SQLENGINE=SQLMSS -RUN -* -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------* -*Getting the Data for the report -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* -GETSQL1
SQL Select distinct T1.LNKEY, T1.LOANTYPE, T2.CODEDESC, T3.BORR_NAME, T1.CONTRACTDATE, T4.DATES, T5.GOVT_MIC_LGC_RECEIVED, T1.CASENO FROM EMPOWER_ODS.EMPOWER_WK.LN_MTGTERMS T1 LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_CODES T2 ON T1.LNKEY = T2.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_BORRINFO T3 ON T1.LNKEY = T3.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_EVENTS T4 ON T1.LNKEY = T4.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.U_LN_POSTCLOSING_KEYDATES T5 ON T1.LNKEY = T5.LNKEY WHERE T2.IDX = 5 and T3.WHICHBORR = 1 and T4.EVENTNUM = 314 and T1.LOANTYPE IN (22, 23, 26, 27) GROUP BY T1.LNKEY,T1.LOANTYPE,T2.CODEDESC,T3.BORR_NAME, T1.CONTRACTDATE,T4.DATES,T5.GOVT_MIC_LGC_RECEIVED,T1.CASENO; -* -****Putting data retrieved into Hold File**** TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS LOANS1 END -*-RUN -*-EXIT -* -****Define Components -* DEFINE FILE LOANS1 -*WORKEDISB_DATE/MDYY=HDATE (CONTRACTDATE, 'YYMD' ) ; -*WORKED:RECV_DATE/MDYY=HDATE (DATES, 'YYMD' ) ; -*WORKED:INS_DATE/MDYY=HDATE (GOVT_MIC_LGC_RECEIVED, 'YYMD' ) ;
CALCINS_DATE/MDY=HDATE (GOVT_MIC_LGC_RECEIVED, 'DMYY' ) ; CALCDSB_DATE/MDY=HDATE (CONTRACTDATE, 'DMYY' ) ; -* COMPUTE DATEDIFF/I4 =(CALCINS_DATE - CALCDSB_DATE); -* -**This is the DECODE to Display FHA or VA for Loan TypeE**** DISPLNTYP/A3= DECODE LOANTYPE (22 'FHA', 23 'FHA' 26 'VA' 27 'VA') ; -**Calculating difference between Recieved Date and Contract Date**** PASSFAIL/I4 = DATEDIF(INS_DATE, DISB_DATE, 'D'); -* -***Evaluating value returned from date difference function for the display on the report*** -* DSPASSFAIL/A4 = IF PASSFAIL LT 60 THEN 'Pass' ELSE 'Fail'; -************************************************************* -*DATEDIFF/P21=GOVT_MIC_LGC_RECEIVED-CONTRACTDATE; -*COMPUTE DIFFAMT/I4 = MDY (CALCINS_DATE, CALCDSB_DATE); -*TYPE DIFFAMT -* -*COMPUTE DISP60VAL/A4 = IF DATEDIFF LT '60' THEN 'Fail' ELSE 'Pass'; -*DATE2/MDYY=HDATE(MIN464, 'YYMD'); -*DATE_POST1/MDY=DATE2 ; -*STARTDT/MDYY=DATE_POST1 ; -*ENDDT/MDYY=DATE_POST1 ; -* -*******Creating Fields for Grand Total Section************** -*CNT.LNKEY AS 'Total Numver of Loans' -*******Creating Fields for Grand Total Section**************
COUNTER/P18=IF LNKEY EQ LAST LNKEY THEN COUNTER+1 ELSE 1;
END -*-RUN -*-EXIT
-*COUNTERHRS/D5.1=IF LAST CLOSER EQ CLOSER THEN COUNTERHRS+A464HRS;
TABLE FILE LOANS1 PRINT -*SUM -* COMPUTE MTD_DOLLARS/D8 = DOLLARS ; &NOPRINT -* TLB SUM -*COMPUTE COUNTLNKEY/I9 = CNT.LNKEY ; &NOPRINT -*COMPUTE TRLNKEY/D4 = IF LNKEY EQ LAST LNKEY THEN LAST LNKEY + 1 ELSE 1; NOPRINT
LNKEY AS timtest/I20 LNKEY AS 'Loan Number' DISPLNTYP AS 'Loan Type' CODEDESC AS 'Product Name' BORR_NAME AS 'Borrower Name' DISB_DATE AS 'Disbursed Date' RECV_DATE AS 'Received Date' INS_DATE AS 'Date insured' CASENO AS 'Case Number' BY DSPASSFAIL AS 'Days < 60' -*COMPUTE COUNTER/I4 = IF LNKEY EQ LAST LNKEY THEN COUNTER+1 ELSE 1; NOPRINT
-*COMPUTE DATEDIFF/I4 =(CALCINS_DATE - CALCDCSB_DATE) AS 'TIMTEST' -*DATEDIFF AS 'DATEDIFF' -*BY LNKEY AS 'Loan Number'
-*PASSFAIL AS 'Days < 60' -*COMPUTE PASSFAIL/A4 = IF DATEDIFF LE '60' THEN "Pass'
-*BY SORTFILLER1 AS '' -*SUBFOOT "Averages: -*BY SORTFILLER2 AS '' -*SUBFOOT "Totals:
HEADING "SYNOVUS MORTGAGE CORP" "FHA-VA Loans Insured Within 60 Days of Closing Metric " "Report Date Range: &STARTDT To &ENDDT"
FOOTING BOTTOM "Page of -*"Report generated on &DATEMDYY at
Posts: 38 | Location: Atlanta | Registered: June 14, 2005
First, when posting your code please try to not include all your commented out code. It will simplify the reading.
Second, what I would do is to look at your extracted data (the SQLOUT) in an Excel format per example, without any transformation and keep it aside.
Third, look at your data once the TABLE FILE LOANS1 is performed and displaying all DEFINEd fields to validate their value. Keep result aside.
Fourth, perform manually what you are attempting to do using step three data.
You may need to perform your need in two steps : 1- to produce the data, order it (need to be ordered by LNKEY to be able to test with LAST) and flag it, 2- To count
The following doesn't seems to be valid in Focus :
I decided to do the compute in the print statement. But I come up with a different number everytime I run my code:
TABLE FILE LOANS1 PRINT COMPUTE COUNTER/D4 = IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 1; NOPRINT LNKEY AS 'Loan Number' DISPLNTYP AS 'Loan Type' CODEDESC AS 'Product Name' BORR_NAME AS 'Borrower Name' DISB_DATE AS 'Disbursed Date' RECV_DATE AS 'Received Date' INS_DATE AS 'Date insured' CASENO AS 'Case Number' BY DSPASSFAIL AS 'Days < 60'
Posts: 38 | Location: Atlanta | Registered: June 14, 2005
1) I want the difference in days between (ins_date and disb_date)
2)determine the number that passed and failed 3) divide those amounts by the total number of loans
4) and display those calculations in the footer
5) getting the following error:FOC003) THE FIELDNAME IS NOT RECOGNIZED: PASSNUM;
DISB_DATE/MDYY MISSING ON=HDATE (CONTRACTDATE, 'MDYY' ) ; RECV_DATE/MDYY MISSING ON=HDATE (DATES, 'MDYY' ) ; INS_DATE/MDYY MISSING ON=HDATE (GOVT_MIC_LGC_RECEIVED, 'MDYY' ) ; -* PASSFAIL/I4 = DATEDIF(INS_DATE, DISB_DATE, 'D'); -* -***Evaluating value returned from date difference function for the display on the report*** DSPASSFAIL/A4 = IF PASSFAIL LT 60 THEN 'Pass' ELSE 'Fail'; -* PASSNUM/I4 = IF DSPASSFAIL = 'Pass' THEN 1 ELSE 0; FAILNUM/I4 = IF DSPASSFAIL = 'Fail' THEN 1 ELSE 0; -* -**Calculating difference between Recieved Date and Contract Date****
-* -**This is the DECODE to Display FHA or VA for Loan TypeE**** DISPLNTYP/A3= DECODE LOANTYPE (22 'FHA', 23 'FHA' 26 'VA' 27 'VA') ; -* -****COUNTER/I9=IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 1; END -*-RUN -*-EXIT
-*TABLE FILE LOANS1 -*PRINT * -*ON TABLE PCHOLD FORMAT XLSX AS LOANS2 -*END -*-RUN -*-EXIT
TABLE FILE LOANS1 PRINT SUM PASSNUM; NOPRINT SUM FAILNUM; NOPRINT COMPUTE COUNTER/I4 = IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 0; NOPRINT COMPUTE PCTPASS/I4 = COUNTER/PASSNUM; NOPRINT COMPUTE PCTFAIL/I4 = COUNTER/FAILNUM; NOPRINT LNKEY AS 'Loan Number' DISPLNTYP AS 'Loan Type' CODEDESC AS 'Product Name' BORR_NAME AS 'Borrower Name' DISB_DATE AS 'Disbursed Date' RECV_DATE AS 'Received Date' INS_DATE AS 'Date insured' CASENO AS 'Case Number' BY DSPASSFAIL AS 'Days < 60'
HEADING "SYNOVUS MORTGAGE CORP" "FHA-VA Loans Insured Within 60 Days of Closing Metric " "Report Date Range: &STARTDT To &ENDDT"
FOOTING BOTTOM "Page of -*"Report generated on &DATEMDYY at
Posts: 38 | Location: Atlanta | Registered: June 14, 2005
The above is some what invalid. You must either use PRINT or SUM. If you want to sum fields use SUM not PRINT.
SUM
PASSNUM; NOPRINT
FAILNUM; NOPRINT
Maybe some basic Focus programming training may help you ?
If PASSNUM is still giving you a "None recognized" error it's because one or more field used to defined it may be invalid. As I previously suggested, display the data without DEFINEd fields that cause issue. Try to display all fields and validate each of them one by one. This is a debugging technique where you first include/display table data, then add DEFINEd field one by one until you have everything good.
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, 2013
one last thing: I get the error:foc3208, unterminated statmnt in the style sheet, and I can not find it!
-*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------* -* File Name: PC - FHA - VA Loans Insured Within 60 Days of Closing Metric - 2860 * -* Deccription: This Report is at the Loan Level * -* PC - FHA - VA Loans Insured Within 60 Days of Closing Metric * -* * -* Date Written: 05/25/17 * -* Author: Timothy Brydie * -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* -*APP PATH IBISAMP -RUN SET PRINTPLUS=ON SET ASNAMES=ON -*SET BYDISPLAY=ON; SET ALL=ON -SET &ECHO=ALL; SET MSG=ON
-**** 1st day of Previous month.******* -SET &DTE_PREV1=DATECVT((DATEADD((DATECVT(&YYMD,'I8YYMD','YYMD')), - 'M',-1)),'YYMD', 'I8YYMD'); -SET &CURMONTH = EDIT(&YYMD,'999999') | '01'; -SET &PREVMONTH = EDIT(&DTE_PREV1,'999999') | '01'; -* -**** Last day of Previous month **** -SET &CURMTH = EDIT(&DATEYYM, '9999$99') || '01'; -*-TYPE &CURMTH -SET &LSTDAYPMTH = AYMD(&CURMTH, -1, 'YYMD'); -* -*-TYPE Previous Month beginning = &PREVMONTH -*-TYPE Previous Month Ending = &LSTDAYPMTH -********* -* Prompts* -********* -PROMPT ='&STARTDT.Start Range in MM/DD/YYYY (Blank for 1st day of Prev Month):.'; -PROMPT ='&ENDDT.End Range in MM/DD/YYYY (Blank for Last day of Prev Month):.'; -IF &STARTDT EQ '' THEN GOTO GETDTS ELSE GOTO FINSQL; -GETDTS -SET &STARTDT=&PREVMONTH ; -SET &ENDDT=&LSTDAYPMTH; -*-RUN -*-EXIT -* -* -FINSQL -*** DB Engine being used SET SQLENGINE=SQLMSS -RUN -* -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------* -*Getting the Data for the report -*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* -GETSQL1 SQL Select distinct T1.LNKEY, T1.LOANTYPE, T2.CODEDESC, T3.BORR_NAME, T1.CONTRACTDATE, T4.DATES, T5.GOVT_MIC_LGC_RECEIVED, T1.CASENO FROM EMPOWER_ODS.EMPOWER_WK.LN_MTGTERMS T1 LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_CODES T2 ON T1.LNKEY = T2.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_BORRINFO T3 ON T1.LNKEY = T3.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.LN_EVENTS T4 ON T1.LNKEY = T4.LNKEY LEFT OUTER JOIN EMPOWER_ODS.EMPOWER_WK.U_LN_POSTCLOSING_KEYDATES T5 ON T1.LNKEY = T5.LNKEY WHERE T2.IDX = 5 and T3.WHICHBORR = 1 and T4.EVENTNUM = 314 and T1.LOANTYPE IN (22, 23, 26, 27) GROUP BY T1.LNKEY,T1.LOANTYPE,T2.CODEDESC,T3.BORR_NAME, T1.CONTRACTDATE,T4.DATES,T5.GOVT_MIC_LGC_RECEIVED,T1.CASENO; -* -****Putting data retrieved into Hold File**** TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS LOANS1 END -*-RUN -*-EXIT -* -****Define Components DEFINE FILE LOANS1 -* DISB_DATE/MDYY MISSING ON=HDATE (CONTRACTDATE, 'MDYY' ) ; RECV_DATE/MDYY MISSING ON=HDATE (DATES, 'MDYY' ) ; INS_DATE/MDYY MISSING ON=HDATE (GOVT_MIC_LGC_RECEIVED, 'MDYY' ) ; -* PASSFAIL/I4 = DATEDIF(INS_DATE, DISB_DATE, 'D'); -* -***Evaluating value returned from date difference function for the display on the report*** DSPASSFAIL/A4 = IF PASSFAIL LT 60 THEN 'Pass' ELSE 'Fail';
-* PASSNUM/I4 = IF DSPASSFAIL EQ 'Pass' THEN 1 ELSE 0; TTLPASS/I4=TTLPASS+PASSNUM; FAILNUM/I4 = IF DSPASSFAIL EQ 'Fail' THEN 1 ELSE 0; TTLFAIL/I4=TTLFAIL+FAILNUM; -*NH MOVED YOUR COUNTER TO DEFINE COUNTER/I4 = IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 0; PERCENTPASS/D6.2=TTLPASS/COUNTER; PERCENTFAIL/D6.2=TTLFAIL/COUNTER; SORTFILLER/I5=1;
-*PASSNUM/I4 = IF DSPASSFAIL = 'Pass' THEN 1 ELSE 0; -*FAILNUM/I4 = IF DSPASSFAIL = 'Fail' THEN 1 ELSE 0; -* -**Calculating difference between Recieved Date and Contract Date**** -* -**This is the DECODE to Display FHA or VA for Loan Type to print on the Report**** DISPLNTYP/A3= DECODE LOANTYPE (22 'FHA', 23 'FHA' 26 'VA' 27 'VA') ; -* -****COUNTER/I9=IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 1; END -*-RUN -*-EXIT
-*TABLE FILE LOANS1 -*PRINT * -*ON TABLE PCHOLD FORMAT XLSX AS LOANS2 -*END -*-RUN -*-EXIT
-DEFAULTH &WF_SUMMARY='Summary'; -DEFAULTH &WF_TITLE='WebFOCUS Report' TABLE FILE LOANS1 PRINT -*SUM PASSNUM; NOPRINT -*SUM FAILNUM; NOPRINT -*COMPUTE COUNTER/I4 = IF LNKEY NE LAST LNKEY THEN COUNTER+1 ELSE 0; NOPRINT -*COMPUTE PCTPASS/I4 = COUNTER/PASSNUM; NOPRINT -*COMPUTE PCTFAIL/I4 = COUNTER/FAILNUM; NOPRINT
TTLPASS NOPRINT FAILNUM NOPRINT TTLFAIL NOPRINT PERCENTPASS NOPRINT PERCENTFAIL NOPRINT LNKEY AS 'Loan Number' DISPLNTYP AS 'Loan Type' CODEDESC AS 'Product Name' BORR_NAME AS 'Borrower Name' DISB_DATE AS 'Disbursed Date' RECV_DATE AS 'Received Date' INS_DATE AS 'Date insured' CASENO AS 'Case Number' DSPASSFAIL AS 'Days < 60' BY SORTFILL SUBTOTAL PERCENTPASS PERCENTFAIL
HEADING "SYNOVUS MORTGAGE CORP" "FHA-VA Loans Insured Within 60 Days of Closing Metric " "Report Date Range: &STARTDT To &ENDDT"
FOOTING BOTTOM "Page of -*"Report generated on &DATEMDYY at
Posts: 38 | Location: Atlanta | Registered: June 14, 2005
1- shouldn't have an asterisk at the end of the above line. 2- you are missing the style ending key word and the TABLE FILE ending key word in both places. Should look like:
TABLE FILE abc
....
ON TABLE SET STYLE *
...
ENDSTYLE
END
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, 2013