× 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 believe the overlay to DSINPUT is unnecessary.  When you don't put the
ending positions on the subfields of a data structure, each field is
appended to the one before it.

Dawn Siegrist

-----Original Message-----
From: Richard B Baird [mailto:rbaird@esourceconsulting.com]
Sent: Thursday, January 03, 2002 1:11 PM
To: rpg400-l@midrange.com
Subject: data structure overlay question.


hey all,

I'm not really clear about the ins and outs of overlaying data structure
subfields, I was hoping someone could lend a hand.

(see code below) I'm having trouble overlaying arrays $QzAmt and $QzChk to
redefine QZAMTx and QZCHKx fields.

When run in debug, QZSESS and $fill1 have the same value, but that's where
the overlays end.
fill2 and 3, as well as the two arrays have blanks (hex 40) and when
DSINPUT is displayed in debug, it appears that only $fill1 overlays the
data structure.  the rest are appended to the end of it.

I know I've got this wrong somehow.  Can anyone guide me?

this is what my code looks like:

Thanks in advance,

Rick


----
DDSINPUT        E DS                  EXTNAME(DSUPDPAG)

D $fill1                              like(QZSESS ) overlay(DSINPUT)
D $fill2                              like(QZBTCH ) overlay(DSINPUT:*next)
D $fill3                              like(QZREF  ) overlay(DSINPUT:*next)
D $QzAmt                              like(QZAMT1 ) overlay(DSINPUT:*next)
D                                      dim(12) inz(0)
D $QzChk                              like(QZCHK1 ) overlay(DSINPUT:*next)
D                                      dim(12)

external data structure DSUPDPAG looks like this:

   1     25    A      QZSESS
  26     31    S    0 QZBTCH
  32     35    S    0 QZREF
  36     43    S    2 QZAMT1
  44     51    S    2 QZAMT2
  52     59    S    2 QZAMT3
  60     67    S    2 QZAMT4
  68     75    S    2 QZAMT5
  76     83    S    2 QZAMT6
  84     91    S    2 QZAMT7
  92     99    S    2 QZAMT8
 100    107    S    2 QZAMT9
 108    115    S    2 QZAMTA
 116    123    S    2 QZAMTB
 124    131    S    2 QZAMTC
 132    132    A      QZCHK1
 133    133    A      QZCHK2
 134    134    A      QZCHK3
 135    135    A      QZCHK4
 136    136    A      QZCHK5
 137    137    A      QZCHK6
 138    138    A      QZCHK7
 139    139    A      QZCHK8
 140    140    A      QZCHK9
 141    141    A      QZCHKA
 142    142    A      QZCHKB
 143    143    A      QZCHKC
 144    153    A      QZACTI
 154    159    S    0 QZPROD

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


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.