Using ODS Excel Migrating from DDE to ODS OASUS Spring or Fall YYYY Monday, May 28, 2018 Using ODS Excel Migrating from DDE to ODS Robert West Statistics Canada First & last name Company name
OASUS Spring or Fall YYYY Agenda Monday, May 28, 2018 Describe the issue A Real life Problem ODS EXCEL – ExcelXP 2.0 First & last name Company name
A Number of Government Departments Are Moving to a Grid Envrionment OASUS Spring or Fall YYYY Monday, May 28, 2018 A Number of Government Departments Are Moving to a Grid Envrionment First & last name Company name
How Does This Affect DDE? OASUS Spring or Fall YYYY Monday, May 28, 2018 How Does This Affect DDE? If you are using Unix as an operating system like we are in STC, DDE cannot be used First & last name Company name
This may be a source of anxiety… OASUS Spring or Fall YYYY Monday, May 28, 2018 This may be a source of anxiety… First & last name Company name
…or it just might make you angry… OASUS Spring or Fall YYYY Monday, May 28, 2018 …or it just might make you angry… First & last name Company name
…and you don’t know were to turn OASUS Spring or Fall YYYY Monday, May 28, 2018 …and you don’t know were to turn First & last name Company name
Fortunately we have a solution OASUS Spring or Fall YYYY Monday, May 28, 2018 Fortunately we have a solution First & last name Company name
OASUS Spring or Fall YYYY Monday, May 28, 2018 Yea! First & last name Company name
OASUS Spring or Fall YYYY Describe Case Monday, May 28, 2018 Our Client at Statistics Canada was using an obsolete server which needed replacing No New or Replacement SAS Servers are to be authorized: All SAS computing to be done on the grid The Powers That Be wanted the server decommissioned yesterday The Client used DDE to create numerous reports needed for their operations DDE cannot be used on the STC SAS Grid First & last name Company name
Example Original Report OASUS Spring or Fall YYYY Example Original Report Monday, May 28, 2018 First & last name Company name
The Same Report Created by SAS ExcelXP OASUS Spring or Fall YYYY The Same Report Created by SAS ExcelXP Monday, May 28, 2018 First & last name Company name
OASUS Spring or Fall YYYY Things to Consider Monday, May 28, 2018 DDE -> places data into specific cells in an existing Excel workbook ODS - > Places whole table(s) into a new workbook When using ODS you have to think in terms of: Complete tables The workbook cannot be edited First & last name Company name
OASUS Spring or Fall YYYY Original DDE Code Monday, May 28, 2018 Macro Developed at Statcan This Macro took care of all the DDE coding First & last name Company name
DDE Macro used at Statcan OASUS Spring or Fall YYYY DDE Macro used at Statcan Monday, May 28, 2018 Macro Developed at Statcan This Macro took care of all the DDE coding It was at this point in the Code that I started changing things Instead of a Macro Call, I … First & last name Company name
Preliminary Changes Made OASUS Spring or Fall YYYY Preliminary Changes Made Monday, May 28, 2018 … Created a Data Set for the table Keep in mind that some of the DDE tables came from Multiple tables and which needed to be ‘put together’ before they could be used Some outputs were to a single cell so these were placed in a macro variable First & last name Company name
OASUS Spring or Fall YYYY Creating the Report Monday, May 28, 2018 First & last name Company name
Preliminary Statements OASUS Spring or Fall YYYY Preliminary Statements Monday, May 28, 2018 Housekeeping ODS Listing Close Makes sure that the ODS goes to an output file and not to the SAS listing Window First & last name Company name
Setting up the Workbook OASUS Spring or Fall YYYY Setting up the Workbook Monday, May 28, 2018 This Part of the ExcelXP statement deals with the Work book First & last name Company name
OASUS Spring or Fall YYYY Setting up Worksheet Monday, May 28, 2018 This Part of the ExcelXP statement deals with the Worksheet This creates: The column widths The worksheet name. First & last name Company name
OASUS Spring or Fall YYYY Setting up Worksheet Monday, May 28, 2018 If you only have a one page Report, they can be combined First & last name Company name
OASUS Spring or Fall YYYY Column Widths Monday, May 28, 2018 The column widths option is a string of numbers First & last name Company name
Getting Column Widths From Existing Worksheet OASUS Spring or Fall YYYY Getting Column Widths From Existing Worksheet Monday, May 28, 2018 Used the Excel ‘Cell” Function to get the width of the cell number an integer First & last name Company name
Getting Column Widths From Existing Worksheet OASUS Spring or Fall YYYY Getting Column Widths From Existing Worksheet Monday, May 28, 2018 Point 1 Point 2 Point 3 …. First & last name Company name
Getting Column Widths From Existing Worksheet OASUS Spring or Fall YYYY Getting Column Widths From Existing Worksheet Monday, May 28, 2018 Make sure that the function is in all of the columns First & last name Company name
OASUS Spring or Fall YYYY Coding Column Widths Monday, May 28, 2018 Paste the resultant String into the code, Use the Backspace and space keys to tidy it up First & last name Company name
OASUS Spring or Fall YYYY Proc Report Monday, May 28, 2018 An Example of a Proc Report procedure First & last name Company name
Complete Column Statement OASUS Spring or Fall YYYY Complete Column Statement Monday, May 28, 2018 First We Will Look at the Columns Keep in mind: The order in which the var names appear in this list is the order in which they will be in the report A var can appear more than once First & last name Company name
Example of Nested Columns OASUS Spring or Fall YYYY Example of Nested Columns Monday, May 28, 2018 You can nest columns if you so wish The nested columns are enclosed in parentheses The Label for the nested columns, comes first and is in quotes First & last name Company name
OASUS Spring or Fall YYYY Defining Columns Monday, May 28, 2018 Once they are listed, they may have to be defined, (keep in mind the order in which they appear has no affect on the way they are ordered in the table) First & last name Company name
This Reports Had (too) Many Columns OASUS Spring or Fall YYYY This Reports Had (too) Many Columns Monday, May 28, 2018 First & last name Company name
Use the Concatenate function in Excel to start OASUS Spring or Fall YYYY Use the Concatenate function in Excel to start Monday, May 28, 2018 Use the Concatenate function in Excel First & last name Company name
Enter the Define Statements OASUS Spring or Fall YYYY Enter the Define Statements Monday, May 28, 2018 Copy the ‘define’ keyword down the left side First & last name Company name
Select the Existing Column Labels OASUS Spring or Fall YYYY Select the Existing Column Labels Monday, May 28, 2018 Select the Column Labels from the old report First & last name Company name
OASUS Spring or Fall YYYY Use Transpose-Copy Monday, May 28, 2018 Use Transpose Copy to place them into the selected column First & last name Company name
Enter the Variable Names OASUS Spring or Fall YYYY Enter the Variable Names Monday, May 28, 2018 Enter the Variable name (perhaps copied from the keep statement from the dataset used to create the table) First & last name Company name
Insert the Style Statements OASUS Spring or Fall YYYY Insert the Style Statements Monday, May 28, 2018 Figure out the forming for each of the variables First & last name Company name
Use Excel to Concatenate All the various parts OASUS Spring or Fall YYYY Use Excel to Concatenate All the various parts Monday, May 28, 2018 Concatenate all the columns together First & last name Company name
Copy the Entire Column… OASUS Spring or Fall YYYY Copy the Entire Column… Monday, May 28, 2018 First & last name Company name
… Into the Program Edit Window OASUS Spring or Fall YYYY … Into the Program Edit Window Monday, May 28, 2018 First & last name Company name
Footnote/Title Statements OASUS Spring or Fall YYYY Footnote/Title Statements Monday, May 28, 2018 These lines add a title to the report. In this case we are using the macro variable created earlier. First & last name Company name
OASUS Spring or Fall YYYY End Statements Monday, May 28, 2018 We then close the ExcelXP, this allows ODS to create the output file Then the ods listing, which returns the output to the listing window First & last name Company name
OASUS Spring or Fall YYYY Result Monday, May 28, 2018 First & last name Company name
Macro To Create Multiple Pages OASUS Spring or Fall YYYY Macro To Create Multiple Pages Monday, May 28, 2018 The Workbook ExcelXP Inside the Macro the Worksheet Info The macro calls First & last name Company name
OASUS Spring or Fall YYYY Result Monday, May 28, 2018 We see the data The worksheet tabs First & last name Company name
Create Multiple Pages Another Way OASUS Spring or Fall YYYY Create Multiple Pages Another Way Monday, May 28, 2018 We have one ODS ExcelXP statement for each page Note we have only ONE ExcelXP close statement. First & last name Company name
Change Colour of Columns OASUS Spring or Fall YYYY Change Colour of Columns Monday, May 28, 2018 Sometimes we may need to give a column a different background colour, this is how we do this. First & last name Company name
OASUS Spring or Fall YYYY Result Monday, May 28, 2018 On this slide we see: The columns with a different colour background The tabs for the two worksheets First & last name Company name
Multiple Tables on a Single Page OASUS Spring or Fall YYYY Multiple Tables on a Single Page Monday, May 28, 2018 For creating two tables on a Single Page, we had two proc reports First & last name Company name
OASUS Spring or Fall YYYY Highlighting Rows Monday, May 28, 2018 For this output we also want to highlight some rows. To do this we us a compute block and an if statement First & last name Company name
OASUS Spring or Fall YYYY Result Monday, May 28, 2018 First & last name Company name
OASUS Spring or Fall YYYY Things to Remember Monday, May 28, 2018 DDE -> places data into specific cells in an existing Excel workbook ODS - > Places whole table(s) into a new workbook When using ODS you have to think in terms of: Complete tables The workbook cannot be edited First & last name Company name
ODS Excel (needs SAS 9.4 M3 to work) OASUS Spring or Fall YYYY ODS Excel (needs SAS 9.4 M3 to work) Monday, May 28, 2018 Inserting graphic into a worksheet Inserting images into a worksheet Adding text to a Microsoft Excel Worksheet Using SAS formats with the Excel destination to control cell formatting First & last name Company name
ODS Excel Creating Filters and Freezing Panes Create Excel Formulas SAS can read File Created by ODS Excel Generating smaller files
A paper from this year’s SAS Global Forum OASUS Spring or Fall YYYY A paper from this year’s SAS Global Forum Monday, May 28, 2018 This paper, (copies are available) covers the new ODS Excel First & last name Company name
Inserting Graphics into a worksheet: Code OASUS Spring or Fall YYYY Inserting Graphics into a worksheet: Code Monday, May 28, 2018 Some option statements ODS graphics to place the graph into the worksheet Defining the graph First & last name Company name
Inserting Graphics into a worksheet OASUS Spring or Fall YYYY Inserting Graphics into a worksheet Monday, May 28, 2018 Canadian Army divides its units into Corps Logistics Royal Canadian Artillery Royal Canadian Armoured Corp Royal Canadian Corps of Signals Royal Canadian Engineers Royal Canadian Infantry Corp First & last name Company name
Inserting images into a worksheet OASUS Spring or Fall YYYY Inserting images into a worksheet Monday, May 28, 2018 First & last name Company name
Inserting images (watermarks) into a worksheet OASUS Spring or Fall YYYY Inserting images (watermarks) into a worksheet Monday, May 28, 2018 Watermark badge of the RCAF. Per Ardua Ad Austra (through adversity to the Stars First & last name Company name
Adding Text Using PROC ODSTEXT OASUS Spring or Fall YYYY Adding Text Using PROC ODSTEXT Monday, May 28, 2018 First & last name Company name
This Can Be Used To Create a Title Page OASUS Spring or Fall YYYY This Can Be Used To Create a Title Page Monday, May 28, 2018 First & last name Company name
Adding Text Using ODS TEXT OASUS Spring or Fall YYYY Adding Text Using ODS TEXT Monday, May 28, 2018 First & last name Company name
OASUS Spring or Fall YYYY Used To Create A Title Monday, May 28, 2018 First & last name Company name
Using Proc Report to Create Formats OASUS Spring or Fall YYYY Using Proc Report to Create Formats Monday, May 28, 2018 We had an expanded way to add formats to the data. Without using the define statement First & last name Company name
OASUS Spring or Fall YYYY Resulting Example Monday, May 28, 2018 First & last name Company name
Freezing Rows and Columns, Adding an Filter OASUS Spring or Fall YYYY Freezing Rows and Columns, Adding an Filter Monday, May 28, 2018 We can also employ Frozen header Frozen Rows Filters First & last name Company name
OASUS Spring or Fall YYYY Example Monday, May 28, 2018 First & last name Company name
Utilizing the Formula Option OASUS Spring or Fall YYYY Utilizing the Formula Option Monday, May 28, 2018 First & last name Company name
OASUS Spring or Fall YYYY Example Monday, May 28, 2018 First & last name Company name
SAS Can Read Files Created by ODS Excel OASUS Spring or Fall YYYY SAS Can Read Files Created by ODS Excel Monday, May 28, 2018 ODS Excel creates Output files in native XLSX format Therefor SAS can import a file created by ODS Excel First & last name Company name
ODS Excel Create a Smaller Output File OASUS Spring or Fall YYYY ODS Excel Create a Smaller Output File Monday, May 28, 2018 First & last name Company name
OASUS Spring or Fall YYYY Monday, May 28, 2018 If This presentation as felt like this: I have prepared some example files for you. Which can be found… First & last name Company name
Questions Robert West robert.west@Canada.ca System Engineering Division Statistics Canada Jean-Talon Building 5-A7 170, Tunney’s Pasture driveway Ottawa, Ont., K1A 0T6 (613) 799-0598 robert.west@Canada.ca