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.
TABLE FILE myTable
PRINT VAR1 VAR2 VAR3
-* Assuming that myTable only has one record, no need to perform a filter (WHERE) otherwise multiple lines will be returned
WHERE myTable.myFld EQ cond;
ON TABLE HOLD AS TMP
END
-RUN
-READFILE TMP
-RUN
-* TO AVOID VARIABLE'S PROMPTING
-DEFAULTH &VAR1 = ''
-DEFAULTH &VAR2 = ''
-DEFAULTH &VAR3 = ''
TABLE FILE oTable
PRINT ABC
BY XYZ
WHERE oTable.tstFld1 EQ &VAR1;
WHERE oTable.tstFld2 EQ &VAR2;
WHERE oTable.tstFld3 EQ &VAR3;
END
-RUN
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
Thanks a lot for your answers. But, unfortunately, i think i didnt have explained correctly my problem :-)
So, to begin i have a table in which one i count the number of lines :
TABLE FILE STEP1 SUM CNT.MYVAR END
I would like to keep the value of my count in a dialogue manager variable, in order to use it later in my code. For example, we say there is 10 lines in my table STEP1 I need this value to make a loop on an other table. As there is 10 lines in STEP1, i need to do a 10 times loop...
So, Unfortunately, my last answer make me to come back with an other question...
In the beginning of my code i have kept then number of distinct variable (nb of towns)
TABLE FILE TOWNS SUM CNT.DST.TOWNS ON TABLE SAVE END -RUN -READ SAVE &CNT_TOWNS.I9. -TYPE &CNT_TOWNS
==> i have 5 towns so the value of &CNT_TOWS is 5
And now, i work with another table, which contains the name of roads. theres are 10 lines in this table with 10 distinct values.
For each of these 10 distinct values, i would having on my final table, 5 lines (&CNT_TOWNS) with the same value (name of road). So i will have finally 50 lines in my table.
I m sure ma ask is not very clear so this is an exemple :
Yes, it's not clear what you are attempting to perform.
What are you trying to perform : - have each Road with their Town ? - repeat each Road's name as many time you have Town ? So, as you stated : you have 5 Towns and 10 Roads so you want 5 X 10 = 50 lines in output.
Can you just JOIN the two tables together ? If no commun field exist between the two tables, you can JOIN them using a Dummy field such as below
-*-* TMP1 includes up to 5 Countries
TABLE FILE CAR
BY TOTAL COMPUTE DUMMY /I1 = 1;
BY COUNTRY
WHERE RECORDLIMIT EQ 5;
ON TABLE HOLD AS TMP1
END
-*-* TMP2 includes up to 10 Cars
TABLE FILE CAR
BY TOTAL COMPUTE DUMMY /I1 = 1;
BY CAR
WHERE RECORDLIMIT EQ 10;
ON TABLE HOLD AS TMP2
END
-*-* Since TMP1 and TMP2 have no commun field, we use a DUMMY one to create a JOIN and produce cartesian result
JOIN DUMMY IN TMP1 TAG T1
TO ALL DUMMY IN TMP2 TAG T21 AS J1
END
TABLE FILE TMP1
BY CAR
BY COUNTRY
END
-RUN
As a note : always use the code tag when posting sample code and/or data It's the last icon on the ribbon that looks like the below
</>
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013