× 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 was not referring to the overlay part. I was referring to the use of a data structure with an externally described file.

I could not find in the V5R2M0 RPG IV Reference for the UPDATE op code the quote you mentioned: "If name refers to an externally-described file, the data structure must be a data structure defined with EXTNAME(...:*INPUT) or LIKEREC(...:*INPUT). The updated record is written directly from the data structure to the file."

That quote IS in the V5R3M0 manual with change bars next to it.

In addition, the V5R2M0 manual explicitly states.

1) for factor 2, "a record format name is required with an externally described file"

2) "...data-structure cannot be specified if name is a record format name."

So, in V5R2M0, a data structure cannot be used when the a record format name is used and an externally described file must use a record format name, therefore a data structure cannot be used with an externally describe file.

Are you sure you weren't reading/quoting the V5R3M0 manual?


Mel


Tilo von Brandis wrote:

Hi Mel

Point 2 I had covered but point 1 is odd as it states in the V5R2 reference
manual, operation code "UPDATE":

<Quote>
If the data-structure operand is specified, the record is updated directly
from the data structure.
....
If name refers to an externally-described file, the data structure must be a
data structure defined with EXTNAME(...:*INPUT) or LIKEREC(...:*INPUT). The
updated record is written directly from the data structure to the file.
...
<Unquote>

Or are you referring here to the overlay part of the datastructure. I.e.
data structures with overlays are not supported until V5R3?

Thanks for you help.

Regards,

Tilo
-----Original Message-----
From: Mel Rothman [mailto:mel@xxxxxxxxxxxxxx] Sent: 17 November 2004 16:13
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Updating file via datastructure


In addition to the previous suggestion about defining the array as
overlaying the data structure:


1) Using a data structure for UPDATE with an externally described file was
not supported by the language until V5R3M0.


2) It also requires that the data structure be defined with
EXTNAME(...:*INPUT) or LIKEREC(...:*INPUT). If the parameter where *INPUT would be specified is


missing, the compiler defaults to *INPUT, so that probably is not your
problem.

I hope this helps.

Mel Rothman
Mel Rothman, Inc.

Tilo von Brandis wrote:

Hi Joep

Thanks for you reply.

I tried your suggestion and the compiler stoped with the same error.
I changed the code to




DDSHISTRC E DS EXTName(SHISTRCL1) D RM 3P 0 OVERLAY(DSHISTRC:72) DIM(24)


and it still gave the same problem.

According to the manual this should not be a problem.

Thanks

Tilo


-----Original Message-----
From: Joep Beckeringh [mailto:joep@xxxxxxxxxxxxxxxxxxx] Sent: 17 November 2004 15:25
To: RPG programming on the AS400 / iSeries
Subject: Re: Updating file via datastructure


Hi Tilo,

IIRC the field Record is added to the datastructure, thus making the datastructure longer than the record. You should add OVERLAY(DSHISTRC) to
the Record field.


Joep Beckeringh


Tilo von Brandis wrote:


Hi

I am trying to update a file using a datastructure because I want to

update


24 fields on the file as an array

D*

When I try to update the file using the following command:

       UPDATE RISREC DSHISTRC;

the compiler gives the following error message:

*RNF7701 20 The data structure is not allowed for the operation.

What am I doing wrong?

Tilo von Brandis
Manager: IT
Safair (PTY) Ltd
Work  : +27 11 928 0043
Cell     : +27 83 675 7778




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.