sysVar.systemType
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
- iseriesj
- For iSeries
- linux
- For Linux (on Intel-based hardware)
- 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 sysLib.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; endTo 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
Related reference
eliminateSystemDependentCode
sysLib.getVAGSysType