gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Justified right.


From: cris . schlehuber
Subject: Re: [open-cobol-list] Justified right.
Date: Thu, 31 Jan 2008 08:11:19 -0600


John,

I have not tried it in awhile, but I believe the NUMVAL (or NUMVAL-C) FUNCTION will take an alphanumeric (I believe that spaces can be embedded) and move it to a numeric field.

Untested code

05  A PIC X(20).
05 B PIC 9(9)v99.

MOVE FUNCTION NUMVAL A TO B.

Cris

address@hidden wrote on 01/30/2008 05:36:48 PM:

> I will be bringing in fields from another program that may be in the
> forms
> 1.23
> 12.34
> 123.45
> etc.
> I propose to move these fields to a non-numeric and space-filled
> field defined
> as "JUSTIFIED RIGHT." Then I plan to redefine the field as 99999.99 or
> thereabouts.  Will this work? The intent is to take ASCII strings containing
> dollar values of any arbitrary length and convert them into numeric data for
> mathematical manipulation.
>
> The strings will come in from a record that may contain  comma-delimited
> fields. UNSTRING will retrieve the data but the justification will be
> inherently left and not right.  
> --
> John Culleton
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
>
https://lists.sourceforge.net/lists/listinfo/open-cobol-list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]