using enterprise guide effectively · using enterprise guide ® effectively bi09-2012 tom miron...

60
Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WI

Upload: others

Post on 10-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Using Enterprise Guide®

Effectively

BI09-2012

Tom Miron

Systems Seminar Consultants, Madison, WI

Page 2: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Using Enterprise Guide Effectively

Enterprise Guide is not a fancy

program editor!

EG offers a new window onto the

power of SAS software

Page 3: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Using Enterprise Guide Effectively

Enterprise Guide requires a different

perspective on system design…

Visual coherence vs. tight coding

Page 4: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Using Enterprise Guide Effectively

We will discuss the use of the EG

environment and…

Features of Enterprise Guide that can

make your applications more user

friendly and maintainable

Page 5: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

What Is Enterprise Guide?

Enterprise Guide is not SAS

Enterprise Guide is a user interface for

SAS

Page 6: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Generates

SAS Code

%_eg_conditional_dropds(WORK.SORTTempTableSorted);

/* -------------------------------------------------------------------

Sort data set LE5274.HIERARCHYMAPFROMTERESA

------------------------------------------------------------------- */

PROC SQL;

CREATE VIEW WORK.SORTTempTableSorted AS

SELECT *

FROM LE5274.HIERARCHYMAPFROMTERESA

;

Page 7: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Architecture

Client–Server architecture

EG is not running SAS or running as a

SAS application

A server somewhere on your network is

running SAS

Page 8: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Architecture

Your EG Session

SAS server 1 SAS server 2 SAS server 3

Data 1 Data 2

Page 9: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Architecture

EG generates SAS code and sends it

to a workspace server for execution

Results are returned to your EG

session

Page 10: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Servers List

Page 11: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Architecture

SAS servers are usually set up for you

by a SAS administrator

The SAS BI client-server architecture is

a deep subject!

Page 12: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Client-Server Considerations

The OS of your EG session may differ

from the server OS

Example:

EG on Windows

workspace server on UNIX

Page 13: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Client-Server Considerations

UNIX file names are case sensitive

Record/line termination differs

Page 14: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Line Termination on

Windows and UNIX

Windows = CR/LF

UNIX = LF

Use INFILE termstr= option

Page 15: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Projects vs SAS Programs

In Enterprise Guide you work with

“projects”

An EG project is a single file (.egp)

Page 16: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Tasks

EG projects are a collection of tasks

Most tasks map to a SAS Procedure

Tasks are grouped into “Process Flows”

Page 17: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Enterprise Guide Tasks

EG Task List Window

Page 18: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

List Data Task Interface

Page 19: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

List Data Generated Code

%TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(),

TIMEAMPM12.))";

PROC PRINT DATA=WORK.SORTTempTableSorted

OBS="Row number"

LABEL

;

VAR oldCat oldLine newCat newLine;

RUN;

/* -------------------------------------------------------------------

End of task code.

------------------------------------------------------------------- */

Page 20: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Tasks vs Program Code

The code you can write will always be

more compact and efficient than that

generated by EG.

It doesn’t matter.

Page 21: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Tasks vs Program Code

Life cycle efficiency is what matters

Life cycle efficiency is highly dependent

on:

- Development effort

- Maintenance effort

Page 22: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Tasks vs Program Code

Life cycle efficiency is usually not

dependent on:

- The number of statements executed

- Absolute machine efficiency

Page 23: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Tasks vs Program Code

It doesn’t matter if EG generated 100

statements where you could written a

10 statement SAS program because…

You don’t have to write any statements

Page 24: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The Temptation

Experienced SAS programmers are

often tempted to open a program object

and start coding

Page 25: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The Rule for Effective Use of EG

Avoid programs and custom code like

the plague

Page 26: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Why Not Program?

Programs and custom code introduce a

“black box” to your EG project

Page 27: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The “No Program” Advantage

EG tasks have a consistent interface

across all projects

EG tasks constrain the user/developer

to valid options and settings

EG tasks minimize spelling and naming

ambiguities

Page 28: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The Downside

The downside of EG tasks is that

standard tasks may not offer options or

processes you need

It’s tempting to turn to programs and

inserted code…but don’t

Page 29: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Inserted Code

Page 30: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The “No Program” Upside

To maintain a project with no custom

code you need to know EG

To maintain a project that does contain

custom code you need to know EG and

understand the SAS programming

Page 31: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

The Answer to Task Limitations

More tasks…

You can almost always duplicate the

processing of a well coded SAS

procedure or DATA step with a series

of EG tasks.

Page 32: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Done In One DATA Step

Page 33: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Alternative

Three Query tasks (SQL)

“But wait…three passes of the data is

less efficient than one!”

Page 34: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Alternative

Development and maintenance time for

you vs.…

Machine resource time

Page 35: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Is The EG Way OK?

Are there practical execution time

constraints?

What’s the marginal cost of accessing

data?

Page 36: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Project Design

Tasks are grouped into process flows

All process flows together make up

your EG project

Page 37: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Process Flows

It’s tempting to put all tasks into a

single process flow…which leads to…

A visual mess

A project flow that’s hard to understand

A project that’s hard to maintain and

modify

Page 38: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Process Flows and Lots of ‘Em

One processing function = one process

flow

One table = one process flow

Page 39: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Process Flows and Lots of ‘Em

Don’t be afraid of multiple process

flows in your project

Grouping tasks into logical process

flows is one of the greatest benefits of

using EG…don’t limit yourself

Page 40: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Example Process Flows

Set SAS options

Establish SAS libraries or external file

FILEREFs

Import data from a spreadsheet or

database

Page 41: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Example Process Flows

Validate or clean data

Create a report

Export results to PDF’s or

spreadsheets

Page 42: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Benefits of Multiple PF’s

Each process flow workspace grid has

a minimal number of objects on it so it’s

easier to grasp what’s going on

The EG project is modular and can be

developed, tested, and run step-by-step

Page 43: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Benefits of Multiple PF’s

Using consistent, meaningful process

flow names the project tree acts as a

high level flow chart and helps minimize

written documentation

You can quickly navigate through a

complex project with the EG project

tree

Page 44: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Common Process Flows

Standardize common process flows

from project to project

Use consistent names and position in

the process flow sequence

Page 45: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Some Common

Process Flow Names

“Documentation”

“Start Up”

“Wrap Up”

“SAS Libraries”

“Utility”

Page 46: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Process Flows and Lots of ‘Em

One function/table = one process flow

means…

Modularity

Easier to understand

Easier to develop and test

Easier to maintain/modify

Page 47: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Many Tasks =

Many Intermediate Tables

When you avoid custom code you often

end up with many intermediate tables

Keep these tables in a permanent

library because…

You can restart in the middle

They’re useful for testing and debugging

Disk space is cheap

Page 48: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Many Tasks =

Many Intermediate Tables

Keep intermediate tables and final

output in separate folders/libraries…

Different sharing options

Different servers

Local or network

Page 49: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Use Note Objects To…

Document program objects (if you must)

Page 50: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Use Note Objects To…

Document process flows

Page 51: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Use Note Objects To…

Document your project in the

“Documentation” process flow

Page 52: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

EG Backup

EG projects are stored as a single

binary file (not plain text)

Always back up the .egp file

Back up to plain text with “Export All

Code…”

Page 53: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Export All Code In Project

Page 54: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

Effective use of SAS Enterprise Guide

requires visual thinking rather than

thinking in terms of efficient SAS

statement coding

Page 55: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

A good EG project is organized around

a clear and logical visual display of

linked components that requires a

minimum of additional written

documentation

Page 56: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

Avoid the use of custom SAS code,

either as program objects or user

modifications of EG tasks

When you use custom code you

introduce a black box process that

doesn’t benefit from the the built-in task

dialogs or context Help

Page 57: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

Don’t be afraid of using multiple EG

tasks to accomplish something that

could be done is a single SAS step

Use intermediate result tables to stage

data through your project

Page 58: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

Use multiple process flows to break

your project into logical components

Use standard names for common

process flows (“Documentation”, “Start

Up”, etc.)

Page 59: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Wrap Up

Make use of Note objects linked to their

subjects to document specific

processes

Back up your project as both a .egp file

and as plain text SAS code

Page 60: Using Enterprise Guide Effectively · Using Enterprise Guide ® Effectively BI09-2012 Tom Miron Systems Seminar Consultants, Madison, WIFile Size: 600KBPage Count: 60

Contact Information

Name: Tom Miron

Enterprise: Systems Seminar Consultants

Address: 2997 Yarmouth Greenway Dr.

City, State ZIP: Madison, WI 53711

Work Phone: 608 625-4541

Fax:

E-mail: [email protected]

Web: sys-seminar.com

Twitter: