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'm trying to create a YTD field in a HOLD file and I just can't figure it out. It's got to be simple, but it's been six weeks since I had one thought about WebFOCUS.
This is my test fex:
-SET &ECHO=ALL;
SET BYDISPLAY=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY
-RUN
-*-- Create the master for TEST -------------------------
APP FI DATAMAST DISK test.mas
-RUN
-WRITE DATAMAST FILE=TEST, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S0, $
-WRITE DATAMAST FIELD=DATE1 , ALIAS=E01, USAGE=YYMD, ACTUAL=A08, $
-WRITE DATAMAST FIELD= , ALIAS=E02, USAGE=A01 , ACTUAL=A01, $
-WRITE DATAMAST FIELD=AMT , ALIAS=E03, USAGE=I02 , ACTUAL=A02, $
-*-- Create the data file for TEST ----------------------
FILEDEF TEST DISK test.ftm
-RUN
-WRITE TEST 20101221 15
-WRITE TEST 20101222 05
-WRITE TEST 20101223 20
-WRITE TEST 20101224 35
-WRITE TEST 20101225 15
-WRITE TEST 20110101 10
-WRITE TEST 20110102 20
-WRITE TEST 20110103 10
-WRITE TEST 20110104 05
-WRITE TEST 20110105 10
DEFINE FILE TEST
DATE1_BEG/YYMD = DATEMOV(DATE1, 'BOY');
AMT_YTD/D6 = 0;
END
-RUN
TABLE FILE TEST
SUM
AMT_YTD
BY DATE1_BEG NOPRINT
PRINT
AMT
BY DATE1_BEG NOPRINT
BY DATE1
END
-RUN
-SET &ECHO=ALL;
SET BYDISPLAY=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY
-RUN
-*-- Create the master for TEST -------------------------
APP FI DATAMAST DISK test.mas
-RUN
-WRITE DATAMAST FILE=TEST, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S0, $
-WRITE DATAMAST FIELD=DATE1 , ALIAS=E01, USAGE=YYMD, ACTUAL=A08, $
-WRITE DATAMAST FIELD= , ALIAS=E02, USAGE=A01 , ACTUAL=A01, $
-WRITE DATAMAST FIELD=AMT , ALIAS=E03, USAGE=I02 , ACTUAL=A02, $
-*-- Create the data file for TEST ----------------------
FILEDEF TEST DISK test.ftm
-RUN
-WRITE TEST 20101221 15
-WRITE TEST 20101222 05
-WRITE TEST 20101223 20
-WRITE TEST 20101224 35
-WRITE TEST 20101225 15
-WRITE TEST 20110101 10
-WRITE TEST 20110102 20
-WRITE TEST 20110103 10
-WRITE TEST 20110104 05
-WRITE TEST 20110105 10
DEFINE FILE TEST
DATE1_BOY/YYMD = DATEMOV(DATE1, 'BOY');
AMT_YTD1/D13 = IF DATE1_BOY EQ LAST DATE1_BOY THEN AMT + LAST AMT_YTD1 ELSE AMT;
END
-RUN
TABLE FILE TEST
PRINT
DATE1_BOY
AMT
AMT_YTD
BY DATE1
ON TABLE HOLD AS H001
END
-RUN
TABLE FILE H001
PRINT *
END
-RUN
My brain is slowly leaving the station!
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
Here is another possible solution without a hold file.
DEFINE FILE TEST
DATE1_BEG/YYMD = DATEMOV(DATE1, 'BOY');
AMT_YTD/D6 = 0;
END
-RUN
TABLE FILE TEST
SUM
AMT
COMPUTE CMP_AMT_YTD/D9 = IF DATE1_BEG EQ LAST DATE1_BEG THEN LAST CMP_AMT_YTD + AMT ELSE AMT;
BY DATE1_BEG NOPRINT
BY DATE1
END
-RUN
This message has been edited. Last edited by: <JJI>,