This question isn't really SAS Programming but my question didn't fall in any of the offered categories and I had to pick something. I'm working with someone over Zoom and we had the Zoom screen on my SAS program as we met and I did various things during our meeting. Being the organized guy that I am, I had what we were doing described very carefully in comments in the SAS program. So now that person I met with is asking for a copy of that.
And it's not just text description, rather it also includes variable names and values, yadda, yadda, and it's spaced out nicely and is easily readable. I do this a lot and I think the SAS program editor is great for stuff like this.
But how do I send this to another person (that does not have SAS)? If I copy and paste it into Word or something like that it looks like a giant, misaligned mess. I want to get what was on my SAS screen during our meeting to another person in an easily readable form. Any ideas are appreciated.
You didn't say which SAS program editor you're using, but in EG and I think in SAS Studio, when you copy the program to the Windows clipboard it adds plain text as well as rich text versions. Pasting into Word (or PowerPoint) should give you the rich text (colors and indents). And also Word has its own options for pasting (plain text, merge formatting, keep formatting).
I rely on this behavior all of the time when building PPT decks that contain SAS code snippets. The format I have in EG carries over, and I can use PowerPoint features to resize, add borders, etc.
I am using the old style Program Editor. But it is just a SAS program so presumably I can open it in something else, if not everything else. I know I can open it in Enhanced Editor. Maybe I can open in something else too. I don't know.
But just now in experimenting, I made the fonts in my SAS program smaller and copied and pasted that into Word and it looked much better. Part of the problem is I was using big fonts, which I like to use in SAS, but when I copied and pasted big fonts into Word it wrapped around the right edge even in landscape orientation.
That seems backwards. Text copied from the normal Program Editor (not the "enhanced" editor) will just be text , it will not include any "font" information.
To preserve spacing in text make sure to do two things.
1) Make sure you do not have TAB characters in the text. There are SAS editor options to have SAS automatically using spaces instead of physical TAB characters to indent text.
2) Make sure that the target system is using a monospace font.
I'm not sure what "font information" means but I never use the TAB key in the program editor. I just space things out and line it all up. It looks great and it's easy to read and manipulate. I know Program Editor is considered a dinosaur by many but it works beautifully for me.
If you are using SAS/EG
You could save the code as a HTML file in which you could persist the color and indent of code .
Here is the result:
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.