The system function SysLib.convert converts data between EBCDIC (host) and ASCII (workstation) formats or performs code-page conversion within a single format. You can use SysLib.convert as the function name in a function invocation statement.
SysLib.convert( target anyFixedItemOrRecordOrFormVariable inout, direction enumerationConversionDirection in, conversionTable CHAR(8) in)
You can use the linkage options part to request that automatic data conversion be generated for remote calls, to start remote asynchronous transactions, or for remote file access. Automatic conversion is always performed using the data structure defined for the argument being converted. If an argument has multiple formats, do not request automatic conversion. Instead, code the program to explicitly call SysLib.convert with redefined record declarations that correctly map the current values of the argument.
Record RecordA record_type char(3); item1 char(20); end Record RecordB record_type char(3); item2 bigint; item3 decimal(7); item4 char(8); end Program ProgramX type basicProgram myRecordA RecordA; myRecordB RecordB {redefines = "myRecordA"}; myConvTable char(8); function main(); myConvTable = "ELACNENU"; // conversion table for US English if (myRecordA.record_type == "00A") SysLib.convert(myRecordA, "L", myConvTable); else; SysLib.convert(myRecordB, "L", myConvTable); end call ProgramY myRecordA; end end
Related concepts
Syntax diagram for EGL functions
Related reference
Data conversion
EGL library SysLib
callConversionTable