CL initial values and DMPCLPGM
I've realized that if I look at a dump from a CL program by using a DMPCLPGM command in the code, the variables that are declared and initialized (given a VALUE when declared) won't show up in the dump. If I "do something" with the variable, whether a CHGVAR or pass it as a PARM to another program, then they do show up in the dump properly. Strangely, this seems to be the case regardless of where the DMPCLPGM command is in my code (i.e. before or after the "do something with the variable" command).
I'm guessing there's an order of operations happening under the hood, like a variable doesn't really occupy memory until it's used in a command, and that DMPCLPGM runs after a program ends or something. But I haven't been able to track down any documentation to satisfy my curiosity on the subject. Can anyone shed some light? Many thanks!