× 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.



What would your procedure return? Apparently a global defined DS, that does
not requires a procedure then, unless external in a *SRVPGM. How then will
the SETLL have effect?

Lim Hock-Chai's examples are not correct.
1) using *STATUS will miss other errorsand does not mean EOF or (NOT)
FOUND.
2) having a BIF %reade would return a boolean value (*ON or *OFF) and
should be tested as such or with '1'or '0', nut with a number.

With regards,
Carel Teijgeler

*********** REPLY SEPARATOR ***********

On 2-9-2008 at 15:32 Charles Wilt wrote:

That's why I tend to wrap the READ/READE opcode in a procedure...

/free
setll (fld1:fld2) MyFile;
dow ReadMyFile(myFileFieldDS);
//do stuff
enddo;

/end-free

Charles

On Tue, Sep 2, 2008 at 2:09 PM, Lim Hock-Chai
<Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote:
You sort of already have that.

FMYFILE IF E K DISK INFDS(infdsMyFile)

D infdsMyFile DS qualified
D status *STATUS

D FOUND C const(0)

/free
setll (myKey) myFile;
reade (myKey) myFile;
dow infdsMyFile.status = FOUND;
do stuff...
reade (myKey) myFile;
enddo
/end-free


The reason I ask for bif is because opcode cannot return a value. So,
if bif were existed, the above code would look like below:

FMYFILE IF E K DISK

D FOUND C const(0)

/free

%setll(myKey :myFile);
dow %reade(myKey :myFile) = FOUND; //no double reade needed
do stuff...
Enddo

/end-free



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.