Home All Groups Group Topic Archive Search About

decimal column to PIC9(09)V99

Author
3 Aug 2006 10:53 PM
wnfisba
We have to extract an amount column defined as decimal9(11,2) to a COBOL
defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So,
100.00 needs to be extracted as 10000.

Can someone help me with this???

Thanks in advance for your help.

wnfisba

Author
3 Aug 2006 11:09 PM
Roy Harvey
Why not just ultiply the column by 100?

Roy Harvey
Beacon Falls, CT

On Thu, 3 Aug 2006 15:53:01 -0700, wnfisba
<wnfi***@discussions.microsoft.com> wrote:

Show quote
>We have to extract an amount column defined as decimal9(11,2) to a COBOL
>defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So,
>100.00 needs to be extracted as 10000.
>
>Can someone help me with this???
>
>Thanks in advance for your help.
>
>wnfisba
Author
3 Aug 2006 11:10 PM
Arnie Rowland
Here are a couple of options:


DECLARE @TestNumber decimal(11,2)
SET @TestNumber = 12345.67
SELECT
     cast(( @TestNumber * 100 ) AS int )
   , replace( cast( @TestNumber AS varchar(12)), '.', '' )


--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"wnfisba" <wnfi***@discussions.microsoft.com> wrote in message news:1803003F-95FF-4A41-B0E3-411D10E3934C@microsoft.com...
> We have to extract an amount column defined as decimal9(11,2) to a COBOL
> defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So,
> 100.00 needs to be extracted as 10000.
>
> Can someone help me with this???
>
> Thanks in advance for your help.
>
> wnfisba

AddThis Social Bookmark Button