FWIW - the best thing, IMO, is to change the generating program's PIC 
clause to:

        PIC S9(09)V.9(04) SIGN IS LEADING SEPARATE.

This will take up two more characters in the output line. It will insert 
an actual decimal point and prefix the number with a + or a - sign. Much 
easier to process in a non-COBOL language.

Sorry if this COBOL-talk offends any Perl-ites <grin>.

On Sat, 10 Jan 2004, Olivier Wirz wrote:

> Hello,
> 
> What is the best way to convert a numeric cobol format S9(09)V9(04) in a
> more readable way.
> 
> For example:
> 
>  000001000000} will be -1000.0000
>  000001000000{ will be  1000.0000 
> 
> It works with substr and =~, but may be there is a module or another better
> way.
> 
> Thank you.
> 
> Olivier 
> 
> 

-- 
--
Maranatha!
John McKown


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to