Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MakeDecimalForCsv routines return null when value is zero #21

Open
ameyer66 opened this issue Mar 5, 2020 · 0 comments
Open

MakeDecimalForCsv routines return null when value is zero #21

ameyer66 opened this issue Mar 5, 2020 · 0 comments

Comments

@ameyer66
Copy link

ameyer66 commented Mar 5, 2020

The two routines MakeDecimalForCsvNegatives(n) and MakeDecimalForCsvNoNegatives(n) both return a NULL string if the value of 'n' equals zero.
This caused issues in a bulk load when the program tried to load the null data into a field that was set to no nulls.
Fixed it by changing the freturn string to "0" from "" in the two routines in my build.

function MakeDecimalForCsvNegatives, a
    required in aNumber, n
    external function
        IsDecimalNegatives, boolean
    endexternal
proc
.ifdef DBLV11
    if (%IsDecimalNegatives(aNumber))
        freturn %string(aNumber)
.else
    if (aNumber && %IsDecimalNegatives(aNumber))
        freturn %string(aNumber)
.endc
    freturn "0"  ;; fixed this line
endfunction

function MakeDecimalForCsvNoNegatives, a
    required in aNumber, n
    external function
        IsDecimalNoNegatives, boolean
    endexternal
proc
.ifdef DBLV11
    if (%IsDecimalNoNegatives(aNumber))
        freturn %string(aNumber)
.else
    if (aNumber && %IsDecimalNoNegatives(aNumber))
        freturn %string(aNumber)
.endc
    freturn "0" ;;fixed this line
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant