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: 

WRITE STATEMENT

Former Member
0 Kudos

hi,

when i am writting :

write:/77 'A=', temp.

then........................

output........

A= 5000.000

i want the output to be.............

A=5000.000

can anyone suggest how to do???

second........

can i write my o/p at desired location i mean 10th row and 15th column.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

you can try this

data : v_p type p decimals 3.

v_p = 5000.

write : / 'A=' no-gap, v_p left-justified.

regards

shiba dutta

4 REPLIES 4

Former Member
0 Kudos

Hi

Yes You can write the field at your desired position

give the number after one field if you wants in the same line or

give / to print in the next line

You can concatenate the fields to print them together provided both the fields are CHAR type

There are so many options Available with WRITE statement. Go through them

Write: /5 'A = ', 10 temp. Gives A = 5000.000

Write: /5 'A = ', /10 temp.

gives A =

5000.000

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Former Member
0 Kudos

Hi,

You can use the concatenate statement i.e

CONCATENATE 'A=' fieldname into Variable

write : variable.

Thanks

Yogesh

former_member200338
Active Contributor
0 Kudos

Hi,

Yes. you can write the output where ever u want. Use position command.

example: position 10.

write: 'HI'.

use the keyword: NO-GAP in write statment. this will reduce the gap. like this

Write:/77 'A=', temp NO-GAP.

Regards,

Niyaz

Former Member
0 Kudos

you can try this

data : v_p type p decimals 3.

v_p = 5000.

write : / 'A=' no-gap, v_p left-justified.

regards

shiba dutta