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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
-Repeat question
 Login/Join
 
Silver Member
posted
I'm using WF 5.33 on Windows 2000.

I have a -READ within a loop (-REPEAT). I need the repeat to loop until the end of file on the read. Is there a way to loop until &IORETURN NE 0? I haven't been able to make that work, keep getting an error. Got any ideas? Thanks.

Raelene
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Report This Post
Expert
posted Hide Post
make sure you -READ filename NOCLOSE
otherwise that sucker just reads the same record over and over and...
then &IORETURN will at some point NE 0
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Silver Member
posted Hide Post
I have the NOCLOSE on the read. The -REPEAT requires number of times, or a while condition, or a from-to value. I just want it to repeat until eof.
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Report This Post
Expert
posted Hide Post
Try this syntax which reads ahead (age old data processing requirement Smiler ) and set &IORETURN immediately after your -READ thereby trapping and EOF situation.

TABLE FILE CAR
PRINT MODEL
ON TABLE HOLD AS CALENDAR FORMAT ALPHA
END
-RUN
-* Read ahead to prime the &IORETURN
-READ CALENDAR, NOCLOSE &Model
-REPEAT Read_It WHILE (&IORETURN EQ 0)
-TYPE Model is &Model
-READ CALENDAR, NOCLOSE &Model
-Read_It
END
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Try this:

APP FI TEST lidholh/test.txt
-RUN
-*
-WRITE TEST Record 1
-WRITE TEST Record 2
-WRITE TEST Record 3
-WRITE TEST Record 4
-WRITE TEST Record 5
-RUN
-*
-SET &IORETURN = 0;
-REPEAT :end_read WHILE &IORETURN EQ 0;
-READ TEST,&LINE
-IF &IORETURN NE 0 GOTO :end_read;
-TYPE &IORETURN &LINE
-:end_read

It will give you the following output:

0 Record 1
0 Record 2
0 Record 3
0 Record 4
0 Record 5
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Silver Member
posted Hide Post
Thanks, H Lidholm, it worked. My syntax was similar, guess I was missing something.
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders