Skip to content
New issue

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

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

Already on GitHub? # to your account

CRLF added at end of every data set when downloaded from the mainframe #2044

Closed
adam-wolfe opened this issue Feb 9, 2024 · 4 comments
Closed
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have

Comments

@adam-wolfe
Copy link
Contributor

adam-wolfe commented Feb 9, 2024

Describe the bug

When either downloading or viewing a data set (or using the Get.dataSet SDK function), an extra newline/crlf is added at the end of the response.

For example, if a data set contains one record: "TEST", the Get.dataSet function will return "TEST\r\n" (or "TEST\n" on Linux systems). In most cases, this doesn't really matter, however it also affects how data sets appear in Zowe Explorer. As a caveat, if a user opens a data set and then saves it using Zowe Explorer, the extra line does not get added to the data set on the mainframe. See zowe/zowe-explorer-vscode#2169.

This affects data sets and spool files, not USS files.

If it is safe to assume that a carriage return will be at the end of every record, including the last record in a data set, should we handle this differently? Alternatively, would it make more sense to do something on the Zowe Explorer side?

Expected and actual results

Describe your environment

Additional context

@adam-wolfe adam-wolfe added enhancement New feature or request new The issue wasn't triaged yet labels Feb 9, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

Thank you for raising this enhancement request.
The community has 90 days to vote on it.
If the enhancement receives at least 5 upvotes, it is added to our development backlog.
If it receives fewer votes, the issue is closed.

@awharn
Copy link
Member

awharn commented Feb 9, 2024

To provide additional information, we are currently displaying exactly what is being returned from the z/OSMF REST API. When downloading data-sets via Postman and cURL, they also return the extra newline at the end of those files. Specifically, it returns a line feed character, which our Node APIs convert to a carriage return followed by a line feed for Windows.

We could remove the last line feed from each downloaded file, but if we were to do that, and z/OSMF were to change their behavior, we may lose lines that should be present. Additionally, the only editor I found that doesn't display the extra line was Vi/Vim. Notepad, Notepad++, Postman, Nano, and XXD all showed the new line.

@JTonda JTonda added priority-low Legit issue but cosmetic or nice-to-have and removed new The issue wasn't triaged yet labels Feb 12, 2024
@zowe-robot zowe-robot moved this from New Issues to Low Priority in Zowe CLI Squad Feb 12, 2024
@JTonda
Copy link

JTonda commented Feb 12, 2024

Consider:
Opening an enhancement request with z/osmf
Adding optional parameter to the sdk (which ZE would utilize)
Adding additional tests to verify that there is no data loss

@adam-wolfe
Copy link
Contributor Author

Given that this has no real impact to data sets uploaded to the mainframe, I think it makes sense to take no action from the CLI/SDK side at this time.

@adam-wolfe adam-wolfe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@github-project-automation github-project-automation bot moved this from Low Priority to Closed in Zowe CLI Squad Feb 26, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have
Projects
None yet
Development

No branches or pull requests

3 participants