BookmarkSubscribeRSS Feed
Fluorite | Level 6


In my SAS EG Program Editor window code automatically erased withou any human action, But in log window my code is available and in the Results Window output is displaying. Please let me know how can I import log into the Program Editor window.


Rajiv Santosh.

Thanks& Regards,
Rajiv Santosh.
Super User

Select (mouse) the desired lines and copy/paste to the program editor. Use the Alt key while mouse-selecting only the columns with the line numbers, and delete them. Then you have to remove the NOTEs and page headers manually.

Barite | Level 11

If you have 'full' SAS not UE, EE, EG or SAS Studio and the old text editor you can use this SAS code below.


This macro will copy the log to the program editor.


%macro getlog/cmd;
home;log;find ' ';mark;bot;mark;store;home;pgm;1;paste;
%mend getlog;


Hit a function key, mouse action or type getlog on any 'clean' command line.


You can put the script on a function key, mouse action, without the macro wrapper, or put the macro

in your autocall folder. You never need to migate this code when you install a new version of SAS and

it has worked since the late 70s, so you .


Note the issue is that SAS disabled the store command in all editors except the 'old' text editor.

I beleve it used to work in the EE editor but was later disabled.


All of SAS can be executed from the 'old' text editor command line.


I even execute Python scripts from the command line.

SAS Employee

Hi Rajiv436,


I won't add any new solution but you mentioned EG and the fact that the "code automaticall erased".



The behavior you report is the one available with the Program Editor.

Since SAS8.2, you have access to the Enhanced Editor and the code remains.

From the VIEW menu, you should have the choice between using the Enhanced editor and the Program Editor.


Said that, if you want to use the Program Editor with SAS, you can usually press the F4 key to recall the code



Is EG "SAS Enterprise Guide"?

EG only has the Enhanced Editor, I think.







Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4 in conversation