|
Hi Daan,
On Fri, 26 Jan 2001 Daan.Koster@zurich.nl wrote:
> Hi,
>
> We want to concatenate more filestructures in one large parameter field.
> See code below.
> Is it possible to achieve this with pointers instead of moves and duplicate
> fields?
>
> I would be grateful for any help
>
>
> Daan Koster
>
> ###########
>
I think that this is probably what you're looking for:
D dsFile01 E DS ExtName(File01) based(p_File01)
D dsFile02 E DS ExtName(File02) based(p_File02)
D dsFile03 E DS ExtName(File03) based(p_File03)
D dsFile04 E DS ExtName(File04) based(p_File04)
D p_File01 S * inz(%addr(Parm_File01))
D p_File02 S * inz(%addr(Parm_File02))
D p_File03 S * inz(%addr(Parm_File03))
D p_File04 S * inz(%addr(Parm_File04))
D Parm_ALL DS
D Parm_File01 like(dsFile01)
D Parm_File02 like(dsFile02)
D Parm_FIle03 like(dsFile03)
D Parm_File04 like(dsFile04)
c *entry plist
c parm PRCOMC
c parm Parm_ALL
c read File01 99
c read File02 99
c read File03 99
c read File04 99
c return
** Note: this is critizal... we must reference these data
** structures SOMEWHERE in the calcs, or the compiler
** will think we're not using the fields from the file,
** and therefore won't bother loading them from disk.
csr *inzsr begsr
c clear dsFile01
c clear dsFile02
c clear dsFile03
c clear dsFile04
csr endsr
It should be noted that if the calling program sends a parm thats shorter
than this data structure -- or likewise if you call this from the command
line -- this program will try to write data into memory that it shouldn't.
So be careful to make sure that the parm is long enough.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.