The
system variable SysVar.systemType identifies the
target system in which the program is running. If the generated output is
a Java™ wrapper, SysVar.systemType is not available. Otherwise, the valid values are as follows:
aix
For AIX®
debug
For the EGL Debugger
hp
For HP-UX
iseriesj
For iSeries™
linux
For Linux® (on
Intel-based hardware)
solaris
For Solaris
win
For Windows® 2000/NT/XP
You can use SysVar.systemType in these ways:
As the source in an assignment or move statement
As a variable in a logical expression
As the argument in a return statement
The characteristics of SysVar.systemType are
as follows:
Primitive type
CHAR
Data length
8 (padded with blanks)
Is value always restored after a converse?
Yes
Use SysVar.systemType instead of VGLib.getVAGSysType.
Definition considerations
The value of SysVar.systemType does not affect
what code is validated at generation time. For example, the following add statement
is validated even if you are generating for Windows:
if (sysVar.systemType IS AIX)
add myRecord;
end
To avoid validating code that will never run in the target system, take
either of the following actions:
Set the build descriptor option EliminateSystemDependentCode to
YES. In the current example, the add statement is
not validated if you set that build descriptor option to YES. Be aware, however,
that the generator can eliminate system-dependent code only if the logical
expression (in this case, SysVar.systemType IS AIX) is simple
enough to evaluate at generation time.
Alternatively, move the statements that you do not want to validate to
a second program; then, let the original program call the new program conditionally:
if (SysVar.systemType IS AIX)
call myAddProgram myRecord;
end
Example
if (SysVar.systemType is WIN)
call myAddProgram myRecord;
end