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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert from comp-3 to picture

Status
Not open for further replies.

lbzh

Programmer
Aug 7, 2004
25
0
0
US
I am trying to read in pic 9(5) comp-3 field as in:

4 AB-QTY PIC S9(5)V99 COMP-3.

and then write it out to a file stripping the COMP-3 format and also including a decimal point. This is what I did:

MOVE AB-QTY TO OUT-AB-AMT.


where OUT-AB-AMT is defined as:

OUT-AB-AMT PIC S9(5).99.

I get the following error:

GYDS1149-S "S9(5).99" was not a valid combination of "PICTURE" string
characters. A "PICTURE" string of "S9(1)" was assumed.

Any ideas how I can do the conversion of a comp-3 and output it as a decimal without getting this error?
 
I'm not near a compiler at the moment, so can't try this out, but a '.' is an editing character, whereas an 'S' isn't. Try -9(5).99 instead.

Marc
 
What do you want the output to look like? Leading/trailing sign? Suppress leading zeroes? It's all in the PICture.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top