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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at email@example.com and provide your corporate email address, company, and name.
Can anyone tell me if there is a way to add rows to a hold table. In this case I need to run the same procedure x number of times and have it right one row each time but retain the rows until the loop is completed when I can print themThis message has been edited. Last edited by: Kerry,
You cannot do what GamP suggested with a FOCUS DB. Either change your HOLD to a ALPHA HOLD file and then use GamP's suggestion, or use something like for a FOCUS DB HOLD file:
TABLE FILE CAR
ON TABLE HOLD AS HCAR FORMAT FOCUS INDEX COUNTRY
MODIFY FILE HCAR
FREEFORM COUNTRY/10 SALES/6
ON MATCH REJECT
ON NOMATCH INCLUDE
TABLE FILE HCAR
In addition to Francis' suggestion, you can also do something like that:
TABLE FILE CAR SUM SALES BY COUNTRY ON TABLE HOLD AS XHOLD1 END -RUN TABLE FILE CAR PRINT COMPUTE COUNTRY/THEFORMAT='BLAH'; COMPUTE SALES/THEFORMAT=123456; WHERE RECORDLIMIT EQ 1 ON TABLE HOLD AS XHOLD2 END -RUN TABLE FILE XHOLD1 PRINT SALES COUNTRY MORE FILE XHOLD2 END
Regards,This message has been edited. Last edited by: ferran,
Thanks for the responses. Maybe it will help if I explain my full dilemma.
I have a FEX that computes a complex average. It works on a date and I need it to run for 28 different dates.
-SET &days = 28; -REPEAT AVG_FOR_DAY WHILE &days GT 0;
-SET &days = &days - 1; -AVG_FOR_DAY
So it runs 28 times and writes over the FOCUS HOLDFILE 28 times so when the loop is done I only have my last date average. We are ORACLE and I don't believe the FILEDEF will work for me. I need to somehow be able to retain the 28 values in a table.
If I just have it pass me back the values as parameters how do I write them 28 times into some kind of table?
There are several ways of taking care of this, here's one:
Before the -REPEAT, allocate the HOLDFILE with the append tag:
FILEDEF HOLDFILE DISK HOLDFILE.FTM (APPEND
This will append the 28 files together.
TABLE FILE CAR
ON TABLE HOLD AS H001 FORMAT ALPHA
-SET &CCOUNT = &LINES;
FILEDEF H002 DISK H002.FTM (APPEND
-REPEAT ENDREP1 &CCOUNT TIMES
-*== AVERAGING_FEX START =====
-READ H001 NOCLOSE &COUNTRY.A10.
TABLE FILE CAR
SALES BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'
ON TABLE HOLD AS H002 FORMAT ALPHA
-*== AVERAGING_FEX END =====
TABLE FILE H002
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
Your AVERAGING_FEX could look something like this:
FILEDEF D_A DISK D_A.FTM (APPEND
TABLE FILE DLY_AVGS
ON TABLE HOLD AS D_A FORMAT ALPHA
At the end of your loop you will now have a fixed record alpha file, containing all 28 records. You can do with this file whatever you wish, you can also TABLE it and hold it as focus format if you really need that.
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
How would i write this modify syntax for a Hold FIle with Multiple Sort Phrases, the intent is to add a line of data to make the graphs consistent.
The HOLD looks like: TABLE FILE BWHOLD_CCA_CHART PRINT VOLUME FIXED_COST__EXCL__DEP_ PLANT_SHORT PLANT_CURR PLANT_COUNTRY HIER STRUCTURE COSTCENTER__0PROFIT_CTR_MEDIUM_NAME BW_STATISTICAL_KEY_FIGURES_LEVEL_01 BW_STATISTICAL_KEY_FIGURES_LEVEL_02/ BY COST_STRUCTURE_LEVEL_00 BY FISCYEAR_NAME BY MONTH_CSV BY DATE_CSV BY FISCPER3_NAME BY PERIOD BY CURRENCY_NAME BY CURTYPE_NAME BY COSTCENTER__0PROFIT_CTR_MEDIUM_NAME BY ALL_NAW_LEVEL_01 BY ALL_NAW_LEVEL_02 BY ALL_NAW_LEVEL_03 BY ALL_NAW_LEVEL_04 BY ALL_NAW_LEVEL_05 END
Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster