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

Output files contain extraneous CRLF every 1000 chars #3

Open
chrisjb82 opened this issue Dec 1, 2022 · 0 comments
Open

Output files contain extraneous CRLF every 1000 chars #3

chrisjb82 opened this issue Dec 1, 2022 · 0 comments

Comments

@chrisjb82
Copy link

When [Send-SASprogram] is invoked it builds the list/log files incrementally by flushing a buffer 1000 chars at a time to a permanent file on disk. The writes to the permanent file are achieved by using the 'Add-Content' CmdLet, however, the code does not specify the '-NoNewline' option which means that everytime a write is made an extra 'CRLF' character is introduced into the output file.

This causes issues with SAS log files as key words can potentially be split in half leading to scanlog utilities not identifying issues correctly.

To fix the issues the two lines below just need '-NoNewline' appending to the end.

Add-Content $logfilename -Value $log

Add-Content $outfilename -Value $list

As an aside it may be prudent to remove the '1000' char limit and place into a variable as it is used 4 times throughout the file and would therefore be easier to update in the future if needed.

metadatadriven added a commit that referenced this issue Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant