BookmarkSubscribeRSS Feed

SAS® Enterprise Guide®: 20 Tips in 20 Minutes

Started ‎05-27-2020 by
Modified ‎08-14-2020 by
Views 9,853

 

Did you miss the Ask the Expert session on SAS® Enterprise Guide®: 20 Tips in 20 Minutes? Not to worry, you can catch it on-demand at your leisure. 

 

Watch the webinar

 

Want new ways to make the most of SAS® Enterprise Guide®? Our SAS® expert, Kelly Gray, delves into quick tips and tricks that make working in SAS® Enterprise Guide® a breeze. These tricks are simple, and you’re bound to find one that will work perfectly for you and your needs.

You will learn:

  • 20 tips and tricks to make your SAS® Enterprise Guide® experience the best it can be.
  • One new tip per minute

 

Here are some highlighted questions from the Q&A segment held at the end of the session for ease of reference. We are still working on answering all of the questions that were submitted during the webinar. I’ve attached what is ready and I’ll post the full list of questions and answers in the next few days. You can find my slides (with animations) on GitHub.

  

Will everything in v7 work in v8?

All tasks and code should work.  There are many new enhancements in v8 and some behavior differences, including a few rarely used options that were removed.

 

Can you change the default library for query output? 

Yes, you can. Go to Tasks > Output Library > move libraries up and down to get them how you want them.

 

Please review the shortcuts offered by the function keys in SAS Enterprise Guide.

F3 and F8 – submit the code you have selected. F1 opens the online help. When you’re in SAS EG help, search on keyboard shortcuts to see the full list of shortcuts. You can also customize the shortcuts in v8.2.

 

Can you use prompts with program nodes or only the query builder?

Yes. Right click on the program node and click properties.

 

What’s the difference between sysecho and a put statement?

SYSECHO is a global statement. PUT is not. You don’t need to use sysecho in a DATA step.  See tips on how to use SYSECHO to show program progress here.

 

Is the autoexec for libname just for that one session or all sessions once you set it up in tools/options?

It will automatically execute in all sessions.

 

Can I create a libname that is on my workstation, but the project is running on a server?

The server that is running SAS needs to be able to “see” the location of the library. You can have a library that points to a shared network location.  But it won’t be able to see a location like “C:\temp” on your local machine.  If you need to read data files from your local machine, use the Upload SAS Data Sets task or the Copy Files task to copy them to the SAS server.

 

Can you go over the steps for auto libname each time one opens EG?

Tools > Options > SAS Programs > Submit SAS code when server is connected > Edit button will allow you to add libname statements (and any other SAS statements you want).

 

Can I create a libname that is on my workstation but the project is running on a server?

The server that is running SAS needs to be able to “see” the location of the library. You can have a library that points to a shared network location.  But it won’t be able to see a location like “C:\temp” on your local machine.  If you need to read data files from your local machine, use the Upload SAS Data Sets task or the Copy Files task to copy them to the SAS server.

 

How many libnames can be auto executed once connected with its appropriate server?

There is not a set limit.  However, assigning a large number of libraries can make some operations slow, and can make it more difficult to navigate your SAS server resource.

 

I don't have an autoexec file with my SAS. I need to create a startup file with autoexec to autorun some vital libname statements. What can I do?

You can use an Autoexec process flow, or tools > options >  SAS programs and submit SAS code when server is connected.

 

If the server where the library exists needs a password does that need to be included in the libname statement when we paste it for the auto lib to work?

Yes.  But it’s a best practice to avoid passwords in code if you can.  See some tips in this SAS blog post.

 

Is the autoexec for libname just for that one session or all sessions once you set up in tools/options?

It will automatically execute in all sessions.

 

How do I get version 8?

Contact your SAS site rep to refresh your SAS software order.

 

Why don't results automatically display in v8?

This behavior change can make your work flow quicker and more responsive.  But if you prefer a different behavior, you can change it in Toolsà Optionsà Results and specify the tab to display.

 

Is the upgrade from SAS EG 7.15 to v8 automatic or is there a cost involved?

Contact your SAS site rep – it should not be an additional cost.  However, it will require that you refresh your SAS software order.  The move from v7.x to v8 is not an automatic update.

 

In SAS EG 7.1, I can have the logs in separate tabs, in 8.x it overwrites it by default. Where can I change that behavior?

This behavior has changed in v8.  There is no longer the option to submit a task/program multiple times generate new results without replacing the existing set.  However, you can use the Project Log feature to keep all log content from each task/program that runs.
If you want to keep previous results (log and ODS), we recommend that you copy and paste the task in the project, and run the copied version.

 

Is the stored process generation only available in version 8?

No, it is available in v7 as well.

 

Why would I want to upgrade to version 8?

The entire interface has been redesigned, much of it in response to feedback from SAS Enterprise Guide users.  In addition to the many new features, the interface is much more flexible for different styles of working.

 

Is the "Filter and Sort" with nodupkey result feature in SAS EG 7 or 8?

The “Sort Data” task is the task that has the nodupkey functionality and it’s in both versions.

 

How do you set up scheduler in EG 8 to run program at specific date and time?

Using the Schedule Project or Schedule Process Flow feature, you can schedule all or part of a project to run using the Windows Scheduler.  Or, you can use a scripting language to create your own scripts to run programs and projects unattended.  See this article for examples.

 

If the slides don't make it clear whether a tip only applies to version 8 then can you update the slides before making them available to make it clear which only apply to version 8?

This is made clear in the comments of the slides.

 

Please tell us again the keystrokes to copy and paste a column?

Alt-left mouse to highlight the column, then copy & paste as normal.

 

How do you move the position of the columns in the dataset in EG v7?

Highlight the column name you want to move. Once you see the edges of the column name change, you can drag it left or right in the dataset.

 

Is the column width feature purely for aesthetics/viewing data? (i.e., the length of the variable isn't actually changed?)

Correct

 

Is there an option to alphabetize the columns of a dataset, like in viewtable in base SAS?

No

 

How do you resize columns for version 7 if I export to Excel?

Double click between the column headers.

 

Can you display two sets of SAS code in each window?

You can split the screen and show different code in each window.

 

The scheduler is based on the Windows scheduler?

Yes

 

Can you display more than one program code window at a time when you use the 'split screen' functionality?

Yes

 

Do you execute the status updates macro in a new program window or insert it at the top of your project code?

If you’re referring to the SYSECHO, that is a global statement that you insert into your code where you want to see a status update.

 

Can I use Autexec for several process flow inside one project?

Yes, it will affect all process flows inside the same project.

 

If possible, please go over when to use project versus just a SAS program?

A SAS program is used when you want to submit your own code or program. A project holds multiple programs, tasks, queries, results.

 

Can you link stored processes together to run in a project?

Yes you can – use an ordered list to specify the order.

 

Can you go over scheduling EG projects?

See the documentation for this feature.

 

How do you recover EG projects?

Tools -> Options -> Auto Recovery

 

Can you change the default library for Query output?

Yes, you can. Tasks > Output library > move libraries up and down to set the precedence order as needed.

 

Can you use prompts with program nodes or only the query builder?

Yes. Right click on program node and click properties to associate new prompts with a program.

 

Can shortcut keys in SAS be changed? Specifically, the Ctrl-Shift-B that removes comments from lines of code. Another software installed overrides the SAS shortcuts, so it no longer works as desired.

Yes, they can be changed in v8.2. Go to SAS help and search for keyboard shortcuts. F1 opens help.

 

There is a shortcut for collapsing, expanding code blocks, but if your laptop doesn't have a number pad (w/ plus/minus signs) is there an alternative shortcut to accomplish this?

There is a “+” or “-“ at the left side of the code block that you can click to expand or collapse.

 

When executing a block of code that contains a combination of data steps, proc sql statements, etc. how does EG decide which output dataset will be displayed? Generally speaking, it seems to be the last output dataset that was created chronologically, but sometimes that is not the case. When this occurs, it can be very confusing and misleading to the developer.

It may depend on how many datasets are being produced – you may have hit the limit on the number of datasets to show, or if there is code that doesn’t produce a new dataset then it won’t create one (i.e. proc sort with no out= option). But generally, it should show the last dataset created. You can also tweak settings in tools->Options->Data->Performance.

 

How to make stored process in EG?

You can right click in the process flow, or File->New->stored process.  You must be connected to a SAS metadata environment and have permissions to create a stored process.

 

In Query Builder, Filter “In a list”, it will only allow one value at a time. Any future plans to make this where multiple items can be pasted which would make it much, much faster to enter a large list of values?

The user interface allows adding/editing just one list item at a time.  If you have a large list of values, you might want to use the Advanced Expression editor or copy the query to a program node and maintain it that way.  Or consider using a Join instead to include records that match a value from another table.

 

Did you say there's a shortcut option for version 7?

There are shortcut keys in version 7. You can find them listed in the Enterprise Guide Help.  In v8.2 you can customize many of the shortcut keys.

 

So in v7 you can have your setup be like PC SAS v 6?

You can make it look similar to Base SAS by using split/stack windows in Enterprise Guide 7.  It won't be exactly like PC SAS, but you can get close.  v8.2 has many more options for workspace layout.

 

Was the auto replace results option in tools?

Yes, tools -> options -> Results

 

How do you split the screen into dual views?

From the program menu you can do View -> Workspace Layout, and select from a few options.  v8.2 has many more options for layout.

 

How can I see code from another program when I am running an existing program?

You can split the screen (View menu).

 

How can I set the blanks by formatting automatically? You showed four, but we have three.

Tools > Options > SAS Programs > Editor >Enhanced editor options. Enables you to customize.

 

Will it also format SQL code in the editor?

Yes

 

Is there a way to customize the "format program" feature in program editor?  (or is it just standardized formatting)?

You can go to tools->options->SAS programs->Editor Options then the “Indenter” tab.  You can adjust many of the settings, but maybe not all of the behaviors you might want to control.

 

Is there a feature that we can run the program and the output or other results does not clutter the process flow space?

Tools à Options à Project Views lets you customize the process flow view

 

Where is the best place to learn details about all of the Tools that are available for Options in version 7?

Check out the Enterprise Guide Help from the Help menu.

 

In tip 13, shouldn't the &i part be outside the quotes?

No because it’s a macro variable. SAS will replace the text via the macro processor.

 

Can we sort by more than two variables?

Yes you can.  However, the more variables that you select, the more resources that SAS needs to complete the sort.

 

How do you reuse the conditions written in the WHERE filter?

You can copy the where clause code that is generated by the query.  You can also save the Query as a template and use in other projects or as subqueries in other Query Builder nodes.

 

Can we change the format name for a variable in dataset properties tab in EG v7?

Yes

 

Can we easily migrate an EGP 7 into EGP 8? So we can use extraction of code soon?

Yes, you can open any v7 projects in v8 and run them. Once you save them in v8, you cannot open them again in v7.

 

Does autoexec flow work for unix SAS?

Yes

 

Would you say that SAS Enterprise Guide can be used as a data prep tool for data visualization elsewhere?

Yes, in fact it is an excellent tool for data prep! I use it to get my data ready to consume in SAS Visual Analytics.

 

You mentioned favorites a bit, but how do you use favorites in the menu bar and what else can you save as a favorite item?

From the help:

  • tasks
  • SAS data sets
  • reports
  • stored processes
  • information maps
  • OLAP cubes
  • programs
  • external files such as text files, Microsoft Word documents, or any file that can be opened or imported into SAS Enterprise Guide

Except for the built-in tasks, these items must exist on a local or remote server before you can add them to your favorites. You can edit your list of favorites and rename, delete, and rearrange items in the list.

 

I currently use SAS 9.34 at my job. Will it be easier to work with SAS EG? Or does it matter?

SAS Enterprise Guide is a client interface that will connect to SAS 9.3 on the back end. It’s a matter of which interface you prefer, display manager or SAS Enterprise Guide.

 

How do you declutter the log file?

Tools->Options->Results General deselect “show generated wrapper code”

 

What versions of SAS EG has the de-clutter option for the log?

Both versions 7 and 8

 

Sometimes I find that the autofill in a SET statement selects odd options. Can you explain how this works?

You can change the sensitivity of the autofill at tools->options->SAS programs->Editor Options then the “autocomplete” tab

 

Can you change the order in which programs run when you run a process flow?

Yes, you can use File -> New -> Ordered List to determine the order that things run.  You can also define custom links that help you to control the sequence of tasks/programs in a flow.

 

Is there a way to display all the variables in a data set 1 record at a time?  i.e. all values displayed on one page per record (instead of the standard data set view in a tabular format)

You're looking for the classic FSVIEW function? No, this is not built into SAS Enterprise Guide.

 

When you highlight a variable, it highlights all other variables with the same name. Are you able to change all at once?

Yes, you can use the Replace All feature in the editor.

 

In EG 8 can you drag and drop macros from macro viewer like you can datasets?

No, but you can copy and paste, and the %LET statements will be copied.

 

Is it possible to display the variable label instead of variable names?

Yes, Tools->options->Data: General

 

Any way to change the font color in code?

Tools->options->SAS programs->Editor Options  then “appearance”

 

How do you run SAS in batch mode in EG?

You can schedule the project to automate from your PC where EG is installed.  Or use the automation scripting feature.

 

How do you run SAS programs simultaneously?

You can’t in version 7, but you can in version 8

 

I'm new to EG. When you open a dataset, is there a way to right click so that you can select particular values of a variable, like in SAS 9.3/9.4? Trying to filter data in EG seems to be much more cumbersome and time-consuming in EG than in 9.3/9.4.

There is a “where” filter that you can use that is an option in the data grid.

 

Playing around in EG8, I noticed I could change the background color of the code window to a  dark color (easier on the eyes). Is that available in EG7?

Tools->options->SAS programs->Editor Options then “appearance”.  Check out this YouTube tip that shows you how.

 

Why can’t the graph result be seen in Enterprise Guide?

Make sure you have the graph format type set to something compatible with your system.  If using code, your graphics file path might be set to a location that SAS Enterprise Guide cannot reach.  Check the gpath= and path= options on your ODS statements. You may need to call SAS Technical Support if you are getting errors.

 

Is there a way to store log externally as text to a personal folder separately for each program, without appending the earlier log?

Not directly from EG. You can use PROC PRINTTO to redirect log content, but then you would need to access/download each of those files.

 

In EG 7, is there a way to force the task query wizard to display on your primary monitor as opposed to a secondary monitor?

It should "remember" the last position in between sessions. If it gets positioned off-screen, use these key combinations to activate/move it: Alt+SPACE, M, then arrow keys to move the window back into view.

 

What is the difference between SAS EG and SAS Studio?

So many. Both are SAS programming clients that are designed for you to manage your SAS work productively.  EG is an installed Windows app, while SAS Studio runs in your browser.  Each contains features you'll find in the other, and over time you'll see more features in SAS Studio.

 

Can you go over task templates and using that to create a query builder with preselected fields and filters?

Check this blog post that shows how to use a query template to build nested subqueries.

 

Is there an option in EG 8 to not show a message when data is unlocked?

I don't think so. Wouldn't you rather know? You can control the behavior of when to release the lock on data you open.

 

I‘m wondering if you will be talking about the use of git in sas? I would be interested to see a quick and basic clone, change, push demonstration if possible.

Check out this blog post.  We also have some webinars on this topic.

 

When I'm using 2 monitors (laptop and external) and later switch to just laptop, the CONTROL F window stays on the last monitor it was on, which could be the external. Is there a fix?

Ideally this shouldn't happen.  But if a window does get positioned off-screen, use these key combinations to activate/move it: Alt+SPACE, M, then arrow keys to move the window back into view.

 

Can you change the view size of the Output Data?

You can "zoom" in and out on data, code, and other content.

 

In EG 7, how do you send email only when there is error in project log?

Use Email as a Step to send a log, and add a Condition on the node. You can add a Condition based on a macro variable, including SYSERR.

 
 

When the project log is full and opens in a note pad. How do I clear this log?

Right-click on the Project node, select Properties.  In the Project Log tab you'll find settings for clearing the project log.

 

What are the errors I will receive when the server is down? Just running too slow to complete my query?

SAS Enterprise Guide detects when the SAS session is no longer available or disconnected.  Unfortunately, there isn't much more information available to display.  If this happens often, work with your SAS systems administrator to understand the cause.  Server-side logging might reveal more information.

 

How do you turn off all the keyboard shortcuts?

You cannot turn them off. You can customize the shortcuts in SAS Enterprise Guide 8.2.  Tools->Manage keyboard shortcuts.

 

SAS studio has a "background submit" which I think is like a batch submit.  Does EG have a batch submit, where you can submit an entire program and have it execute in a clean SAS session? 

No, and I do not believe this feature is planned at this time.

 

Can I disable/gray out options in EG for my Users? 

Yes, you can control different capabilities by role using SAS metadata.  See the doc for details.

 

Is there a way to enable a "Dark Mode" on the SAS program background? 

Yes - here's a video that shows you how.

 

I like v8, but the graphical style is not as good as v7, is there any option to run v8 with the v7 - much clearer and more readable graphical style? 

Some default settings are different in Version 8.  It uses ODS HTML5 instead of just HTML, and also SVG (scalable vector graphics) instead of PNG.  Also, ActiveX is no longer the default for traditional chart/plot tasks -- it's JPG or PNG.  You can adjust all of these settings in Tools->Options; Results.

 

Recommended Resources

 

Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.  

 

Version history
Last update:
‎08-14-2020 09:18 AM
Updated by:

sas-innovate-2024.png

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!

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.

Article Tags