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.
DEFINE FILE CAR
MYMARKET/A15 = COUNTRY;
END
-RUN
TABLE FILE CAR
PRINT
DST.MYMARKET
WHERE MYMARKET NE ''
ON TABLE SAVE
END
-RUN
-SET &COMMA = '';
-*for each line in the table
-REPEAT :END_MARKET_REPEAT &LINES TIMES
-* read the line in
-READ SAVE &MYMARKET.A15
-SET &LINE= &COMMA | '"' | &MYMARKET || '"';
-* write out this new object to the HTML page
-HTMLFORM BEGIN
!IBI.AMP.LINE;
-HTMLFORM END
-SET &COMMA = ',';
-*do the next loop
-:END_MARKET_REPEAT
This code is returning England separated by commas multiple times when running on 8204. However, it was returning different countries as expected when we ran it on 8010 version.
Thanks Kartik WF8010,9204 OS WindowsThis message has been edited. Last edited by: Kartik Katyal,
If it used to work and has stopped, you should probably open a case with IB Tech Support. However, the changes suggested by Tony do fix the problem.
SET HOLDLIST=PRINTONLY
SET ASNAME=ON
-DEFAULTH &MYMARKET='';
DEFINE FILE CAR
MYMARKET/A15 = COUNTRY;
END
-RUN
TABLE FILE CAR
BY MYMARKET
WHERE MYMARKET NE ''
ON TABLE HOLD
END
-RUN
-SET &COMMA = '';
-*for each line in the table
-REPEAT :END_MARKET_REPEAT &LINES TIMES
-* read the line in
-READFILE HOLD
-SET &LINE= &COMMA | '"' | &MYMARKET || '"';
-* write out this new object to the HTML page
-HTMLFORM BEGIN
!IBI.AMP.LINE;
-HTMLFORM END
-SET &COMMA = ',';
-*do the next loop
-:END_MARKET_REPEAT
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
Wonder why it was working with the incorrect READ syntax in 8010 version.
DEFINE FILE CAR
MYMARKET/A15 = COUNTRY;
END
-RUN
TABLE FILE CAR
PRINT
DST.MYMARKET
WHERE MYMARKET NE ''
ON TABLE SAVE
END
-RUN
-SET &COMMA = '';
-*for each line in the table
-REPEAT :END_MARKET_REPEAT &LINES TIMES
-* read the line in
-READ SAVE NOCLOSE &MYMARKET.A15.
-SET &LINE= &COMMA | '"' | &MYMARKET || '"';
-* write out this new object to the HTML page
-HTMLFORM BEGIN
!IBI.AMP.LINE;
-HTMLFORM END
-SET &COMMA = ',';
-*do the next loop
-:END_MARKET_REPEAT
-CLOSE SAVE
You are also missing a semicolon in the line -REPEAT :END_MARKET_REPEAT &LINES TIMES
I would still recommend using -READFILE - which is newer syntax.
-DEFAULTH &LINE='', &MARKETVAR=''
DEFINE FILE CAR
MYMARKET/A15 = COUNTRY;
END
-RUN
TABLE FILE CAR
SUM COMPUTE CNTR/I9 = LAST CNTR + 1; NOPRINT
COMPUTE MARKETVAR/A20 = IF CNTR EQ 1 THEN '"' || MYMARKET || '"' ELSE ',"' || MYMARKET || '"';
BY MYMARKET NOPRINT
WHERE MYMARKET NE ''
ON TABLE HOLD AS MYDATA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-READFILE MYDATA
-REPEAT :Loop WHILE &IORETURN EQ 0;
-SET &LINE = &LINE || &MARKETVAR;
-READFILE MYDATA
-:Loop
-* write out this new object to the HTML page
-HTMLFORM BEGIN
!IBI.AMP.LINE;
-HTMLFORM END
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004