I have a variable "A" with a picture clause as S9(11)V99 COMP. I need to write this into a file in the format +/- S9(11).99 (i.e. the sign should be leading and a decimal sign should also be there).
Can someone help me to do this. I have one limitation - I cannot change the picture clause of A.
Joined: 20 Oct 2006 Posts: 6970 Location: porcelain throne
you can have sign leading with datatype display, but not comp.
you can have a decimal sign with datatype alphanumeric
(after moving the contents of variable 'A' to a field defined with an edit mask)
but, you can not have a datatype comp with a decimal point physically contained in the comp variable
there is not need to change the picture clause of variable 'A'.
just define a field in your output file definition that contains an edit mask as the picture clause, move variable 'A' to this new field.
since most edit mask definitions (yes, you need to go to the manual),
contain provisions for only a + or -,
you may need extra code to insert the 'missing' sign.
but don't worry about that now, you will understand what I mean when
you have read the manual.