I have an annoying phantom in my routine, I try to find it but I can't
![Sad :(](./images/smilies/icon_sad.gif)
Please help...
Nvl code:
If IsNull(arg) Then
Ans = default
End Else
Ans = arg
End
This is my routine code:
DEFFUN Nvl(arg,default) CALLING "DSU.Nvl"
Ans = ""
If IsNull(account_type) Then
Ans = 'Account Type is NULL for ID = ':Nvl(id,"")
return (Ans)
End
If IsNull(book_code) Then
Ans = 'Deal Book is NULL for CUSTOMER=':Nvl(customer,"")
return (Ans)
End
If IsNull(counterparty_code) Then
Ans = 'Counterparty Code is NULL for ORIGIN=':Nvl(origin,""):' and CUSTOMER=':Nvl(customer,"")
return (Ans)
End
If IsNull(currency) Then
Ans = 'Currency is NULL'
return (Ans)
End
If IsNull(balance_c) and IsNull(balance_d) Then
Ans = 'Balance is NULL for ID=':Nvl(id,"")
return (Ans)
End
cp = Nvl(compound_periodicity,'')
If Not(IsNull(compound_periodicity)) AND cp<>'A' and cp<>'S' and cp<>'Q' and cp<>'M' and cp<>'N' Then
Ans = 'Compound Periodicity not in (A, S, Q, M, N)'
return (Ans)
End
If Not(Nvl(interest_reinvest,'F')<>'T' or Nvl(compound_periodicity,'N')='N') Then
Ans = 'Check Interest Reinvest and Compound Periodicity'
return (Ans)
End
p = Nvl(periodicity, '')
If Not(IsNull(periodicity)) AND p<>'A' and p<>'S' and p<>'Q' and p<>'M' and p<>'N' Then
Ans = 'Periodicity not in (A, S, Q, M, N)'
return (Ans)
End
ab = Nvl(accrual_basis, '')
If Not(IsNull(accrual_basis)) AND ab<>'1' and ab<>'2' and ab<>'3' and ab<>'4' and ab<>'5' and ab<>'B' Then
Ans = 'Accrual Basis not in (1, 2, 3, 4, 5, B)'
return (Ans)
End
If (Nvl(interest_reinvest,'F')='T') and (Nvl(compound_periodicity,'N')<>'N') Then
Ans = 'Incorrect interest reinvest and/or compound periodicity'
return (Ans)
End
return (Ans)
Thanks in advance.
Best regards,
Piotrek