Skip to Content
author's profile photo
Former Member

WRITE STATEMENT

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 11:21 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 10:21 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 10:23 AM

    Hi,

    You can use the concatenate statement i.e

    CONCATENATE 'A=' fieldname into Variable

    write : variable.

    Thanks

    Yogesh

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 29, 2007 at 10:24 AM

    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

    Add comment
    10|10000 characters needed characters exceeded