Desktop productivity for business analysts and programmers

Importing DATA(code) from SAS Log file to Program Editor window

Reply
Occasional Contributor
Posts: 13

Importing DATA(code) from SAS Log file to Program Editor window

Hi,

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.

 

Regards,
Rajiv Santosh.

Thanks& Regards,
Rajiv Santosh.
Esteemed Advisor
Posts: 6,685

Re: Importing DATA(code) from SAS Log file to Program Editor window

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Valued Guide
Posts: 505

Re: Importing DATA(code) from SAS Log file to Program Editor window

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
Posts: 68

Re: Importing DATA(code) from SAS Log file to Program Editor window

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.

 

 

Cheers,

Damo

 

Ask a Question
Discussion stats
  • 3 replies
  • 189 views
  • 0 likes
  • 4 in conversation