× 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'm probably wrong, but I thought that *Start positioned the pointer to the first record in the file regardless of whether or not it was indexed. I.e., to the first available (undeleted) record in file. I thought I had used it on unkeyed files before, but I could not find an example quickly so maybe Jethro Tull is making me hallucinate.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Carel Teijgeler
Sent: Thursday, March 18, 2010 3:23 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Failed SETLL leaving program at undefined position in SQL VIEW, butnot in DDS LF

Tu use *START the file should be keyed and this is a programme described
file. Won't do, unfortunately.

With regards,
Carel Teijgeler

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

On 18-3-2010 at 13:55 DeLong, Eric wrote:

James, I doubt this applies to MI, but in RPGLE I'd use the special value
*START. In general, this is why I avoid file I/O by RRN.

-Eric

-----Original Message-----

This is really about an MI program (see the thread on the MI list), but it
also happens in an RPG test program that approximates the
point-of-failure in the MI, so maybe somebody who's here, but not on the
MI list might have an insight.

It seems that with this code (intentionally opening the file in
program-described mode, as that's essentially what happens in the
original MI program):

FHPADLPUA IF F 1243 DISK
D RECORD DS 1243
C 1 SETLL HPADLPUA
121314
C READ HPADLPUA RECORD

if I run it on a DDS LF, and RRN 1 is omitted by a SELECT clause in the
DDS, the SETLL comes back with an error, but the READ still finds the
first record that satisfies the SELECT.

But if I run an otherwise identical program on an equivalent SQL VIEW of
the same data, the READ fails, evidently from the file being left at an
undefined position.

SETGT (and this surprised me) also returned with an error, and left the
SQL VIEW at an undefined position.

Anybody know of a way, short of iteratively SETLLing until a record is
found, to deal with this?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.