× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a table that has 1000 iterations. For example myTable000,
myTable001, myTable002... myTable999. It is the way back when it was
designed back in the 80's/90's that they archived here.
I have a program that opens myTable000 searches it for data and if not
found close the table and opens myTable001 searches and repeats. if found
display data. it works great until it gets to the table myTable092. It
fails on the open.
I have looked at the tables it fails on they look fine.
Is there a limit to how many times you can open/close tables in RPG?
What am I missing?

here is snippet of my code, :

dcl-f myTable usage(*input) usropn extfile(em) recno(emRRN);

exsr openNextTable;
if tableOpen;
read myTable;
.
.
.
else;
leave;
EndIf;

begsr openNextTable;
If %open( myTable) ;
close myTable ;
endif;
if nxtTbl# ,= 999;
tableOpen = *on; // assume table was opened
em='ARCHIVE/MYTABLE' + %editc(nextTbl#:'X') ;
open(e) myTable ;
If not %open( myTable ) ;
open(e) myTable ;
endif;
If not %open( myTable ) ;
tableOpen = *off;
endif;
if tableOpen;
currentTbl# = nextTbl#;
nextTbl# = nextTbl# + 1;
else;
srchForMsg = ' myTable not open ' + %trim(em);
EndIf;
else;
tableOpen = *off;
srchForMsg = 'Max tables reached'
endif;
endsr;




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.