|
Comments below: <snip> >DDSINPUT E DS EXTNAME(DSUPDPAG) INZ >D @QzAmt S * INZ(%addr(qzamt1)) >D @QzChk S * INZ(%addr(qzchk1)) >D $QzAmt S like(QZAMT1 ) based(@qzamt) >D dim(12) >D $QzChk S like(QZCHK1 ) based(@qzchk) >D dim(12) I have a few questions on this technique before I change my program. 1. the '*' in the field length implies "variable length"? 2. is it the "based" keyword on the $qzxxx that eventually defines the length of the @qzxxx fields? 3. or is it the fact that the next field in the DS (@qzchk) starts at the address of QZCHK1 that defines the length of @qzamt? if so, what defines the length of @qzchk? <endsnip> My comments: 1. The '*' is not in the field length. It is in the field type. 'a' is alphanumeric, 'p' is packed, '*' is a pointer. 2. "based" means that the address of this field in memory starts at the pointer location. Thus $qzamt is stored in memory at the position set by the pointer @qzamt. The value of the pointer @qzamt is equal to the address in memory of the field qzamt1, as set by the INZ(%addr... function. An eval on one field will change the value of the other. I used to be pointer phobic. But once you get used to them they are quite handy. I especially like them in using list api's versus the QUSRTVUS api. Rob Berendt -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." Benjamin Franklin
As an Amazon Associate we earn from qualifying purchases.
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.