Used to convert a text file from the DBFXFER command, to UTF-8 format.
By default, the data transfer mode is Unicode with Launcher (UTF-16LE).
Syntax
CHGVAR |
VAR(&CMD) VALUE('CSVUTF8') |
CHGVAR |
VAR(&PARM1) VALUE(' CSVIn="Path of the text file in input" ;CSVUTF8="Path of the result test file" [;CodeIn="Encoding of the input text file"]') |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT) |
Parameters
Parameters |
|
Parm1 |
CSVIn: Contains the full path of the text file from the DBFXFER command. CSVUTF8: Contains the full path of the text file converted to UTF-8. CodeIn: Optional. Can take the values "UTF-16LE" or "WINDOWS-1252". If this parameter is omitted, its default value is: "UTF-16LE". Indeed, the default data transfer mode is Unicode ("UTF-16LE") with Launcher. |
Parm2 |
|
Example
PGM
DCL VAR(&SVRADDR) TYPE(*CHAR) LEN(30) VALUE(*DEV)
DCL VAR(&HANDLE) TYPE(*CHAR) LEN(50)
DCL VAR(&CCSID) TYPE(*CHAR) LEN(10)
DCL VAR(&CMD) TYPE(*CHAR) LEN(10)
DCL VAR(&OPT) TYPE(*CHAR) LEN(1)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(512)
DCL VAR(&PARM2) TYPE(*CHAR) LEN(1024)
DCL VAR(&RESULT) TYPE(*CHAR) LEN(512)
CHGVAR VAR(&HANDLE) VALUE('*ONLY')
CHGVAR VAR(&CCSID) VALUE('*JOB')
CALL PGM(LNCOPEN) PARM(&HANDLE &SVRADDR &CCSID)
CHGVAR VAR(&CMD) VALUE('CSVUTF8')
CHGVAR VAR(&PARM1) +
VALUE('CSVIn="C:\A\csv.txt";CSVUTF8="C:\A\csv_utf8+
.txt"')
CHGVAR VAR(&PARM2) VALUE(' ')
CALL PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)
LNCCLOSE
ENDPGM