6

So, I'm in the process of writing some code for SAS and I realized I have to save the file as filename.sas. My professor mentioned that I would have to use note pad or another text editor on my computer.

How can I use TextEdit on the Mac to save a .sas file? Opening TextEdit, adding some text, and saving causes the file to have a .rtf or .odt extension added to it.

Should probably add that my mac version is 10.5.8

Joe
  • 62,789
  • 6
  • 49
  • 67
user24872
  • 99
  • 2
  • 2
  • 5
  • Try TextWrangler. It is in the Mac App store and its free. – syclonefx Jun 01 '14 at 02:26
  • ohh man, lol. My mac doesn't support it. It's for macs 10.6.8 or later. Thanks though. Unless you know of any other editors for 10.5 macs? – user24872 Jun 01 '14 at 02:33
  • "And I stupidly thought I could use text edit on my mac, which obviously didn't work" Certainly it will work. – matt Jun 01 '14 at 02:35
  • Really? I tried to save it as a .sas extension but when I transferred it to the server it was saved as sas.rtf or sas.odt. Like, it wouldn't just save it as .sas . Whereas my prof's sas file was saved as just .sas – user24872 Jun 01 '14 at 02:38
  • Yes really. There's nothing magic about the .sas extension; you can put it there in any convenient way. It's just a name. It's a plain text file. – matt Jun 01 '14 at 02:41
  • I fixed the question to be (at least sort of) acceptable. SO doesn't allow "recommend a tool" questions, but it does allow "how do I use this programmer tool". Really SuperUser is the right place for this, but since this is a programmer tool in this use case it's probably okay. – Joe Jun 01 '14 at 05:19

2 Answers2

20

Your Mac comes with TextEdit, which is a perfectly good basic text editor. Be sure to choose Format > Make Plain Text so that you get a text file. Be sure to uncheck Hide Extension when you save, and provide the .sas extension manually. Or you can change the extension later using File > Get Info in the Finder.

You also have pico, vim, vi, emacs, and probably a host of others in the Terminal.

matt
  • 515,959
  • 87
  • 875
  • 1,141
0

Above mentioned solutions are best suitable for older mac os versions.

But for the latest mac os version(Mojave or later) try with nano or other command-line text editors.