Skip to Content

Trying to understand auditing record count for flatfile

I am testing out Auditing for the record count of a flat file.

My goal is to raise an error if the record count exceeds a certain threshold.

I have set it up this way:

Select the flat file object in the Data Flow

Click Tools -> Audit... from the menu

Right click on the flat file and select count

This results in "Count" under the Audit Function Column and the count variable ($Count_HR_IOR_I001_FILEMERGE in my case) under the Audit Label column

Next -

Click the Rule tab

Click Add.

For this basic test I just wanted to test against a constant - say 100,000 records for the threshold.  The actual file I will be using has only 8847

I enter this as a custom rule:  > 100000

I also click the script box and have it print out the variable:  print ($Count_HR_IOR_I001_FILEMERGE || ' >= 100000);  Again, this is just a test.  Going forward I might try using a variable for the 100,000 which I would set ahead of this step

I click on the validation and it reports no errors.

However when I run this I get an unexpected result because this audit validation fails

In the job log I see this which I believe to be the "script" I entered for the audit.  If so, 8847 is the correct count, but it is not >= 100000

Furthermore, when I look the error detail part of the log (stop sign)  I see this which again is telling me that the count exceeds 100000, which it does not

From what I see, I believe I have this audit set up correctly, but I am wondering what I am missing as far as how to properly use this feature.

Any help would be really appreciated.


Jeff Henke

step1.jpg (62.6 kB)
step2.jpg (97.3 kB)
results1.jpg (24.8 kB)
results2.jpg (64.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 02, 2015 at 09:48 PM

    Isn't it just the other way round? Audit ruleĀ  > 100000 means your input needs more than 100K lines. s your file contains 8847 lines only, the audit rule fails.

    Add comment
    10|10000 characters needed characters exceeded

    • Ah, now it makes sense.  I was thinking of it backwards, as in the rule should fail when it exceeds 100K lines.  Thanks, I knew it was something obvious