Rejecting Null records
Moderators: chulett, rschirm, roy
Rejecting Null records
I had a situation where i have to reject Null records .
The Null records may be with spaces in one row & not having spaces at other.
I had used len(stripwhitespaces(col_name))=0 or isnull(col_name)
but it is rejecting only the column which is having spaces.
So i need to reject both columns which are null's either empty spaces or null value.
Please Suggest!!!!!
The Null records may be with spaces in one row & not having spaces at other.
I had used len(stripwhitespaces(col_name))=0 or isnull(col_name)
but it is rejecting only the column which is having spaces.
So i need to reject both columns which are null's either empty spaces or null value.
Please Suggest!!!!!
Re: Hadling Null
Perhaps something along the lines of
len(trim(NullToEmpty(column)))
Regards,
len(trim(NullToEmpty(column)))
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
This being the case, you are calling the empty columns (those without spaces) the Nulls? Do your input options convert empty strings to NULLs?
If your columns are set as Nullable=Yes, then check for Len(Trim(NullToEmpty(inputcolumn)))=0. If they are set as Nullable=No, then Len(Trim(inputcolumn))=0 should be sufficient. An variation of these would be: Trim(NullToEmpty(inputcolumn))="", or Trim(inputcolumn)="", respectively.
Regards,
If your columns are set as Nullable=Yes, then check for Len(Trim(NullToEmpty(inputcolumn)))=0. If they are set as Nullable=No, then Len(Trim(inputcolumn))=0 should be sufficient. An variation of these would be: Trim(NullToEmpty(inputcolumn))="", or Trim(inputcolumn)="", respectively.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
When i am using Trim(Input Col)="" then its working when input col has atleast one empty space.
Actually source row is " ,,abhi ,20100115,".
Then such record should be rejected.
When I am using Trim(Input Col)="".I tried with Trim(NullT0Empty(InputCol))="".
In both the cases record is dropping.
I need the reject to be rejected.
Actually source row is " ,,abhi ,20100115,".
Then such record should be rejected.
When I am using Trim(Input Col)="".I tried with Trim(NullT0Empty(InputCol))="".
In both the cases record is dropping.
I need the reject to be rejected.
Last edited by Abhi700 on Mon Jan 31, 2011 3:46 am, edited 1 time in total.
ABHILASH
I tried with this.StageVar:
If StripWhiteSpace(NullToEmpty(Input Col))<>'' Then If IsNotNull(Input Col) Then 0 Else 0 Else InputCol
Reject in Transformer where StageVar=0
But my Issue ha not resolved.
As specified in the above error my seq file record is as follows
" ,,Abhi,20100105"
I have to move it to reject link.
Last edited by Abhi700 on Thu Feb 03, 2011 12:30 am, edited 1 time in total.
ABHILASH
I am getting Nulls if there are no empty spaces i.e delimiter. If there are any empty spaces then it shows as blanks.Do a view of this sequential file in Seq File Stage. Are these values getting read as NULL or Blanks.
What is the condistion you have given in Transformer.
Can you post your code here.
ABHILASH