as posted on stackoverflow:

for details see Class %ZEN.Component.dateText

setting format:
Property format As %ZEN.Datatype.string(MAXLEN = 3, VALUELIST = ",MDY,DMY,YMD", ZENEXPRESSION = 1)
you have exactly 3 formats or "" 

Your guess on values is correct and documented:   
/// The value of this control is always in the canonical form: YYYY-MM-DD

As this is one of the oldest components of ZEN your only chance to achieve
your way of operation is to create your own version inheriting from
Class %ZEN.Component.dateText and overloading the parts you want to change

OK!  you talk about a local variable array
If you don't pass the local array with the JOB command it is not defined in the new JOB
because it is LOCAL   
except if you run  the 2 SET commands of your example also in the JOBbed routine.
also your WRITE command will fail if you don't specify some output device.
since by definition a background JOB doesn't have foreground output.

You might be able to achieve the first part of your description by some tricky JOIN constructs.
Just access to a non-existing column will fail at generating the Query.
Cascading might be easier (also for maintenance)  by filling a TempTable over several cycles
and so assemble the final result.

I would suggest to create a ClassMethod projected to SQL as Stored Procedure.
then instead of the trick with the switch you just provide the parameters that you really have

to rephrase your problem:
- You look for a way to switch on/off  column 1
so you need a switch:  >>> new parameter 
and use it like this:

... WHERE (0=? OR  column1=?) AND column2=?

if your first param is 0   then 2nd param (for column1) is irrelevant 
if your first param is 1   then 2nd param (for column1) is effective 

so execute(0,a,b)   uses any value of column1
whille execute(1,a,b) filters column1 and column2

the maxSCALE = 18 
see Doc on $NORMALIZE()
used in ##class/%Library.Numeric).Normalize()

/// Converts <var>%val</var> to a normalized value.
ClassMethod Normalize(%val As %RawString) As %Numeric [ CodeMode = generator, ServerOnly = 1 ]
{
%codemode=$$$cMETHCODEMODEEXPRESSION
%code="$select($zu(115,13)&&(%val=$c(0)):"""",1:$normalize($decimal(%val),"_+%parameter("SCALE")_"))"
QUIT $$$OK
}

But it is no problem to clone this data tape and write a private one

ah!

I have a link generator written that is reading Source (Oracle) tables and that
uses the %Library.ResultSet class. for each it gets column name, type, maxsize,
precision, lais, readonly, required & data type name and builds Cache Linked Table.

So you don't use the Caché provided Default Link generator in SMP !!!
So you get the default of datatype class %Numeric  (=> SCALE=2)

It might be enough to add :

$SELECT(columntype["Numeric":"%Numeric (SCALE=4)",1:columntype) 

It's all under your own control.

if you link a table from another DB  (Oracle) there is a related class generated in Caché.
In this class a property related to your column with type %Numeric.
all you have to do is to add (SCALE=4)  or whatever scale you need.
this data type existed already in Caché 5.*  about 20 years back. 

The system-wide control is stored in Cache.cpf file.
You can change ist from SMP in  System > Configuration > System-defined DDL Mappings 
though I would not recommend to do it on a system-wide scope
as this affects ALL mapping between Caché Objects and SQL