@Variables
Declares variables inside a named scope: global (visible throughout the file) or the name of a Procedure/Function declared in @Source (visible only inside that procedure/function, in addition to global ones).
@Variables {
global {
Username char(10)
MyDate date
Balance number(9,2)
}
MyProcedure {
counter number(3)
}
Greet {
name char(10)
}
}
One Name type(...) line per variable — same format as @Fields, but with more available types (see Data types): char, varchar, number, date, field(Field), list(type), matrix(rows, cols, type), struct(TemplateName).
Struct: inline template definition
Inside the global scope (only there) you can also define a struct template with struct Name [ ... ], before or after instantiating it with struct(Name) — see Data types: Struct for the full syntax and its limits.
Modifier
Only Description("text") is available in @Variables (unlike @Fields, it doesn’t support Default/AllowNull):
@Variables {
global {
RequestNo field(ADHOJA50) Description("Request number")
}
}
Length/precision limits (standalone variable, different from a table field)
| Type | Limit in @Fields | Limit in @Variables |
|---|---|---|
char | 1–32,766 | 1–16,773,104 |
varchar | not valid in @Fields | 1–16,773,100 |
number (precision) | 1–30 | 1–63 |
These larger limits in @Variables reflect that a variable declared there isn’t tied to a DDS physical file the way an @Fields field is.