The system function VGLib.getVAGSysType identifies the target system in which the program is running. The function is supported (at development time) if the program property VAGCompatibility is selected or (at generation time) if the build descriptor option VAGCompatibility is set to yes.
If the generated output is a Java™ wrapper, VGLib.getVAGSysType is not available. Otherwise, the function returns the character value that would have been returned by the VisualAge® Generator EZESYS special function word. If the current system was not supported by VisualAge Generator, the function returns the uppercase, string equivalent of the code returned by SysVar.systemType.
VGLib.getVAGSysType( ) returns (result CHAR(8))
VGLib.getVAGSysType returns the VisualAge Generator equivalent of the value in SysVar.systemType.
Value in sysVar.systemType | Value returned by VGLib.getVAGSysType |
---|---|
AIX® | "AIX" |
DEBUG | "ITF" |
ISERIESC | "OS400" |
ISERIESJ | "OS400" |
LINUX | "LINUX" |
USS | "OS390" |
WIN | "WINNT" |
// valid ONLY for sysVar.systemType if sysVar.systemType is AIX call myProgram; end
The only place that VGLib.getVAGSysType can be used is as the source in an assignment or move statement.
It is recommended that you use sysVar.systemType instead of VGLib.getVAGSysType.
mySystem CHAR(8); mySystem = VGLib.getVAGSysType(); if (mySystem == "AIX") add myRecord; end
mySystem CHAR(8); mySystem = VGLib.getVAGSysType(); if (mySystem == "AIX") call myAddProgram myRecord; end
An alternative way to solve the problem is available, but only if you use sysVar.systemType instead of VGLib.getVAGSysType; for details, see eliminateSystemDependentCode.
Related reference
EGL library VGLib
eliminateSystemDependentCode
systemType