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.
Can anybody tell me how this variable works? I have been using it in one of my loops that reads a text file. I use it to loop until the end of my text file.
My guess is that when I set it equal to zero before the start of my loop then it stays that way for every record until there are no records left.
The &IORETURN variable is an internal one and is primed in Francis' example by performing a READ operation before it is checked.
It is an old methology that is still stands today although from most posts it doesn;t seem to be put into practice. It is also the most logical way to process a file, in that you "read ahead", check the IO status, process the input, read the next line and then start again.
Read through Francis' example carefully, understand it and compare it to your process.
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
The funny thing is that I modified my code when I looked at Francis' so that the -READ came before the -REPEAT statement (and took out the line that sets &IORETURN = 0) and it seemed to like that except I got an error saying that I didn't have enough virtual memory. Here is my original code:
FILEDEF SSN DISK "\\HORSEISLAND\NETSHARE\MEDICAL\OOQ\CLINICAL INFO MGMT\CMPROJECTS\OCCUPATIONAL HEALTH\WORKERSCOMP\SSN.TXT" (LRECL 9 -RUN -SET &SSN=' '; -SET &IORETURN = 0 ; -REPEAT MYLOOP WHILE &IORETURN EQ 0 ; -READ SSN NOCLOSE &SSN.A9. TABLE FILE T2PERSON ...[a bunch of code]... FILEDEF OUTPUT DISK \\HORSEISLAND\NETSHARE\MEDICAL\OOQ\SOLUTIONSWORLD\WORLDS\MARK\WORK\FEB07\OUTPUT.TXT (APPEND TABLE FILE MYOUT SUM BALANCE BY PERSON_FIRST_NAME BY PERSON_LAST_NAME ON TABLE HOLD AS OUTPUT FORMAT COM END -MYLOOP -EXIT
FILEDEF SSN DISK "\\HORSEISLAND\NETSHARE\MEDICAL\OOQ\CLINICAL INFO MGMT\CMPROJECTS\OCCUPATIONAL HEALTH\WORKERSCOMP\SSN.TXT" (LRECL 9
FILEDEF OUTPUT DISK \\HORSEISLAND\NETSHARE\MEDICAL\OOQ\SOLUTIONSWORLD\WORLDS\MARK\WORK\FEB07\OUTPUT.TXT (APPEND
-RUN
-SET &SSN=' ';
-REPEAT MYLOOP 99999 TIMES
-READ SSN NOCLOSE &SSN.A9.
-IF &IORETURN NE 0 GOTO OUTLOOP;
TABLE FILE T2PERSON
...[a bunch of code]...
TABLE FILE MYOUT
SUM BALANCE
BY PERSON_FIRST_NAME
BY PERSON_LAST_NAME
ON TABLE HOLD AS OUTPUT FORMAT COM
END
-RUN
-MYLOOP
-OUTLOOP
-EXIT
Also you shouldn't need to keep the OUTPUT FILEDEF in the loop, and a RUN in between so that FOCSTACK doesn't get too big. So &IORETURN doesn't need priming as Tony says, because the READ does the priming for you.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007