Comprehensive support is available in ACCELQ to build test logic involving fixed-width files. You may define multiple custom schemas for fixed-width files. Several commands are available to read, verify or update content in fixed-width files. These commands are especially helpful in the ETL testing environment.
Open Fixed width file
Opens a fixed width file and assigns the given reference name. This reference name is required in other commands to work with this file.
fixed width file path |
fixed width file path |
Define Fixed width file schema
Defines fixed width file schema for given fixed width file. Make sure to define fixed width file before this.
schema type |
schema type |
Get record count from Fixed width file
Returns the record count from fixed width file with given reference. Returns -1 on the error file.
reference name |
fixed width file reference name |
Get field count of Record from Fixed width file
Returns the field count of a row from fixed width file with given reference name. On error -1.
record number |
record number to get field count from (starts from 1) |
Get field text from Fixed width file
Gets the field text of a record from fixed width file with a given reference name.
reference name |
fixed width file reference name |
Get record text from Fixed width file
Gets the content of a record from fixed width file with a given reference name.
reference name |
fixed width file reference name |
Get record(s) containing text in Fixed width file
Finds record numbers in fixed width file with given reference name with matching criterion.
record selection criteria |
to return just the first matching record number or |
Verify field text in Fixed width file
Verifies whether the text in the specified field is as expected in a given fixed width file.
reference name |
fixed width file reference name |
Add a new record to Fixed Width file
Adds a new record to fixed width file with given reference name with matching criterion.
reference name |
fixed width file reference name |
Update field text in Fixed width file
Updates the field(s) content of a record in a fixed width file with the given reference name.
field selection criteria |
field selection criteria |
Delete record from Fixed width file
Deletes the record from a fixed width file with the given reference name.
reference name |
fixed width file reference name |
Note: You must define at least one schema (either default or custom) after you open the file. It is not valid to read/write to the file before defining the schema. The following example shows that in the first 2 statements.
Example
The following logic inserts a record at the end of a fixed-width file.
Comments
0 comments
Please sign in to leave a comment.