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



You always write the ordswkrf file even though it's past the last record. 
I would do something like this

This way *IN50 is set prior to entering the loop so you won't be writing 
any records to a file if there are no records to process. A do-until loop 
will always execute once, so your previous code would have written a 
record if there were no records to write. With the new code, you do a read 
on the file just prior to when the loop tests whether it should execute 
again. This way you won't get an extra record written at the end. See how 
you go.

 C           ODKEY     SETLLORDDTL                   50 
 C           ODKEY     READEORDDTL                   50 
 C           *IN50     DOWEQ*OFF 
 C                     WRITEORDSWRKF 
 C           ODKEY     READEORDDTL                   50 
 C                     END 
 C                     END 
 C                     END 
 C* 
 C                     ENDSR 

Rick Pezzimenti
Programmer/Analyst
Denso International Australia
+613 8761-1327




simafrog <SimaFrog@xxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
26/03/2004 09:32 AM
Please respond to RPG programming on the AS400 / iSeries

 
        To:     RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
        cc: 
        Subject:        SETLL ONE SLIGHT PROBLEM


Actually I don't think I can do this here anyway. One problem remaining is 
that the reade of the Detail file is causing one extra record to be added 
to the work file, the last one of the batch is duplicated. Here is the 
code:
 C           BLD       BEGSR 
 C* 
 C           OHKEY     SETLLORDHEDR             40 
 C* 
 C           *IN40     DOWEQ*OFF 
 C* 
 
 C           OHKEY     READEORDHEDR                 40 
 C           *IN40     IFEQ '0' 
 C* 
 C           C* 
 C           ODKEY     SETLLORDDTL                   50 
 C           *IN50     DOUEQ*ON 
 C           ODKEY     READEORDDTL                   50 
 C                     WRITEORDSWRKF 
 C                     END 
 C                     END 
 C                     END 
 C* 
 C                     ENDSR 
 
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




#########################################################################
Attention:

The information contained in this message and or attachments is intended 
only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any review, retransmission, 
dissemination or other use of, or taking of any action in reliance upon, 
this information by persons or entities other than the intended recipient 
is prohibited. Opinions expressed in this email and any attachment are 
those of the sender and not necessarily the opinions of DENSO.  If you 
received this in error, please contact the sender and delete the material 
from any system and destroy any copies.

The DENSO Australia Group of companies does not represent, warrant or 
guarantee that the integrity of this communication has been maintained 
nor that the communication is free of errors, virus or interference.
##########################################################################

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.