Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Facing problem with Read command in version 8204

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Facing problem with Read command in version 8204
 Login/Join
 
Gold member
posted
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 Windows

This message has been edited. Last edited by: Kartik Katyal,


WebFOCUS 8010,8204
Windows
 
Posts: 59 | Registered: June 26, 2015Report This Post
Expert
posted Hide Post
Correct syntax for -READ is -READ &variable.{format of I or A only}.

However, I would suggest changing to a HOLD and using -READFILE or/and use NOCLOSE

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, 2004Report This Post
Virtuoso
posted Hide Post
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, 2015Report This Post
Expert
posted Hide Post
quote:
Correct syntax for -READ is -READ &variable.{format of I or A only}.

Forgot to point out that there should a dot before AND after the &variable being read.

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, 2004Report This Post
Virtuoso
posted Hide Post
Babak's technique uses -READFILE SAVE instead and it will assign the amper variable based on the fieldname used in the table request


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Gold member
posted Hide Post
Thanks guys, both methods worked.

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


WebFOCUS 8010,8204
Windows
 
Posts: 59 | Registered: June 26, 2015Report This Post
Expert
posted Hide Post
quote:
working with the incorrect READ syntax in 8010 version

Code tightening!

It's why I remind people to use documented syntax!!

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, 2004Report This Post
Expert
posted Hide Post
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, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Facing problem with Read command in version 8204

Copyright © 1996-2020 Information Builders