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



At least a Clear RecordFormat will be needed, as mentioned by others.

However an alternative would be to use an externally described data
structure like Barbara mentioned.

OutDS E DS EXTNAME(FILENAME:*OUTPUT) INZ

The structure is defined for *OUTPUT which allows it to be used on a
Write and Update statement. This can also be defined locally to the
subprocedure so that it doesn't interfere with any other use of the
file.
You can also leave the data structure unqualified, allowing you to
access the fields as the prior programmer did. However, if you did add
qualified you would have to access each field as OutDS.FieldName.

You will need to clear the DS or add the INZ keyword so that the other
parameters are reset to their default value on each call. Otherwise they
could be left uninitialized.

To me this gives us the best of both worlds. I can still use unqualified
names, but I am guaranteed to get my own copy of the fields.

Chris Hiebert
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gerald Kern
Sent: Thursday, July 12, 2012 10:44 AM
To: RPG
Subject: Record Buffer question after file open and close

I have sub-procedure that does file maintenance and the files are opened
at
the beginning and closed at the end of the sub-proc.

Key fields are passed, a chain occurs, and if a record is found three
fields are updated.

If the record is not found, the key fields, and the three fields (same
as
during update) are written as a new record.

Question:

Is it possible that on a prior call to this sub-proc, where the chain
didn't fail, that all fields in the format are 'available' in memory
even
though the sub-proc only references three fields (out of say 25 fields),
and would it be possible for those fields to 'bleed through' (during the
next call of the sub-proc) when the next record is added/written - even
if
the file is opened and closed each time the sub-proc is called?



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.