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.
The above data is generated by an SQL. Now i need to print distinct LT ID count and distinct LY ID count. I am able to get the distinct count for LT ID since it is sorted. But the problem arises with LY ID. This is what i've coded.
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TEMPLT
FORMAT FOCUS
END
OFFLINE
-*
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LY_CNT
BY LY_ID AS TEMP_LY_ID
ON TABLE HOLD AS TEMPLY
END
-*
DEFINE FILE TEMPLT
TOT_DST_LT_CNT/I5 = IF LT_ID EQ LAST LT_ID
THEN LAST TOT_DST_LT_CNT
ELSE LAST TOT_DST_LT_CNT + 1;
TOT_DST_LY_CNT/I5 MISSING ON = DB_LOOKUP(TEMPLY,LY_ID,TEMP_LY_ID,TOT_LY_CNT);
END
OFFLINE
-*
TABLE FILE TEMPLT
PRINT
LT_ID AS 'LT_ID'
LY_ID AS 'LY_ID'
TOT_DST_LT_CNT NOPRINT
TOT_DST_LY_CNT NOPRINT
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"LT COUNT: <20 <TOT_DST_LT_CNT"
"LY COUNT: <20 <TOT_DST_LY_CNT"
END
-RUN
FIN
When i execute this, i get this message
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"CLIENT COUNT: <20 <TOT_DST_LT_CNT"
"POLICY COUNT: <20 <TOT_DST_LY_CNT"
ON TABLE SET STYLE *
(FOC1109) DATA IS NOT PRESENT FOR FOCUS FILE : TEMPLY
...RETRIEVAL KILLED
(FOC026) THE REPORT IS NO LONGER AVAILABLE
Can anyone help me in figuring this out. The task looks quite simple. Since im new to webfocus, i dont quite understand what might the problem be.
Thanks in Advance.This message has been edited. Last edited by: <Kathryn Henning>,
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TEMPLT FORMAT FOCUS
END
-*
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS 'TOT_LY_CNT'
BY LY_ID AS 'TEMP_LY_ID'
ON TABLE HOLD AS TEMPLY
-* ensure asnames are used in hold
ON TABLE SET ASNAMES ON
-* only hold directly referenced columns
ON TABLE SET HOLDLIST PRINTONLY
END
-*
DEFINE FILE TEMPLT
TOT_DST_LT_CNT/I5 = IF LT_ID EQ LAST LT_ID
THEN LAST TOT_DST_LT_CNT
ELSE LAST TOT_DST_LT_CNT + 1;
TOT_DST_LY_CNT/I5 MISSING ON = DB_LOOKUP(TEMPLY,LY_ID,TEMP_LY_ID,TOT_LY_CNT);
END
-*
TABLE FILE TEMPLT
PRINT
LT_ID AS 'LT_ID'
LY_ID AS 'LY_ID'
TOT_DST_LT_CNT NOPRINT
TOT_DST_LY_CNT NOPRINT
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"LT COUNT: <20 <TOT_DST_LT_CNT"
"LY COUNT: <20 <TOT_DST_LY_CNT"
END
-RUN
On a side note, have you tried just doing a CNT.DST against both columns from the original table?
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Maybe try to do the counts separately (in separate hold files if necessary) and store the value in a variable to be used by your final report for displaying?
Kevin Patterson Appalachian State University WebFOCUS 7.7.03 Windows, All Outputs
If it were me I would write it something like this:
DEFINE FILE SQLOUT
BLANK/A1=' ';
END
TABLE FILE SQLOUT
PRINT *
BY BLANK
ON TABLE HOLD AS TEMPLT
FORMAT FOCUS INDEX BLANK
END
OFFLINE
-*
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LY_CNT
BY BLANK
ON TABLE HOLD AS TEMP_LY FORMAT FOCUS INDEX BLANK
END
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LT_CNT
BLANK
ON TABLE HOLD AS TEMP_LT FORMAT FOCUS INDEX BLANK
END
-*
JOIN BLANK IN TEMPLT TO BLANK IN TEMP_LY AS J0
JOIN BLANK IN TEMPLT TO BLANK IN TEMP_LT AS J1
-*
TABLE FILE TEMPLT
PRINT
LT_ID AS 'LT_ID'
LY_ID AS 'LY_ID'
TOT_LT_CNT NOPRINT
TOT_LY_CNT NOPRINT
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"LT COUNT: <20 <FST.TOT_LT_CNT"
"LY COUNT: <20 <FST.TOT_LY_CNT"
END
-RUN
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013
Originally posted by eric.woerle: If it were me I would write it something like this:
DEFINE FILE SQLOUT
BLANK/A1=' ';
END
TABLE FILE SQLOUT
PRINT *
BY BLANK
ON TABLE HOLD AS TEMPLT
FORMAT FOCUS INDEX BLANK
END
OFFLINE
-*
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LY_CNT
BY BLANK
ON TABLE HOLD AS TEMP_LY FORMAT FOCUS INDEX BLANK
END
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LT_CNT
BLANK
ON TABLE HOLD AS TEMP_LT FORMAT FOCUS INDEX BLANK
END
-*
JOIN BLANK IN TEMPLT TO BLANK IN TEMP_LY AS J0
JOIN BLANK IN TEMPLT TO BLANK IN TEMP_LT AS J1
-*
TABLE FILE TEMPLT
PRINT
LT_ID AS 'LT_ID'
LY_ID AS 'LY_ID'
TOT_LT_CNT NOPRINT
TOT_LY_CNT NOPRINT
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"LT COUNT: <20 <FST.TOT_LT_CNT"
"LY COUNT: <20 <FST.TOT_LY_CNT"
END
-RUN
Hi Eric,
I tried your way and i got the following error message
TABLE FILE SQLOUT
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
BYPASSING TO END OF COMMAND
PRINT *
ON TABLE HOLD AS TEMPCLI
FORMAT FOCUS
END
If Eric's code does not work, then you will need to start over again and test your original code step by step. Everyone has been using the code that you originally posted. i.e:
quote:
The above data is generated by an SQL. Now i need to print distinct LT ID count and distinct LY ID count. I am able to get the distinct count for LT ID since it is sorted. But the problem arises with LY ID. This is what i've coded.
TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS TEMPLT FORMAT FOCUS END
So start by just running the code above. If this does not work, then first fix this error. Only then will you be able to test the next set of code. ---- Also - have you tried to run Daniel's sample code yet?
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Thank you for your input. I have come to the conclusion that there is some problem with the SQL query which generates the original data. I am relooking at that. Because i have another requirement wherein i run my WebFOCUS query against a flat file and it works without any errors.
quote:
Also - have you tried to run Daniel's sample code yet?
Hi Daniel, Sorry i forgot to reply to your input. I am confident that will work but the problem is i cannot hardcode the input like that since it is generated during runtime by the SQL.
quote:
Why not doing a CNT.DST on both fields?
That is also one of the many things i tried before coming to this forum. I keep getting the same error i mentioned in the original post.
I don't think Daniel meant for to use the code with the hardcoded values - but just try to run it and let us know whether you get the result that you want. If it runs and the two counts are displayed, then the problem isn't to do with the CNT.DST code.
In terms of the error on your original post i.e. (FOC1109) DATA IS NOT PRESENT FOR FOCUS FILE : TEMPLY
This error is generated by the following code going wrong:
TABLE FILE TEMPLT
SUM CNT.DST.LY_ID AS TOT_LY_CNT
BY LY_ID AS TEMP_LY_ID
ON TABLE HOLD AS TEMPLY
END
This could be caused by one of two things: 1) Try to change: ON TABLE HOLD AS TEMPLY FORMAT FOCUS 2) Perhaps there is no data, because the first step didn't work
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Ok i modified my code the following way and got rid of the "DATA IS NOT PRESENT FOR FOCUS FILE" error. Please see below code
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TEMPLT
FORMAT FOCUS
END
OFFLINE
-*
TABLE FILE TEMPLT
SUM CNT.DST.LT_ID AS TOT_LT_CNT
BY LT_ID AS TEMP_LT_ID
ON TABLE HOLD AS TEMPCV
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
END
DEFINE FILE TEMPLT
TOT_DST_LT_CNT/I5 MISSING ON = DB_LOOKUP(TEMPCV,LT_ID,TEMP_LT_ID,TOT_LT_CNT);
END
OFFLINE
-*
TABLE FILE TEMPLT
PRINT
LT_ID AS 'LT ID'
LY_ID AS 'LY ID'
TOT_DST_LT_CNT NOPRINT
AND COMPUTE
TOT_DST_LY_CNT/I5 = IF LY_ID EQ LAST LY_ID
THEN LAST TOT_DST_LY_CNT
ELSE LAST TOT_DST_LY_CNT + 1; AS LY_COUNT NOPRINT
-*if is sort by LY ill get the correct LY count. If i sort by LT ill get the correct LT count. I tried sorting by LT then LY but it doesnt work.
BY LY_ID NOPRINT
FOOTING CENTER
"**END OF PAGE**"
ON TABLE SET PAGE-NUM ON
ON TABLE SUBFOOT
"LT COUNT: <20 <TOT_DST_LT_CNT"
"LY COUNT: <20 <TOT_DST_LY_CNT"
ON TABLE SET STYLE *
TYPE=TITLE, JUSTIFY=CENTER, STYLE=BOLD, $
TYPE=DATA, GRID=OFF, $
END
-RUN
FIN
When i executed this, i got the below error message
ON TABLE SUBFOOT
"LT COUNT: <20 <TOT_DST_LT_CNT"
"LY COUNT: <20 <TOT_DST_LY_CNT"
ON TABLE SET STYLE *
(FOC1070) VALUE FOR JOIN 'FROM' FIELD OUT OF SEQUENCE. RETRIEVAL ENDED
...RETRIEVAL KILLED
(FOC026) THE REPORT IS NO LONGER AVAILABLE
Please advise.
Thanks, AjmalThis message has been edited. Last edited by: Ajmal18,