Skip to content

fix(zosfiles): strip ANSI control character on FBA dataset download#2753

Open
Maanvi212006 wants to merge 1 commit into
zowe:masterfrom
Maanvi212006:fix/fba-dataset-roundtrip
Open

fix(zosfiles): strip ANSI control character on FBA dataset download#2753
Maanvi212006 wants to merge 1 commit into
zowe:masterfrom
Maanvi212006:fix/fba-dataset-roundtrip

Conversation

@Maanvi212006

Copy link
Copy Markdown

What It Does

Addresses the round-trip corruption issue described in #537, where downloading a member from an FBA (Fixed Block ANSI) dataset and re-uploading it without modification causes z/OSMF to add an extra ANSI control character to column 1 of every record. For datasets at max LRECL, this silently truncates the last character of the line and can cause fwrite() errors on upload.

This PR addresses approach # 1 from the issue discussion:

  • Before downloading, the dataset's recfm is fetched via List.dataSet(..., { attributes: true }) (same pattern already used in Copy.isPDS).
  • If recfm starts with FBA, the first character of each line is stripped from the downloaded file after the download completes.
  • Non-FBA datasets are unaffected — no extra calls, no behavior change.

What this PR does NOT do yet

  • Approach Link repair #2 (pre-upload LRECL boundary check) is not included here and will be a separate PR, since it requires an opt-out flag at the SDK level for consumers like Zowe Explorer that already do this check.

Note for reviewers

If the metadata lookup fails, it fail safe — skip the fix rather than break the download — which means the original bug can silently persist in that edge case

Related issue

Closes (partially) #537

How to Test
NA

Review Checklist
I certify that I have:

  • updated the changelog
  • manually tested my changes
  • added/updated automated unit/integration tests
  • created/ran system tests (provide build number if applicable)
  • followed the contribution guidelines

Additional Comments

Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
@github-project-automation github-project-automation Bot moved this to New Issues in Zowe CLI Squad Jun 19, 2026
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

2 participants