Hello,
I have a sequential file that is showing empty but is really not empty, the file shows having empty rows like this:
,,,,,,,,,,
,,,,,,,,,,
for one or more rows.
How can I reject a row if is empty?
Thanks,
Emilio
The first help is to point out you are posting in the wrong forum. (editor's note: Topic has now been relocated)
The second help is to suggest putting a constraint in place in a transformer to throw away any rows that have a blank value where one isn't allowed. You can't really avoid reading those rows, the best thing to do is send them to an exception file or just throw away.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
You need to check every column. The Format tab of your Sequential File stage specifies that "" is to be understood as NULL, so you need either to change this or to check using the IsNull() function.
Another possibility is to read the file as if it contains just one large string column, and then to use a constraint such as
I hate that. It generates a warning in the job log. My idea of best practice is that no job that executes successfully generates a warning.
Prefer a second output link whose constraint expression is the logical inverse of the constraint expression on the "good rows" output link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I am in the windows enviroment but I was able to do it using the following contraint. Perhaps someone have a better way to do it:
trim(NullToEmpty(xfmMissCode1.ArmConvOpt)) <> "" OR trim(NullToEmpty(xfmMissCode1.ArmIndexCode)) <> "" OR trim(NullToEmpty(xfmMissCode1.ArmNegAmrFlag)) <> "" OR trim(NullToEmpty(xfmMissCode1.ArmRoundFlag)) <> "" OR trim(NullToEmpty(xfmMissCode1.BorrSelfEmpFlag)) <> "" OR trim(NullToEmpty(xfmMissCode1.BorrSex)) <> "" OR trim(NullToEmpty(xfmMissCode1.CoBorrSex)) <> "" OR trim(NullToEmpty(xfmMissCode1.DocumentCode)) <> "" OR trim(NullToEmpty(xfmMissCode1.DwellTypeCode)) <> "" OR trim(NullToEmpty(xfmMissCode1.LimitDocFlag)) <> ""
er
Nothing wrong with that. Whatever you do, if you've read multiple columns you have to test them all.
The only other approach is to read the file as if it contains just one column, and only allow it to pass if it contains more than just commas (you could test its length, for example Len(InLink.TheSingleColumn) > 9). Then use output column derivation expressions using the Field() function to parse that single column into the requisite number of discrete columns.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.