Set Globals only in Report Mode

Anybody ever wondered why SET GLOBALS, e.g. WH=ON/OFF, is only permitted in Report Mode programs? Was this a Software AG strategy to phase out the functionality of SET GLOBALS or what? And what should we do then if we don’t want any Report Mode programs?

You will have to set WH=OFF and react upon it in an ON ERROR block / routine accordingly.

Well yes, this is IMHO a workaround only for the WH situation. But there are plenty more parameters like DU=ON/OFF, CF=% and lots more, only allowed to be set in a non-SM program. The question is, why is SET GLOBALS restricted to RM progs, when SAG recommends programming everything in Structured Mode? I’m just curious - of cause we use RM modules to handle global settings.

I have always viewed Structured Mode as the “idiot proof” version of Natural. They removed facilities (e.g. MOVE INDEXED) that can get you in trouble. Consider SET GLOBALS.

Someone is writing a Subprogram to be used by several programs. They are in structured mode. They “unsocialably” use SET GLOBALS to change a parameter. Now consider the poor programmers developing code to CALLNAT the subprogram. They cannot track down a “bug”. Reason? The parameter change in the Subprogram whose “effect” extends far beyond the boundaries of the Subprogram. FORMAT, by contrast, just pertains to one object.


Your answer is a little bit shortminded. If you can’t achieve a result with a SM program you can achieve with a RM program, then this is stupid only (in my mind). If a program needs to set a globals parm, it should set it. The difference should be the scope. In RM programs (i.e. version 1 programs or quick-and-dirty programs) for compatibility reasons the scope should be globally, for SM the scope can be restricted to the execution level and levels below.

Sometimes I feel like an idiot programmer, I must admit, when SAG tries to protect me from making errors, thus hindering me more than protecting me.

:arrow: I do not need any protection!

and you should not only read but also understand the post! Not all posts (but most are) in this forum are as simple minded as you migth think!