|
fkany=xyKOxUUvAoHhjpcFh+TbANBPR1lH4CV8@public.gmane.org wrote: > > With the changes Scott suggested the Main Procedure and the External > Subprocedure both compile and run as I would like. In the Main Procedure, > I'd like to use the record information from the CHAIN operation in the > subprocedure. What would be a good way to do this? > ... Frank, just go ahead and use the record information as though the main procedure did the CHAIN. When you do a CHAIN without a result field, the fields are read into program fields (in your listing on the generated I specs). These program fields are global variables, which means any procedure in the module can use them. (In RPG, any fields available to the main procedure are also available to the subprocedures.) (If your subprodedure was doing a CHAIN with a result field that was defined in the subprocedure, you would have to pass back the result field information somehow, probably in a parameter.) It might be interesting to compile this with DBGVIEW(*LIST) and step through it in the debugger. On the EVAL with the subprocedure call, do F22 (step into) so you step through the subprocedure. For this experiment, make sure you specify DEBUG(*YES) and OPTION(*DEBUGIO) on the H spec, so you'll see how the CHAIN in the subprocedure goes through the I specs in the main procedure.
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.