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.
You're using two different languages, namely FOCUS and Dialog Manager, and they can't communicate values to each other directly.
To do what you want, you'll have to write the table results that contain the counter to an ALPHA file and -READ or -READFILE that file into a dialog manager variable.
TABLE FILE yadayada
SUM COUNTER
ON TABLE HOLD AS foo FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-DEFAULTH &COUNTER = 0;
-READFILE foo
-REPEAT LOOPx &COUNTER TIMES
-* Do stuff
-LOOPx
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
WHERE PKEY EQ 'CORE-5626' ON TABLE HOLD AS 1STGRAPH FORMAT XFOCUS END
for the moment i have hardcoded the loop to run 2 times.
i will calculate virtual fields for a duration of month ( i have a start date and a end date and mark now all month between) now i want to remove the hardcoded "2" und replace it with the value of the field duration_m (integer) of table RELEASE_INFO_PERM_ALL_DEFECTS_FINAL to run the loop.
Ah, so that's what you're trying to do! Your approach won't work though; you need to generate records, not columns/fields.
What you're after is a rather advanced topic, I'm afraid.
One way to do this is to map your table onto some kind of calendar table (with a record for every date in your range). A table like that can be generated using the McGyver technique (see the tech library for articles on that topic). Alternatively, you could generate a table in your database, which is probably easier to do.
Once you have that table, you can use MATCH FILE to merge your table to the calendar table, matching on the dates, after which you can pass the result over into a new file using COMPUTE and LAST to fill in the blanks (the records with dates between your start and end dates).
That already sounds complicated enough, but if your data has overlapping date ranges you'll need to find a combination of another key with your dates to make them unique and generate the calendar with those keys instead of just the date.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
TABLE FILE RELEASE_INFO_PERM_ALL_DEFECTS_FINAL SUM DURATION_M ON TABLE HOLD AS STEP1 FORMAT ALPHA ON TABLE SET HOLDLIST PRINTONLY END -RUN
Is there only 1 value in the field DURACTION_M ? BEfore you go further, don't HOLD this little extract file... Let it come to the screen, so you know the number you're getting is correct. Then how big is that number? what's its format? is it 8 positions, say? eg is its format /I8 ? you need to know that so you can -READ its value back into an & var. Lets assume its 8... Forget the HOLDLIST bit, it doesn't matter here. -DEFAULTH &myduration = 0 ; TABLE FILE whatever SUM DURATION_M ON TABLE HOLD AS STEP1 FORMAT ALPHA END -RUN -READ STEP1 &myduration.A8 -TYPE myduration is &myduration -* now put a -EXIT in here so you can be sure that the value in &myduration is what you want. -* if it is, now go do your report but with your loop
now, on your min value question, sure -DEFAULTH &myduration = 1 ; (or whatever you want your min to be) then before you do your -READ, check to see if you got any lines out at all. ... ON TABLE HOLD AS STEP1 FORMAT ALPHA END -RUN -IF &LINES EQ 0 GOTO somelabel ; -READ STEP1 &myduration.A8 -somelabel -TYPE myduration is &myduration and carry on...
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003