Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating $ sign

Status
Not open for further replies.

jmanj

Programmer
May 20, 2003
298
US
I don't have a reference to MicroFocus NetExpress cobol 4.2 I think. I wonder if there is a way to do a floating dollar sign to a field. I don't remember if this is even possible in cobol. I have a client who wants an excel or csv output with
amount having dollar sign. Without using any intrinsic function, is there a way to do this?

something like NUMR PIC -ZZZ,ZZ$.99 VALUE ZEROES.
or NUMR PIC -BBB,BB$.99 VALUE ZEROES.

Otherwise I can always use the longer method of placing
the amount into an array and inspect it.

Thanks for any help.
 
PIC $$$,$$$.99

This will float the dollar sign and leave spaces in the unused bytes. 1047.99 would print as b$1,047.99 where b is a space.

Remember to have at least one more dollar sign than you have digits to the left of the decimal in your sending field. If not, it will truncate the leftmost digits. In the above example if we tried to move 150999.99 to the edit PIC we would get $50,999.99
 
COBOLKENNY,

Thanks very much. I will test this. You just refreshed my memory. This is almost the same editting in other language
like SQR.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top