sysLib.getVAGSysType
The system function sysLib.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, sysLib.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.
- result
- A character string that contains the system type code, as shown in the next table.
sysLib.getVAGSysType returns the VisualAge Generator equivalent of the value in sysVar.systemType.
Value in sysVar.systemType Value returned by sysLib.getVAGSysType AIX "AIX" DEBUG "ITF" ISERIESC "OS400" ISERIESJ "OS400" LINUX "LINUX" USS "OS390" WIN "WINNT" The value returned by sysLib.getVAGSysType can be used only as a character string; you cannot use the returned value with the operands is or not in a logical expression, as you can with sysVar.systemType:
// valid ONLY for sysVar.systemType if sysVar.systemType is AIX call myProgram; endThe only place that sysLib.getVAGSysType can be used is as the source in an assignment or move statement.
The characteristics of sysLib.getVAGSysType are as follows:
- Primitive type
- CHAR
- Data length
- 8 (padded with blanks)
- Is value always restored after a converse?
- Yes
It is recommended that you use sysVar.systemType instead of sysLib.getVAGSysType.
Definition considerations
The value of sysLib.getVAGSysType 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:
mySystem CHAR(8); mySystem = sysLib.getVAGSysType(); if (mySystem = "AIX") add myRecord; endTo avoid validating code that will never run in the target system, move the statements that you do not want to validate to a second program; then, let the original program call the new program conditionally:
mySystem CHAR(8); mySystem = sysLib.getVAGSysType(); if (mySystem = "AIX") call myAddProgram myRecord; endAn alternative way to solve the problem is available, but only if you use sysVar.systemType instead of sysLib.getVAGSysType; for details, see eliminateSystemDependentCode.
Related reference
eliminateSystemDependentCode
sysVar.systemType