Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to distinguish number 0 and the NULL data?

y0y0
Discoverer
532

Dear,

Hi, I want to upload a txt file with some fields and their detail data.

But the detail include the NULL(maybe space char) and also the number 0.000.

In the program i wanna choose the not initial fields, but when i write the code:

IF NOT <l_field> IS INITIAL

It filter the the number 0.000.

How can i choose the number 0.000.

The detail txt format is in screenshot.

Thanks in advance.

3 REPLIES 3

xiswanto
Active Participant
473

it depend on what the type of the field is, the value regarded as initial could be different. what are the type of the field you declare to hold value for field3?

for example, char field will regard any input (letter, number, symbol, ascii code) as not initial, numeric field (decimal, type i, type p, or n) will regard any number aside from 0 as not initial (such as value '0.001', '1.01', and etc)

y0y0
Discoverer
0 Kudos
473

Thanks so regard, i have resolved it. I added a filter while loop these fields with a flag.

And modify the code: IF NOT <l_field> IS INITIAL OR flag = 'N'.

Maybe it is a stupid way. : )

Thanks a lot.

Sandra_Rossi
Active Contributor
0 Kudos
473

Please convert your comment into answer (solution) and accept it.