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



On 13 Mar 2013 07:38, Cyndi Bradberry wrote:
We have a compile time array that is used in many programs.
At this time, I cannot get rid of it, but I am trying to put
it into a copy member to include into the programs instead
of having it all over the place.
<<SNIP>>
Is this just something that doesn't work ?


The topic seems more appropriate for the RPG list. Regardless, I offer:

Perhaps test compiling the following, as a simple functional example from v5r3, for getting both the declaration of the array and the Array Source Records via a /COPY directive or a /INCLUDE directive:

SrcMbr=ARRAY:

H dftactgrp(*no) debug
* both /COPY and /INCLUDE work fine for either
*COPY ARRAYDCL
/INCLUDE ARRAYDCL
/free
DoW i <= %elem(str) ;
DSPLY str(i) '*EXT' ;
i = i + 1 ;
enddo;
*inlr = *on;
/end-free
*COPY ARRAYCTDTA
/INCLUDE ARRAYCTDTA

SrcMbr=ARRAYDCL:

D i S 5u00 inz(1)
DSTR S 30A dim(3) varying CTDATA

SrcMbr=ARRAYCTDTA:

**CTDATA str
This is the first line of text
This is the second line of text
This is the third line of text

H dftactgrp(*no) debug
*COPY ARRAYDCL
/INCLUDE ARRAYDCL
/free
DoW i <= %elem(str) ;
DSPLY str(i) '*EXT' ;
i = i + 1 ;
enddo;
*inlr = *on;
/end-free
*COPY ARRAYCTDTA
/INCLUDE ARRAYCTDTA
**CTDATA str
This is the first line of text
This is the second line of text
This is the third line of text
This is the fourth line of text
This is the fifth line of text
D i S 5u00 inz(1)
DSTR S 30A dim(5) varying CTDATA

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.