(field1 > ' ' OR field2 ='N') AND ENDOFDATA IS FALSE
field2 is stage variable checks for a numeric field value and sets 'Y' if it is spaces or lowvalues or zero else 'N'.
Problem:
when field1 is put to spaces or low values , even if field2 ='N' (i.e., valid non-zero numeric value), it bypasses the record in the o/p file.
I have tried various alternatives to this solution but end result is still the same . Can any one suggest where the problem could be.
Are field1 and field2 columns from an upstream stage, stage variables, or what?
What is the data type of field1? How does it get its value assigned? Are you confident that field2 is being calculated correctly? Have you checked - perhaps by dumping a copy of the input stream into a text file and viewing that - what values field1 and field2 are getting?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Are field1 and field2 columns from an upstream stage, stage variables, or what?
What is the data type of field1? How does it get its value assigned? Are you confident that field2 is being calculated correctly? Have you checked - perhaps by dumping a copy of the input stream into a text file and viewing that - what values field1 and field2 are getting?
Thanks Ray.
field1 one is PICX(2), and it is coming from source stage(MFF),
and regarding field2 it is a stage variable and when I use just field2 ='N' as constraint I am getting the expected result so I am confident about it.
And only problem comes when I use multiple checks with OR like
In the comparison for field1, is the constant on the right hand side two characters long (that is, compliant with PIC X(2))? That is, are you comparing field1 against a string containing two space characters.
Clutching at straws a little here. Can you also try surrounding the second expression with parentheses?
ray.wurlod wrote:In the comparison for field1, is the constant on the right hand side two characters long (that is, compliant with PIC X(2))? That is, are you comparing field1 against a string containing two space characters.
Clutching at straws a little here. Can you also try surrounding the second expression with parentheses?
(field2 = 'N' OR field1 > " ") AND (ENDOFDATA IS FALSE)
Two spaces or one space it should not matter. All I need is character values greater than spaces. I agree you never whats lurking inside,I tried all different combinations but I will try it tommorow and will let you know.
(field2 = 'N' OR field1 > " ") AND (ENDOFDATA IS FALSE)
((field2 = 'N') OR (field1 > " ")) AND (ENDOFDATA IS FALSE)
and vice versa
Nothing seems to work. If it matters, field1 is normalized variable of OCCURS clause and field2 also sets its value based on Numeric i/p variable , which is also Normalized from OCCURS. Both OCCUR equal number of times.
can you modify your job to see which part of the OR isn't working as expected? My suspicion is that the
(ENDOFDATA IS FALSE)
part isn't doing it - but it is unfounded and I don't have a 390 to try out.
well
(ENDOFDATA IS FALSE AND FIELD1 > ' ')
was original condition to start with which was functioning well, but due to the change in requirement another OR condition was added along with field1.
I did similar kind of thg for other jobs but in thatall the fields in the constraint were PICX. So I am guessing sthg fishy when you use PICX field ORed with NUMERIC field.