Desktop productivity for business analysts and programmers

Text file output ignores line feeds

Reply
Contributor
Posts: 24

Text file output ignores line feeds

I have a macro which, among other functions, can write a text file (using PUT statements) that describes the parameters and their syntax. I developed it using plain ol' Windows-based SAS (v 9.1.2) and it worked fine. However, now that I'm running it under EG, the text file is only about 5 rows long - there are square-like characters indicating where line feeds should be.

I can't find relevant KnowledgeBase articles or documentation to help determine what change in my environment is involved (is it that our BI server is now Unix-based? was it moving to EG? from 9.1.2 to 9.1.3?), or (more to the point) what to change in the code to make the output render properly.

Any leads would be gratefully appreciated!
Steve
Super Contributor
Super Contributor
Posts: 3,174

Re: Text file output ignores line feeds

Suggest you share the expanded SAS log (pasted in a post-reply here) showing the DATA step where you do the PUT statements, again to include the SAS log and associated diagnostic messages about your output "fileref" attributes.

Scott Barry
SBBWorks, Inc.
Valued Guide
Posts: 2,111

Re: Text file output ignores line feeds

The problem is the change in SAS servers. Each version of SAS marks the end-of-line in a PUT file with the indicator that is native to that platform. In Windows, it is a combination; in Unix, it is just a .

Some Windows editors can adjust, but others cannot, so if you open the file in Word, ti will look and print fine, but if you open it in Notepad, you will see those little rectangles (Notepad's way of indicating a character that it cannot display.).

There is a freely available utility called unix2dos that will convert the output from the Unix end-of-line to Windows. See http://en.wikipedia.org/wiki/Unix2dos . It is available in both Unix and Windows versions.

Doc Muhlbaier
Duke
Contributor
Posts: 24

Re: Text file output ignores line feeds

Thanks, Doc - I'll check that utility out. Thanks also to Scott SBB!

Steve
Ask a Question
Discussion stats
  • 3 replies
  • 87 views
  • 0 likes
  • 3 in conversation