Fall 2012 OASUS Questions and Answers

Similar documents
EXCEL UTMANINGAR MED 64 BIT OS GEORGIOS KARAGIANNIS, SAS SUPPORT

Hooking up SAS and Excel. Colin Harris Technical Director

Exporting Variable Labels as Column Headers in Excel using SAS Chaitanya Chowdagam, MaxisIT Inc., Metuchen, NJ

Reporting from Base SAS Tips & Tricks. Fareeza Khurshed BC Cancer Agency

OASUS Spring 2014 Questions and Answers

Exchanging data between SAS and Microsoft Excel

Moving Data and Results Between SAS and Excel. Harry Droogendyk Stratia Consulting Inc.

SAS ENTERPRISE GUIDE USER INTERFACE

Tips and Tricks for Creating Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS. Vincent DelGobbo, SAS Institute Inc.

Tips for Moving From Base SAS 9.3 to SAS Enterprise Guide 5.1 Anjan Matlapudi Corporate Medical Informatics AmeriHealth Caritas Family of Companies

ODS TAGSETS - a Powerful Reporting Method

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

Version: Copyright World Programming Limited

Create Metadata Documentation using ExcelXP

Enterprise Client Software for the Windows Platform

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

Improving Your Relationship with SAS Enterprise Guide Jennifer Bjurstrom, SAS Institute Inc.

Choosing the Right Tool from Your SAS and Microsoft Excel Tool Belt

NEW FEATURES IN FOUNDATION SAS 9.4 CYNTHIA JOHNSON CUSTOMER LOYALTY

Paper ###-YYYY. SAS Enterprise Guide: A Revolutionary Tool! Jennifer First, Systems Seminar Consultants, Madison, WI

Introduction to the SAS System

New for SAS 9.4: A Technique for Including Text and Graphics in Your Microsoft Excel Workbooks, Part 1

Data Edit-checks Integration using ODS Tagset Niraj J. Pandya, Element Technologies Inc., NJ Vinodh Paida, Impressive Systems Inc.

DiskBoss DATA MANAGEMENT

An Introduction to Creating Multi- Sheet Microsoft Excel Workbooks the Easy Way with SAS

Purchase this book at

What Is SAS? CHAPTER 1 Essential Concepts of Base SAS Software

Quick Data Definitions Using SQL, REPORT and PRINT Procedures Bradford J. Danner, PharmaNet/i3, Tennessee

1. Setup Everyone: Mount the /geobase/geo5215 drive and add a new Lab4 folder in you Labs directory.

Switching to Sheets from Microsoft Excel Learning Center gsuite.google.com/learning-center

Moving Data and Results Between SAS and Microsoft Excel

Adding Content to Blackboard

REPORTING Copyright Framework Private Equity Investment Data Management Ltd

MAS 90/200 Intelligence Tips and Tricks Booklet Vol. 1

Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables

Office Adapters for Quark Publishing Platform

SAS 9.4 PC Files Server: Installation and Configuration Guide, Second Edition

Talend Open Studio for Data Quality. User Guide 5.5.2

Keeping Track of Database Changes During Database Lock

CMS Shado 9. Quick Start Guide

WPS Workbench. user guide. To help guide you through using WPS Workbench to create, edit and run programs. Workbench user guide Version 3.

Make SAS Enterprise Guide Your Own. John Ladds Statistics Canada Paper

JUNE 2016 PRIMAVERA P6 8x, CONTRACT MANAGEMENT 14x AND UNIFIER 16x CREATING DASHBOARD REPORTS IN ORACLE BI PUBLISHER

Essentials of the SAS Output Delivery System (ODS)

SAS/Warehouse Administrator Usage and Enhancements Terry Lewis, SAS Institute Inc., Cary, NC

Spatial Data Standards for Facilities, Infrastructure, and Environment (SDSFIE)

ITEM ToolKit Technical Support Notes

Readme. HotDocs Developer Table of Contents. About This Version. About This Version. New Features and Enhancements

SAS Display Manager Windows. For Windows

Data Warehousing. New Features in SAS/Warehouse Administrator Ken Wright, SAS Institute Inc., Cary, NC. Paper

New for SAS 9.4: Including Text and Graphics in Your Microsoft Excel Workbooks, Part 2

Release notes for version 3.9.2

Flowlogic. User Manual Version GraphLogic: Developed by scientists, for scientists. Graphing and Statistical Analysis.

Utilizing the VNAME SAS function in restructuring data files

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

SAS. Studio 4.1: User s Guide. SAS Documentation

Remodeling Your Office A New Look for the SAS Add-In for Microsoft Office

Tutorial 8 Sharing, Integrating and Analyzing Data

SAS Studio: A New Way to Program in SAS

User Guide. Web Intelligence Rich Client. Business Objects 4.1

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

DiskBoss DATA MANAGEMENT

CEU Online System, The Friday Center for Continuing Education, UNC-Chapel Hill How to Obtain Participant IDs for Awarding of CEUs

EQuIS Data Processor (EDP) User Manual

Certkiller.A QA

Data Source Connection

SAS ENTERPRISE GUIDE WHAT LIES BEHIND ALL THESE WINDOWS FOR PROGRAMMERS. Copyr i g ht 2013, SAS Ins titut e Inc. All rights res er ve d.

Readme. HotDocs Developer LE Table of Contents. About This Version. New Features and Enhancements. About This Version

VERSION 7 JUNE Union Benefits. Employer User Guide Data Collection Tool

ABBYY FineReader 14. User s Guide ABBYY Production LLC. All rights reserved.

The Perfect Marriage: The SAS Output Delivery System (ODS) and

Output Delivery System: The Basics and Beyond Lauren E. Haworth Cynthia L. Zender Michele M. Burlew

A Practical Introduction to SAS Data Integration Studio

Sage Intelligence: Copying, Pasting and Renaming Reports 3. Sage Intelligence: Creating and Linking a Report 5

Spring 2008 OASUS Q&A

Gender Info 2007 Getting Started

Delivering Information to the People Who Need to Know Carol Rigsbee, SAS Institute Chris Hemedinger, SAS Institute

Applications Big & Small. Printable Spreadsheets Made Easy: Utilizing the SAS Excel XP Tagset Rick Andrews, UnitedHealth Group, Cary, NC

Jet Data Manager 2014 Product Enhancements

Delivering Information to the People Who Need to Know Carol Rigsbee, SAS Institute Chris Hemedinger, SAS Institute

More Skills 12 Create Web Queries and Clear Hyperlinks

Workspace ios Content Locker. UBC Workspace 2.0: VMware Content Locker v4.12 for ios. User Guide

PROMODAG REPORTS Getting started. Office 365

Nomination Import. LINK System Customer Interface

for Q-CHECKER Text version 15-Feb-16 4:49 PM

An Introduction to SAS/SHARE, By Example

Download Instructions

Azquo User Guide. data made simple

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

Maintaining Formats when Exporting Data from SAS into Microsoft Excel

!!! !!!!!!!!!!! Help Documentation. Copyright V1.7. Copyright 2014, FormConnections, Inc. All rights reserved.

Source. Turning onto a Two-Way Street A Tutorial on The SAS System and ODBC. Data. ODBCdnver

Business Insight Authoring

Job Aid. Remote Access BAIRS Printing and Saving a Report. Table of Contents

- 1 - ABSTRACT. Paper TU02

Combining TLFs into a Single File Deliverable William Coar, Axio Research, Seattle, WA

COVR B.V.B.A. Release Notes - cmoffice V2.73b. 1 of 8 COVR B.V.B.A. Release Notes. cmoffice V2.73b. Released. Status. Created On June 26, 2016

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

SAS Data Integration Studio 3.3. User s Guide

Moving Data and Analytical Results between SAS and Microsoft Office

Transcription:

Fall 2012 OASUS Questions and Answers The following answers are provided to the benefit of the OASUS Users Group and are not meant to replace SAS Technical Support. Also, an Enterprise Guide project is provided as a companion to this document. The project is available on the OASUS web site (www.oasus.ca) under the fall 2012 meeting since this is when these answers have been presented formally. 1

Question 1 : In EG, is there an easy way to switch the input a query uses (repoint to a different table without deleting everything associated with the first table and recreating it for the new table but with same structure)? If the table you wish to switch to has the same structure as the one currently reference, it is quite straightforward to do so by following these few steps: 1) Modify the Query Builder task. 2) Right click the table you wish to replace; Select Properties; 2

3) On the File Source panel, select the Change button. Note that the new source file does not have to be exactly the same as the original file but any variables that are used in the query must be present in the new source file. 3

Question 2 : In EG, is there a way to copy a sequence of queries (like if you want to make a change in one sequence but still keep the original)? Yes it is possible to do so. Depending of what you intending to do, you can use at least three (3) approaches: 1. Simple copy paste. a. Select the tasks and copy/paste b. Edit the new tasks 2. Add as a code template This is like a copy/paste but instead of a task being copied, the programming code is copied and made into a program task. a. First create the code template 4

b. Modify the code to your liking 3. Task Template A task template represents a task that has already been set-up and that can be re-used throughout any of your project. a. Create a Template 5

6

b. Use the newly created task template Using the task template is straightforward and will replay the task as it was when the template was created. Ideally, the input data file should contain the same variables at least for those who are selected. 7

Question 3 : In EG, after I run a program, there s a question mark in the right-hand side of the icon. What is that? It means that the program is associated with at least one prompt. Many indicators can be added to an EG task icon. The most common are: An X in the upper left corner indicates that at least one error was encountered in the last run of the task. A! in the upper left corner indicates that at least one warning (but no errors) was encountered in the last run of the task. A? in the upper right corner indicates that the task is associated with at least one prompt. A flag in the upper right corner indicates that a condition is associated with the task. 8

Question 4 : Is there an easy way to export variable labels into Excel, not variable names? This can be easily done by using the label option in the PROC EXPORT. /* Use LABEL option in PROC EXPORT */ proc export data=sashelp.cars outfile='c:\temp\cars1.xls' label dbms=excel replace; You can achieved a similar result (but more fancy formatting) by using an ODS ExcelXPtagsets destination. Rather than creating a spreadsheet in native format, the ExcelXPtagsets will create an XML file using a set of tags that can be interpreted by Excel. Once you have the ExcelXPtagsets destination open, you can run PROC PRINT with the LABEL option to print labels rather than variables names. The results of PROC PRINT will be saved in an XML file readable by Excel. /* This code creates an Excel spreadsheet with the labels as column headings */ ods tagsets.excelxp file="c:\temp\cars2.xls"; proc print data=sashelp.cars noobs label; ods tagsets.excelxp close; 9

Finally, if you have the desire to do so, you can rename the variable with their corresponding labels prior to sending the dataset to Excel. options validvarname=any; /* Make a working copy of CARS dataset*/ data newcars; set sashelp.cars; /* Set-up a call to PROC DATASETS to rename the variable to their corresponding labels */ data _null_; set sashelp.vcolumn(keep=libname memname name label where=(libname='work' and memname='newcars')) end=last; if _n_ eq 1 then call execute('proc datasets library=work nolist;modify newcars;rename '); if label ne '' then call execute(cats(name,"='",label,"'n" )); if last then call execute(';quit;'); /* Just export with no special option */ proc export data=newcars outfile='c:\temp\cars3.xls' dbms=excel replace; Reference: DelGobbo, Vincent. 2011. "Creating Stylish Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS ". Proceedings of the SAS Global Forum 2011 Conference. Cary, NC: SAS Institute Inc. 10

Question 5 : What is PROC DOCUMENT? Can you give an example? PROC DOCUMENT is part of the ODS DOCUMENT facility which allows you to: Save an ODS output into a ODS document which is a repository for ODS output, graphs and datasets; Replay the output to a specific format; Search and filter an ODS document; Add notes and change titles, footnotes, etc. Before you can use PROC DOCUMENT, you have to create an ODS document by directing your output to an ODS document destination instead of a destination such as pdf or html that you would normally specify. The ODS document is saved in a special SAS item store file but you can use the normal <libref.>member-name nomenclature to designate the file. The following code provides an example: ods document name=work.quickstart; proc contents data=sashelp.cars ; proc means nmiss mean max min data=sashelp.cars; class origin type; ods document close; Now that you have an ODS document, you use PROC DOCUMENT to replay the outpit to another ODS destination: /* replay the ODS document into an html output */ /*ods html file="c:\temp\output1.html";*/ proc document name=work.quickstart; replay; quit; /*ods html close;*/ 11

You can keep adding to an existing ODS document by referring it as an ODS destination in other blocks of code: /* Adding new content to a new ODS document */ ods document name=work.quickstart; proc freq data=sashelp.cars; table origin * type / list; ods document close; You can list the content of an existing ODS document: /* Summary listing of the content of an ODS document*/ proc document name=work.quickstart; list; quit; /* Detailed listing of the content of an ODS document*/ proc document name=work.quickstart; list / levels=all details ; quit; You can replay only certain ODS objects stored in the ODS document. In order to do that you need to understand how ODS name those object and how they are organized. Typically, each run of a procedure has a corresponding folder in the ODS document which is named according to the name of the procedure and is assigned a sequence number (example Freq#1). Sub-folders can also exist depending on the output produced by the procedure and eventually individual ODS objects are stored in a specific folders. You can replay specific object or all the objects contained within a folder. /* Replaying only the objects generated by Freq#1 */ ods html file="c:\temp\output2.html"; proc document name=work.quickstart; replay freq#1; quit; ods html close; 12

There are many other operations you can do with PROC DOCUMENT. The book listed in reference is highly recommended to learn more. Reference: Tuchman, Michael. 2012. PROC DOCUMENT by Example Using SAS. Cary, NC: SAS Institute Inc. 13

Question 6 : How can we highlight a part of SAS code in program editor in UNIX and run the selected code? In UNIX, there is a way to submit a selection via the clipboard. If one selects and highlights some SAS code in the Program Editor and then chooses Submit Clipboard, that will only run the code that was selected. Below is a snapshot of the drop down menu available from Run, with the Submit Clipboard boxed in red: So, in other words, highlighting some code will select and copy it to the buffer (Clipboard), so that when Submit Clipboard is chosen as the option to Run, only the selected code stored on the buffer (Clipboard) will execute. 14

Question 7 : How much effort is required to migrate from EG 4.3 to EG 5.1 and from SAS 9.2 to SAS 9.3M1? In general the migration is quite straightforward: 1) Migration from EG 4.3 to EG 5.1: EG has a built-in migration tool and is invoked automatically when opening a project created from an earlier release. You can also use the migration tool to migrate multiple projects before opening them in EG. This migration tool was fully covered in a the fall 2011 Q&A. Once the migration is complete, it is recommended to review the resulting project to ensure everything is laid out as before and produces the same results. 2) Migration from SAS 9.2 to SAS 9.3M1: assuming that this question pertains to Base SAS, the migration is also straightforward. Because Base SAS code is upward compatible, there should be no change in the SAS applications per se. SAS files created by an earlier version of SAS should be readable., you have to pay attention to the SAS files used by your SAS applications. In particular, it is recommended to re-compile catalogues and re-create files for which you want to use new features. This can be done easily using the PROC MIGRATE facility. In summary, migrating upward is quite easy and straightforward but it is mandatory to test the migrated application/project to ensure that the process was successful and that the application behaves as expected. 15

Question 8 : What is the most efficient (fastest) method for transferring a very large dataset to a SQL Server database table, where the dataset and the table are on different servers? There are a few way to load data from a SAS dataset into SQL. You can create a text file and then load the data into SQL Server and then load the text file into the database or you can use the ODBC engine to load the SAS dataset directly. Below is an example to load the dataset directly into the database. The example uses some options to improve performance such as the BULKLOAD and the DIRECT_EXE options, and the TRUNCATE SQL*server statement. The SQL pass-through is used as well. If you are not familiar with the SQL Pass-through, it simply executes SQL code directly on the database server, you can use it to do things you can t do using a library reference to the database like execute a stored procedure or issue T-SQL commands. /* Loading a SAS dataset into SQL Server The BULKLOAD=YES option increases performance significantly (in this case 13 seconds to 2 seconds) Note 1: Special permissions needed to do a BULK Load Note 2: DIRECT_EXE=DELETE will have huge performance gains if deleting some records from an SQL table */ libname advworks odbc bulkload=yes DIRECT_EXE=DELETE noprompt="driver=sql server;server=server_name; database=adventureworks; trusted_connection=true" schema=sales; libname testdata "<directory>"; /* The SQL pass-through is used to drop the SQL table */ proc sql; connect to sqlservr as testdb (server="server_name" database="adventureworks"); Execute (DROP TABLE Sales.test) by testdb; disconnect from testdb; quit; /* Creating a new table, BULKLOAD option will be used */ data advworks.test; set test; /* The SQL pass-through can be used to truncate the SQL table (Huge performance again)*/ proc sql; connect to sqlservr as testdb (server="c184293\v2008r2" database="adventureworks"); Execute (TRUNCATE TABLE Sales.test) by testdb; disconnect from testdb; quit; 16

Question 9 : Is there any new ODS Excel tagset that will produce an xlsx file. At the moment, we use the Excel tagset that creates only xls. The XML file created by the ODS ExcelXp tagset destination, is not specific to ExcelXp. Since it is not an Excel binary file, it can be read directly by the latest version of Excel it is just a matter of using the.xlsx extension when creating the file. 17

Question 10 : Is there PROC EXPORT we can use to create xlsx files? Depending on the version of SAS you can use one of these 2 methods: 1) Using DBMS=EXCELCS option The EXCELCS method works by delegating the Excel read/write operation to a Windows node that has a PC Files Server instance. Therefore, in the context of UNIX it requires a second computer because the PC File server must run on a Windows machine. This method works well with SAS 9.2 and beyond. The following code is an example (the name of the server and the port number is specific to your installation): proc export dbms=excelcs data=mysasdata outfile="/directory/filename.xlsx" replace; sheet='sheet-name'; server="server-name.company.com"; port=9621; 2) Using the DBMS=XLSX option The XLSX option creates an xlsx file without using a PC File server. It is available with SAS 9.3 but supports only 26 columns under SAS 9.3 M1 (this is actually a defect) but works without this limitation under SAS 9.3 M2. Here is an example: PROC EXPORT DATA= WORK.LARGE OUTFILE="/directory/filename.xlsx" DBMS=XLSX REPLACE; SHEET="Sheet1"; NEWFILE=YES; RUN; 18