Application Development and Automation 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: 
Read only

write-write to

Former Member
0 Likes
740

Hi Experts,

Can you please send me the difference between the<b> write and write to</b> ...

thanks in advance

Santosh

7 REPLIES 7
Read only

suresh_datti
Active Contributor
0 Likes
718

write: / w_str --> the values in the variable is displayed on the list

write 'hello' to w_str --> the value gets passed to the string.

Generally you WRITE TO a variable to use the formatting options. Press F1 on WRITE & you will know a lot more.

~Suresh

Read only

0 Likes
718

Suresh,

write to w_str

does not work if str is defined as type STRING.

A great disadvantage!.

Regards,

Clemens

Read only

Former Member
0 Likes
718

WRITE is to simply write out to the screen where WRITE TO will be used when you want to move a value from one variable to another, yet take advantage of the implicit formatting options that a WRITE command provides. MOVE will not provide you with such features.

Read only

Former Member
0 Likes
718

WRITE will display any text/variable on the list.

ex: write 'Hello'.

WRITE TO will assign the contents of one variable to another variable, and in the output display format.

ex: write abc to xyz.

Hope I am clear

Regards.

Read only

Former Member
0 Likes
718

Hi,

Write -> write the results as a list-output.

Write to -> writes the results into a workarea and can be moved into an internal table. You can use all formatting options in these two stmts.

Regards

Subramanian

Read only

amit_khare
Active Contributor
0 Likes
718

Check the link -

Regards,

Amit

Read only

Former Member
0 Likes
718

Write w_str. * This writes the value in w_str to list..

Write w_str to w_str1. * This writes the value in w_str to w_str1 variable.

The WRITE TO statement always checks the settings in the user’s master record. These specify, for example, whether the decimal point appears as a period (.) or a comma (,). You can also use all of the formatting options available with the WRITE statement, apart from UNDER and NO-GAP.

This statement converts the contents of a data object <f1> to type C, and places the string in the variable <f2>. The data type of <f1> must be convertible into a character field; if it is not, a syntax or runtime error occurs.

Write to is mainly used to apply the user master settings to the date and p type variables ( the date format and decimal format )

For example, if you write a date using the WRITE TO, it will apply the user specific formatting.

20061224 -> 12/24/2006

Also if writing type P fields.

1234.00 -> 1,234.00

reward helpful answers...

sai ramesh