Skip to content

MakeDecimalForCsv routines return null when value is zero #21

Description

@ameyer66

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions