getVAGSysType()

The vgLib.getVAGSysType() system function identifies the target system in which the program is running. The function is supported only if you are running in VisualAge® Generator compatibility mode. Use sysVar.systemType instead.

If the generated output is a Java™ wrapper, vgLib.getVAGSysType() is not available. Otherwise, the function returns the character value that was previously 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 stored in sysVar.systemType.

The value returned by vgLib.getVAGSysType() can be used only as a character string; you cannot use the returned value with the operators 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;
  end

Syntax

  vgLib.getVAGSysType( )
  returns (result CHAR(8))
result
A character string that contains the system type code, as shown in the next table.
Table 1. Return values for getVAGSysType
Value in sysVar.systemType Value returned by vgLib.getVAGSysType
AIX® "AIX"
DEBUG "ITF" [Integrated Test Facility]
HPUX "HP"
IMSBMP "IMSBMP"
IMSVS "IMSVS"
ISERIESC "OS400"
ISERIESJ "OS400"
LINUX "LINUX"
SOLARIS "SOLARIS"
USS "OS390"
VSEBATCH "VSEBATCH"
VSECICS "VSECICS"
WIN "WINNT"
ZLINUX "ZLINUX"
ZOSBATCH "MVSBATCH"
ZOSCICS "MVSCICS"

Definition considerations

The value of vgLib.getVAGSysType() does not affect the code to be validated at generation time. For example, the following add statement is validated even if you are generating Java code for Windows:
  mySystem CHAR(8);
  mySystem = vgLib.getVAGSysType();
  if (mySystem == "AIX")
    add myRecord;
  end
To avoid validating code that never runs 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 = vgLib.getVAGSysType();

  if (mySystem == "AIX")
    call myAddProgram myRecord;
  end

Feedback