[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Negative Number



Explicitly convert the string of the negative character to number.
Hope this helps.




---"McClure, John" <john.mcclure@WILCOM.COM> wrote:
>
> Hello!  I'm reading a flat file which has the Negative Sign at the
end of
> the Amount field i.e., 0000000000000083-  I'm trying to move the
Negative
> Sign to the beginning of the Amount.  My code is as follows:
>
> let $sign = substr($TL_GLADD.GLADD.amount,17,1)
> if $sign = '-'
>    let $amt = substr($TL_GLADD.GLADD.amount,1,16)
>    let $new_amt = '-' || $amt
> else
>    let $new_amt = $TL_GLADD.GLADD.amount
> end-if
>
> It inserts everthing but the Negative Numbers.  Does anyone have any
> suggestions?
>
> p.s. here is the error I'm getting
>
> Record#  Field Name       Field Value      Message
> Action
> -------  ---------------  ---------------
> -----------------------------------------------------
> ----------------------
>       1  amount           0000000000000083-Source field not a number.
>
>
> John McClure
> Williams Communications Solutions
> Office:  (713)307-4318
> Pager:  (888)740-0554
> Email:   john.mcclure@wilcom.com
>

==
Dosani Ali

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com