× 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 suppose it doesn't matter... just not sure why you would want to reference the external name CustData twice, once in the FSPECS, and once in the DSPECS except to save on the amount of lines in your source.

Another option you can do is.

D DS
D Field1
D Field2
D Field3
D Field4
D Field5
D Field6
D Field7
D Field8
D Field9
D Field10
D Field11
D Field12
D Field13
D Field14
D Field15
D Field16
D Field17
D Field18
D Field19
D Field20
D array 1 100 Dim(20)

Since the fields are already defined by the FSPEC, you do not need to define them again in the DS.




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, July 01, 2010 12:02 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Overlaying a DS Array In a LIKEREC DS

The Prefix + LikeRec works fine in many cases - but this isn't one of
them

LikeRec works the same way as LikeDS it generates a complete DS -
hence you can't add any fields to it.

You need to use an externally described DS instead and you won't need
the prefix in this case. Haven't tested the code below but something
like it should work - and avoid the pointers for the pointer-phobic
among your colleagues.

FCustData IF E K DISK
D custRec E DS Extname(CustData : *INPUT)
D array 7p 0 overlay(CustData) Dim(20)

/free
DoU %Eof(Customers);
Read Customers CustData;
...

NOTE: You _must_ specify the *INPUT option on ExtName for this to work.

Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



On Jul 1, 2010, at 2:37 AM, rpg400-l-request@xxxxxxxxxxxx wrote:

The file I'm using has 20 repeating groups of 5 fields (It's a 25
year old file and no one dares change it!) in the record (rafile)
which I want to access via an array DS, but I can't work out how to
do 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.