Hi all,
Is there any way to use word wrap (as in notepad) in enhanced editor?
Sometimes I copy some text from random sources to the editor and have to manually insert line breaks by hitting enters to make it in multiple lines. This is somewhat annoying. I couldn't find any function that allows that.
Thanks!
The bug I remember seems to be fixed in SAS 9.4m5. Not sure if it will come back again.
Here is demonstration of how text flow works. The blank lines indicate the end of the "paragraphs".
Now try to flow it into 65 columns:
The bug would have flowed all three of those paragraphs into one. With the bug gone it just flows the first line into two lines.
The block move command allows you to mark the beginning and end of a range of lines and move them before or after a target line. Let's do an example.
If I wanted to move the extraneous lines that appear before the %MACRO statement in the file that defines the autocall macro %XPT2LOC so that they become part of the macro definition instead of being executed only the first time the macro is called I can place an MM in the line numbers on the first and last line of the block to move and B on the line where I want them moved before.
The result is a file that is more valid as an autocall macro definition because the first line of the file is the %MACRO statement.
The regular old program editor had a nice word wrap utility. The TF directive entered into the number prefixes.
So turn on the line numbers (NUM command).
Then type TF followed by the column number where it should wrap, for example 65.
Result
Note it is kind of broken now. It used to stop when it hit a blank line. But it now longer does that. So you have to move the stuff you want to FLOW to bottom of the editor window. You can always move it back using the MM block commands in the number prefix.
Tom, thanks for feedback. Appreciate it.
So in conclusion there seems no way to do it using only enhanced editor.
Anyhow I still don't follow what you said in the last part. "So you have to move the stuff you want to FLOW to bottom of the editor window. You can always move it back using the MM block commands in the number prefix."
Could you elaborate a little?
The bug I remember seems to be fixed in SAS 9.4m5. Not sure if it will come back again.
Here is demonstration of how text flow works. The blank lines indicate the end of the "paragraphs".
Now try to flow it into 65 columns:
The bug would have flowed all three of those paragraphs into one. With the bug gone it just flows the first line into two lines.
The block move command allows you to mark the beginning and end of a range of lines and move them before or after a target line. Let's do an example.
If I wanted to move the extraneous lines that appear before the %MACRO statement in the file that defines the autocall macro %XPT2LOC so that they become part of the macro definition instead of being executed only the first time the macro is called I can place an MM in the line numbers on the first and last line of the block to move and B on the line where I want them moved before.
The result is a file that is more valid as an autocall macro definition because the first line of the file is the %MACRO statement.
Tom, thanks again.
Now I see what's going on. Other than the fact that I have to open the old editor and go back and forth a little bit, this works good. I hope to see that function added to the enhanced editor in the future, though.
Also block moving seems to be neat. I mostly just use "shift" and arrows or home/end to copy/paste blocks. The old editor seems to have some nice tricks that enhanced doesn't have. Is there any article/posting that introduces these all? Or nowadays not so many useful tricks left since enhanced editor came in?
Thanks for the tip.
The "enhanced" editor is definitely a step back in terms of functionality. In addition to not supporting directives typed into the number prefix it does not support using SAS macros to generate commands.
You might need to dig up a copy of the SAS 6.12 documentation to find a good description of Display Manager including the Program Editor.
The on-line documentation seems to be limited to this page that mixes commands you could type at the command line and those you can use in the number prefix area.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/p0ucvztqs3j33en1ikzn904rpwxg.htm
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.