10-14-2019 05:15 AM
Good Morning:
Looking to solve: Validation of a file as a whole. Should one record be invalid within a file that is read, then the entire file would be marked as invalid. No matter where the error occurs within the file. Additional info follows.
I am working on a pipeline that is processing a batch of records contained within CSV formatted file. I perform the following steps:
At the end I have the set of records that contain errors within the Filter for errors and also the set of records that passed the filter/validation.
I can write these out to an error and a non error file. But I want to have only one file either an error file or a success file at the end of the pipeline. I am open to other ideas.
Thanks so much for your help and ideas.
J
10-15-2019 01:27 AM
Cant you use a union for you error and regular flow? If the file structure is same
10-15-2019 05:07 AM
Morning:
I can try that. The union perhaps with a move at the end. I would have the error output stream and the success output stream. I will give that a try.
Thanks.
10-15-2019 11:34 AM
So close, ok so I have the error and the success streams. I am rejoining them. When I have any error, I want the filename to be have a .err extension. When I have no errors I want the filename to have a .csv extension.
If only there was an if error file exists then merge files and set file extension to err else no errors so set file extension to csv that would allow this to work.
I thought about running one pass creating a status file that contains either 0 or 1 and then using that status to define the output file extension.