Skip to Content
avatar image
Former Member

What is difference between TEXT mode and BINARY mode?

Hi,

What is difference between TEXT mode and BINARY mode? In TEXT mode what is "ENCODING DEFAULT".

OPEN DATASET wl_filename FOR INPUT

IN TEXT MODE ENCODING DEFAULT.

OPEN DATASET wl_filename FOR INPUT

IN BINARY MODE .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 27, 2007 at 07:53 AM

    Hi vishnu,

    1. files like .TXT files are considered to be text,

    and other files like .EXE . DOC etc are binary files.

    2. In text files, after each line, there are two

    internal binary characters

    one for line feed and another one for newline.

    3. But, we don't have any meaning for it,

    when we view such files in notepad, for eg.

    Hence, to only get the understandable content,

    we should open such TXT files, in text mode.

    (we can also open them in binary mode,

    but we will get two extra characters after each line,

    and such two extra characters are meaningless

    for interpreting the text)

    4. In binary mode, each byte by byte is considered,

    without any meaning.

    regards,

    amit m.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 27, 2007 at 08:28 AM

    Hi Amit,

    For the text mode we use encoding default that is it supports all languages.

    since in binary mode it need not support any other languages

    so we need not use encoding default ...

    Regards.

    Sana.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 27, 2007 at 08:39 AM

    hi,

    1. text mode means the output will come as line by line.

    2. binary mode means , output will come as character by characer and in this we can create spaces, commas, symbols also

    Add comment
    10|10000 characters needed characters exceeded