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



Kevin, are you trying to fix a bug, design a solution, or understand a conundrum?

Is my understanding correct; all of the programs were created with DFTACRGRP(*NO) ACTGRP(*CALLER)? Assuming Program A was initiated from a menu  in the *DFTACTGRP, then they all have their resources - in particular working storage - in the *DFTACTGRP - correct?. Others have pointed out this is not ideal. However, putting this aside you asked.

1). If we call ProgramA and it makes it to ProgramD.  Let’s say LastClient = ‘AS’.  Then goes back to the menu. Then, from same session/job we call ProgramA again and it makes it to ProgramD. Will LastClient still have ‘AS’ upon entry?

A). Difficult to say. Is LastClient a parameter, using STATIC storage, part of a Data Structure based on an external Data Area? Are the programs using subprocedures? Is RCLRSC being employed? If none of these situations are apparent, then I would suggest the answer to your question is "yes".

2). If ProgramB has LastClient field. If ProgramB changes LastClient value. Will that new value be carried in to ProgramC and ProgramD?

A). Again, depends on how LastField is defined. But assuming the same conditions as 1). above, I would suggest "no".

This is a HUGE simplification; with traditional, non-ILE coding:
- RETURN with LR *OFF - leaves variables intact
- RETURN with LR *ON - causes variables to be "cleared"
- End of Program with LR *ON - causes variable to be "cleared"

CAVEAT: This assumes I've understood the question correctly! Bottom Line: Set up a simple test case and try it out for yourself to prove it. The situation you describe would be quick and easy to construct.

HTH,
Brian.

On 03/02/2022 19:33, K Crawford wrote:
If I have the following:

ProgramA calls ProgramB

ProgramB calls ProgramC

ProgramC calls ProgramD



ProgramA ends with *INLR = *ON

ProgramB ends with *INLR = *ON

ProgramC ends with RETURN

ProgramD ends with RETRUN



If program C and D have some Last Changed values like LastClient. No INZ
value on it in program C and D.



First question:

If we call ProgramA and it makes it to ProgramD. Let’s say LastClient =
‘AS’. Then goes back to the menu.

Then, from same session/job we call ProgramA again and it makes it to
ProgramD. Will LastClient still have ‘AS’ upon entry?



Second question:

If ProgramB has LastClient field. If ProgramB changes LastClient value.
Will that new value be carried in to ProgramC and ProgramD?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.