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: 

Text mode and Binary mode

Former Member
0 Kudos

Can anybody give the differences between Text and Binary modes that are used with Datasets??

3 REPLIES 3

Former Member
0 Kudos

For Binary Mode

The contents of the file are not structured in lines in the READ DATASET or TRANSFER operations. Instead, they are input or output as a stream. You do not have to specify the IN BINARY MODE addition explicitly.

For Text Mode

If you use this addition, the contents of the file are structured in lines. Each time you use the READ DATASET or TRANSFER statement, the system reads or writes a single line. If the data object to which you are transferring the data is too big, it is padded with spaces. If it is too small, the data record is truncated.

Hope this helps.

ashish

Former Member
0 Kudos

Hi

Text Mode means that the records in the file have a carriage return marking the end of each record.

Binary Mode means the file is a string of data.

You can't read a text file in BINARY MODE, or a binary file in TEXT MODE.

<b>Reward if usefull</b>

Former Member
0 Kudos

Hi,

<b>Binary mode.</b>in binary mode it opens the file as binary file.Both while reading a binary file

or writing to a binary file,the content transfered is in unchanged form.

it is same both in unicode and in non-unicode programs.

TEXTMODE:

for Text mode, it opens the file as text file. "Encoding " addition is specified

to define how the characters are represented in the txt file.if data type is char and flat, trailing blanks are removed.if datatype si stirng, trailing blanksa are not removed.

in unicode programs, only the content in char type data objects can be read or write into text file and encoding addition must be specified.

we can omit encoding addition for non unicode programs.

TExt mdoe encoding [line feed].

regards,

Sandhya.

rewards points if useful.