In this article we will look into how to skip the Header Record from processing in the HDL Transformation Formula.
If you are new to HDL Transformation Formula, please go through the below articles to get an idea of it before proceeding futher.
The HDL FF will convert the Input Flat File into HDL format pipe delimited file, zip it and upload it to UCM.
Now in most of the cases there will be a header record on the input file and if we don’t skip the header record, it will also get processed as detail record and MERGE entries will get created on the HDL file and the Import would fail.
In order to avoid this scenario, we need to write logic to skip the header record in the HDL FF.
Consider a sample Input File
Employee Number|Name|Company|NID 324334234|Test, Employee 1|1234|123456789 234324343|Test, Employee 2||234567809
Here the first record is the header and it needs to be skipped in the HDL FF
Now, let’s check out the logic that we need to write. As the input file is a pipe delimited one, the POSITION1 would capture the first field on the header and will have a value of ‘Employee Number‘. So we will write a condition to check that and skip it.. To skip the record we will just set the flag LINEREPAT to ‘N’ and then return it. What this condition does is, it won’t return anything and it will not repeat the FF for that row again..
The remaining logic to return the actual business object details should be kept after this logic.
Logic for skipping Header record
IF POSITION1 = 'Employee Number' THEN (LINEREPEAT = 'N' RETURN LINEREPEAT) /* To skip header row */
Note: This logic should be the first logic that should be placed in the OPERATION=’MAP’ condition before/after assigning local variables.
If you want to check out sample FF using this logic, you can check the below article
Hope this helps you to solve issues with header record processing in HDL FF. Similarly you can also add logic for Trailer record if there is any.