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]Need some Variable understanding

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[solved]Need some Variable understanding
 Login/Join
 
Platinum Member
posted
Being a newbie I often times need clarification on the process. This question pertains to variables and pulling in dates from another source.

I'm running a fex that pulls a couple of dates from another table. I have code that sets another variable equal to the value of the dates in the other table, however I don't use the variables anywhere else in the fex, yet the dates are still pulled in and used. How is this? The variables in question are &PDFY AND &PPER. The values I'm using are in &VPSTPDFY AND &VPOSTPER.

-SET ECHO = ALL

-?&
-DEFAULTH &WFFMT='HTML'

SET PRINTPLUS = ON
-INCLUDE IBFS:/WFC/Repository/TonyTest/PFSKPIs/pfs_getdate_vars.fex

-DEFAULTH &FM=' '
-DEFAULTH &VPSTPDFY = ' '
-DEFAULTH &VPOSTPER = ' '
-READFILE PFSRPTPD
-SET &CFM = '&FM.EVAL';
-SET &PDFY = '&VPSTPDFY.EVAL';
-SET &PPER = '&VPOSTPER.EVAL';

DEFINE FILE PFSAR ADD
HOLD_BLANK/A1=' ';
END
TABLE FILE PFSAR
PRINT
    COMPUTE CNTR/I2=LAST CNTR + 1; NOPRINT
    COMPUTE HOLD_MONTH/P2= DECODE CNTR(1 01
  									 2 02
									 3 03
									 4 04
									 5 05
									 6 06
									 7 07
									 8 08
									 9 09
									 10 10
									 11 11
									 ELSE 12);
BY HOLD_BLANK
BY FM NOPRINT
WHERE RECORDLIMIT EQ 12
ON TABLE HOLD AS MACGYVER FORMAT FOCUS INDEX HOLD_BLANK
END

JOIN BLANK WITH FM IN PFSAR TO ALL HOLD_BLANK IN MACGYVER AS J1
DEFINE FILE PFSAR
BLANK/A1 = ' ';
END

TABLE FILE PFSAR
SUM
	     COMPUTE YTD_PAY/D10CB = IF FM EQ HOLD_MONTH THEN PFSAR.PFSAR.PAYMENTS ELSE 0;
		 COMPUTE YTD_CHAR/D10CB = IF FM EQ HOLD_MONTH THEN PFSAR.PFSAR.CHARGES ELSE 0;
BY  PFSAR.PFSAR.PSTPDFY
BY  PFSAR.PFSAR.FM
BY  PFSAR.PFSAR.FYMTH
BY  HOLD_MONTH
WHERE ( PFSAR.PFSAR.PSTPDFY GE ((&VPSTPDFY.(FIND PFSRPTPD.PFSRPTPD.VPSTPDFY IN PFSRPTPD).VPSTPDFY:.)-2)
AND   PFSAR.PFSAR.POSTPERIOD LE (&VPOSTPER.(FIND PFSRPTPD.PFSRPTPD.VPOSTPER IN PFSRPTPD).VPOSTPER:.));
ON TABLE NOTOTAL
ON TABLE HOLD AS H1
END

TABLE FILE H1

SUM YTD_PAY
 	 COMPUTE YTDPAY/D10CB MISSING ON  = IF MAX.HOLD_MONTH EQ 1 THEN YTD_PAY ELSE
	                    IF MAX.PSTPDFY EQ &P2FY THEN YTD_PAY + LAST YTDPAY ELSE
	 					IF MAX.PSTPDFY EQ &PFY THEN YTD_PAY + LAST YTDPAY ELSE
						IF MAX.PSTPDFY EQ &CFY AND MAX.HOLD_MONTH LE &CFM THEN YTD_PAY + LAST YTDPAY
						ELSE 0;

	YTD_CHAR
	COMPUTE YTDCHAR/D10CB MISSING ON  = IF MAX.HOLD_MONTH EQ 1 THEN YTD_CHAR ELSE
	                    IF MAX.PSTPDFY EQ &P2FY THEN YTD_CHAR + LAST YTDCHAR ELSE
	 					IF MAX.PSTPDFY EQ &PFY THEN YTD_CHAR + LAST YTDCHAR ELSE
						IF MAX.PSTPDFY EQ &CFY AND MAX.HOLD_MONTH LE &CFM THEN YTD_CHAR + LAST YTDCHAR
						ELSE 0;


BY  PSTPDFY
BY  HOLD_MONTH
ON TABLE HOLD AS H1_TREND
END

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


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Member
posted Hide Post
What does your INCLUDE fex look like?


WebFOCUS 8
Windows, All Outputs
 
Posts: 4 | Registered: December 14, 2015Report This Post
Platinum Member
posted Hide Post
Here's the include fex.

SET LINES=999999
TABLE FILE PFSRPTPD
PRINT
     VPSTPDFY
WHERE READLIMIT EQ 1
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS 'VARIABLEFY' FORMAT ALPHA
END
FILEDEF VARIABLFY DISK ..\variablefy.ftm
-RUN
-READ VARIABLEFY &CFY.A5.
-SET &PFY = &CFY -1;
-SET &P2FY = &CFY - 2;  


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
Your code is a little confusing.

  • The included fex reads file PFSRPTPD (using TABLE FILE) and creates variables &CFY, &PFY and &P2FY.
  • The main fex also reads file PFSRPTPD (using -READFILE). This will create a variable called &VPSTPDFY and maybe other variables (&VPOSTPER?).
  • Then the main fex creates variables &PDFY and &PPER (which are equivalent to &VPSTPDFY and &VPOSTPER.
  • The main fex filters data with this:
    WHERE ( PFSAR.PFSAR.PSTPDFY GE ((&VPSTPDFY.(FIND PFSRPTPD.PFSRPTPD.VPSTPDFY IN PFSRPTPD).VPSTPDFY:.)-2)
    AND PFSAR.PFSAR.POSTPERIOD LE (&VPOSTPER.(FIND PFSRPTPD.PFSRPTPD.VPOSTPER IN PFSRPTPD).VPOSTPER:.));

What exactly is the problem?


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
Platinum Member
posted Hide Post
Hey Francis,
I was in the process of sending you specifically a message with this question since I noticed you were on the board.

There really isn't a problem, it's more of a question. I don't actually use &PDFY and &PPER anywhere in the fex, yet if I don't have them then I have to supply the values for &VPSTPDFY and &VPOSTPER. I'm just trying to figure out why including them allows me to run the fex without any prompts.
In creating the fex I added:
-DEFAULTH &VPSTPDFY = ' '
-DEFAULTH &VPOSTPER = ' '  


but then I was prompted for the values, even though the correct values are showing in the prompts. I had to select Run.
However, when I also added:
-SET &PDFY = '&VPSTPDFY.EVAL';
-SET &PPER = '&VPOSTPER.EVAL';


Then the report ran without any prompts. I was just trying to figure out the "why/how" behind it all.


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
I cannot explain why you would be getting prompted for two variables that you don't use.

I would -SET &ECHO='ALL'; Perhaps there's some extraneous code executing...


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
Expert
posted Hide Post
quote:
PFSRPTPD

What are the column names in this file?


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
Platinum Member
posted Hide Post
VPOSTPDDAT, VPOSTPER, POSTYYY, VPOSTMONTH, VPSTPDFY, FYPDBEG, FYPDEND, FM, PDSHORTNM, FYFM

I'll go back and see what I can find code-wise.


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Platinum Member
posted Hide Post
Ok, I went back and commented out:
-*-SET &PDFY = '&VPSTPDFY.EVAL';
-*-SET &PPER = '&VPOSTPER.EVAL';  

and it runs just fine. When creating this fex I had to have it in there to run properly.
[FRUSTRATION] What's up with that? [/FRUSTRATION]


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report 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]Need some Variable understanding

Copyright © 1996-2020 Information Builders