×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Do the values of variables in an ILE CL program get refreshed on every
call to it if it is run within a named activation group? e.g., The
following program is created with the parameters DFTACTGRP(*NO) and
ACTGRP(EXAMPLE). If it is called repeatedly from another program in the
same activation group, is the value of &LOCAL reset to 'Initial' every
time this program is called?

PGM PARM(&ACTION)

DCL VAR(&ACTION) TYPE(*CHAR) LEN(4)

DCL VAR(&LOCAL) TYPE(*CHAR) LEN(10) VALUE('Initial')

SNDPGMMSG MSG('The action is:' *BCAT &ACTION) TOPGMQ(*EXT) +
TOMSGQ(*TOPGMQ)

SNDPGMMSG MSG('Local variable value is:' *BCAT &LOCAL) +
TOPGMQ(*EXT) TOMSGQ(*TOPGMQ)

CHGVAR VAR(&LOCAL) VALUE('Changed')

CALL PGM(EXCRUNUNT3) PARM(&ACTION)

SNDPGMMSG MSG('On return local variable value is:' *BCAT +
&LOCAL) TOPGMQ(*EXT) TOMSGQ(*TOPGMQ)

RETURN
ENDPGM

Thanks,
Michael

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.