Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What is difference between TEXT mode and BINARY mode?

Former Member
0 Kudos

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 .

3 REPLIES 3

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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