End Of Line (EOL) Character Encoding Using CP1252 and B34A1010
If using encoding CP1252 (ASCII), the EOL character is only LineFeed (hex 0A) and therefore, the flat file transferred during FTP also contains LineFeed. If the EOL characters Carriage Return (hex 0D) and LineFeed (hex 0A) are required in the flat file, use encoding IBM-37 instead and the FTP download from the AS/400 to the PC should be in non-Binary mode.
Following describes how to view flat file data on the AS/400 and on the PC to understand the EOL characters :
- On the AS/400, key in command WRKLNK to view the output flat file in Hex mode as follows, assuming flat file TEXT01.txt is in IFS directory /DV810/EXPORT :-
- Key in command WRKLNK ‘/DV810/EXPORT/TEXT01.txt. Take option 5 to browse the data
- Once in the Browse: /DV810/EXPORT/TEXT01.TXT screen, press F10 to display the data in Hex Mode (see below), the actual data in the file starts after the first row, every 2 hex characters make up the actual character. For CP1252 (ASCII) encoding, 61=a, 58=X, 0A=LineFeed etc.
- For IBM-37 (EBCDIC) encoding, 81=a, E7=X, 0D=CarriageReturn, 25=LineFeed.
- For the ASCII-EBCDIC chart, download from http://natural-innovations.com/computing/asciiebcdic.html.
Browse : /DV810/EXPORT/TEXT01.TXT (CP1252 – ASCII)
Record : 1 of 2 by 14 Column : 1 59 by 19
Control :
– – – – + – – – – * – – – – + – – – – * —-+—-*—-+—-*
405C5C5C 5C5C5C5C 5C5C5C5C 5CC28587 89959589 ************Beginni
6162630A abc
58595A0A XYZ
405C5C5C 5C5C5C5C 5C5C5C5C 5CC59584 40968640 ************End of
- On the PC, open the flat file using a Hex Editor; a free version is available to download from the site ( http://www.hhdsoftware.com/free-hex-editor ).
- Each data row is appended by either 1 or 2 dots (.), focus on each dot and the dot will focus on the corresponding hex code – 0d (carriage return), 0a (linefeed).
via Oracle
Average Rating