CA TPX Session Management for z/OS

Expand all | Collapse all

Carriage-Return, Line-Feed and XCOM transfers between Windows and Unix

  • 1.  Carriage-Return, Line-Feed and XCOM transfers between Windows and Unix

    Posted 04-19-2017 01:28 AM

    What happens with the End-of-line-character(s) during a XCOM-transfer between Windows and Unix?

    On Windows the End-of-line is indicated by the two characters: [CR] (Carriage Return - x'0d') and [LF] (Line Feed - x'0a'). On Unix-Flavours the End-of-Line is indicated by [LF] (Line Feed - x'0a') only.

     

    When you transfer a file from Unix to Windows and use CODE_FLAG=ASCII or CODE_FLAG=UTF8 then the [LF]-Line Feed Characters are translated into [CR][LF] Carriage Return-Line Feed by Windows, NOT by XCOM!. Only if you use CODE_FLAG=BINARY the transfer is done byte by byte and the [LF] are not touched by Windows.

     

    When you transfer a file from Windows to Unix and use CODE_FLAG=ASCII or CODE_FLAG=UTF8 then the [CR][LF]-Carriage Return-Line Feed Characters are translated into [LF] Line Feed by the Unix Operating System, NOT by XCOM!. Only if you use CODE_FLAG=BINARY the transfer is done byte by byte and the [CR][LF] is not touched by Unix.



  • 2.  Re: Carriage-Return, Line-Feed and XCOM transfers between Windows and Unix

    Posted 04-24-2017 02:27 PM

    End of line (EOL) characters are dictated by underlying OS file system. For example: Linux/Unix platforms use a LF(x0a) to distinguish EOL where as Windows uses CRLF(x0d0a). Since each OS file system may support EOL characters/delimiters other then what the initiating system supports, XCOM removes the EOL characters before sending the data. It is up to the receiving platform to add the EOL characters it supports when it writes the data to disk.  This is true for all transfers that specify the CODE_FLAG=ASCII/EBCDIC parameter. 

     

    Also all CODE_FLAG=ASCII/EBCDIC data translation is performed on the non-ebcdic  XCOM platforms (Linux, Unix, Windows, ect). For example, transfers that are initiated by z/OS or OS/400 send the data in an EBCDIC format. If the receiving systems is a Linux/Unix/Windows (LUW) systems  and the CODE_FLAG=ASCII, the data will be translated to ASCII. If  CODE_FLAG=EBCDIC, then no translation and the data will be written as EBCDIC along with the proper EOL characters.

     

    CODE_FLAG=BINARY transfers indicate that no translation or removal of EOL characters when sending and addition EOL characters  when receiving/writing. The file is sent as is. 

     

    Transfers that specify a CODE_FLAG=UTFxx  indicates a Unicode file, which is based on the UTFxx encoding system, is being transferred. When this option is set, the LOCAL_CHARSET/ REMOTE_CHARSET parameters are used to identify the character encoding of the input file and the required encoding for the output file