Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying ASCII partial record handling strategy #484

Closed
yruslan opened this issue Mar 28, 2022 · 0 comments
Closed

Allow specifying ASCII partial record handling strategy #484

yruslan opened this issue Mar 28, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@yruslan
Copy link
Collaborator

yruslan commented Mar 28, 2022

Background

Currently, if an ASCII record does not fit copybook record size, the rest of the bytes will be part of the next record.
Most of the time it is not the correct behavior. Redundant bytes should be discarded in this case.

Feature

Add option

.option("allow_partial_records", "true")

with false as default.

Example [Optional]

Given this copybook

         01  ENTITY.
           05  A    PIC X(1).
           05  B    PIC X(3).

and the data file:

1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678901234567890123456789
5678

If allow_partial_records = false:

+---+---+
|A  |B  |
+---+---+
|1  |   |
|1  |2  |
|1  |23 |
|1  |234|
|1  |234|
|1  |234|
|1  |234|
|1  |234|
|1  |234|
|1  |234|
|5  |678|
+---+---+

If allow_partial_records = true:

+---+---+
|A  |B  |
+---+---+
|1  |   |
|1  |2  |
|1  |23 |
|1  |234|
|1  |234|
|1  |234|
|5  |6  |
|1  |234|
|5  |67 |
|1  |234|
|5  |678|
|1  |234|
|5  |678|
|1  |234|
|5  |678|
|9  |012|
|3  |456|
|7  |890|
|1  |234|
|5  |678|
|5  |678|
+---+---+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant