|
|||||||
|
|
![]() |
|
|
|
|
||
|
Reader Feedback and Insights: Frightened by the Midrange Guru Hey, Ted: In your tech tip "How Dynamic Is OPNQRYF?" there is one frightening sentence: Now that you understand what's going on, let me tell you that this is not just an OPNQRYF phenomenon. It is true of any program that opens an open data path for input. Run the RPG program by itself and you will experience the same behavior. The RPG program will get an added record if the KEYFLD value is greater than the key field values of the original three records. A little test program shows that it is not always so, and it is a good thing, too! I adapted your program so that it does not use the RPG cycle. Fmydata if e k disk rename(mydata : myrec) Fqsysprt o f 132 printer D Counter s 3 0 c *LOVAL setll mydata c read mydata c dow not %eof C eval Counter = Counter + 1 C if Counter = 1 C 'Add rec now' dsply C endif c except detail c read mydata c enddo c eval *inlr = *ON Oqsysprt e detail 1 O counter 4 O keyfld +0001 O datafld +0001 --Jan I'm sorry, Jan. I didn't mean to frighten you! By using the SETLL op code, you changed the file to random access, so the system doesn't buffer the input. Thanks for writing! --Ted
|
Editors
Contact the Editors |
| Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |