ebook img

Guide to SAS/AF Applications Development PDF

230 Pages·2013·4.74 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Guide to SAS/AF Applications Development

Guide to SAS/AF® Applications Development SAS® Documentation May 2017 The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2013. Guide to SAS/AF® Applications Development. Cary, NC: SAS Institute Inc. Guide to SAS/AF® Applications Development Copyright © 2013, SAS Institute Inc., Cary, NC, USA All Rights Reserved. Produced in the United States of America. For a hard copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. For a web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication. The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrighted materials. Your support of others' rights is appreciated. U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer software developed at private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, or disclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR 227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S. federal law, the minimum restricted rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision serves as notice under clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The Government’s rights in Software and documentation shall be only those set forth in this Agreement. SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414 May 2017 SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies. 9.4-P3:appdevgd Contents About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Introducing the SAS/AF Development Environment PART 1 1 Chapter 1 • The Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 What Is SAS/AF Software? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 2 • An Applications Development Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Steps to Developing SAS/AF Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Developing Applications PART 2 11 Chapter 3 • Tools for the Applications Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 About the SAS/AF Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Build Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Components Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Properties Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Source Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Chapter 4 • Developing Frames with Ready-Made Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Working with Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Selecting Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Re-using Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Defining Attachments to Enable Automatic Component Resizing . . . . . . . . . . . . . . . . 25 Chapter 5 • Communicating with Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Attribute Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Model/View Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Drag and Drop Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Chapter 6 • Adding SAS Component Language Programs to Frames . . . . . . . . . . . . . . . . . . . . 35 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Working with Frames and SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 When Frame SCL Is Not Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 When Frame SCL Is Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Constructing a Frame SCL Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Controlling the Execution of SCL Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Calling Other Entries and Opening Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Compiling and Testing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Debugging and Optimizing Your Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Saving and Storing Frame SCL Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 iv Contents Chapter 7 • Adding Application Support Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Implementing Custom Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Adding Online Help to Your Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Chapter 8 • Deploying Your Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Application Deployment Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Migrating Your Application from Testing to Production . . . . . . . . . . . . . . . . . . . . . . . . 58 Configuring a SAS Session for Your Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Enabling the Application for Your Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Developing Custom Components PART 3 65 Chapter 9 • Tools for the Component Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Class Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Resource Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Interface Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Source Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Other Development Tools and Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Chapter 10 • SAS Object-Oriented Programming Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Object-Oriented Development and the SAS Component Object Model . . . . . . . . . . . . 73 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Chapter 11 • Developing Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Creating Your Own Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Creating a Class with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Using SCL to Instantiate Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Chapter 12 • Managing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Implementing Methods with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Overriding Frame Methods to Augment SCL Labeled Sections . . . . . . . . . . . . . . . . . 113 Chapter 13 • Managing Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Specifying a Component's Default Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Validating the Values of Character Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Assigning an Editor to an Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Adding a Custom Attributes Window to a Component . . . . . . . . . . . . . . . . . . . . . . . . 119 Assigning a Custom Access Method (CAM) to an Attribute . . . . . . . . . . . . . . . . . . . . 121 Using the Refresh Attributes Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Using List Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Chapter 14 • Adding Communication Capabilities to Components . . . . . . . . . . . . . . . . . . . . . 129 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Enabling Attribute Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Implementing Model/View Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Enabling Drag and Drop Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Modifying or Adding Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Contents v Chapter 15 • Deploying Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Managing Classes with Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Making a New Class Available for Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Generating Class Documentation with GenDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Appendixes PART 4 161 Appendix 1 • Flow of Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 How SCL Programs Execute for FRAME Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Flow of Control for Frame SCL Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Appendix 2 • Adding Attachments to Frame Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Selecting the Attachment Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Initiating Define Attachment Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Selecting the Direction and Type for the Attachment . . . . . . . . . . . . . . . . . . . . . . . . . 182 Making the Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Defining Attachments to Sibling Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Defining Attachments to Components That Have Borders . . . . . . . . . . . . . . . . . . . . . 189 Moving Multiple Components That Include Attachments . . . . . . . . . . . . . . . . . . . . . . 190 Restricting Component Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Changing and/or Deleting an Attachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Displaying Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Situations in Which an Attachment Is Ignored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Errors and Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Tips for Using Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Appendix 3 • Working with SAS/AF Keys in the SAS Registry . . . . . . . . . . . . . . . . . . . . . . . . . 197 About the SAS Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 SAS Registry Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Modifying the Registry Settings for SAS/AF Software . . . . . . . . . . . . . . . . . . . . . . . . 198 Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 vi Contents vii About This Book Audience SAS/AF software provides developers the tools that they need to build enterprise-wide applications that can be integrated with the features and functionality of other SAS software products. Whether you are a component designer who defines the architecture and creates class libraries, or an application developer who uses the supplied components to create applications, this book provides a single reference to begin developing applications with SAS software. Requirements The SAS/AF development environment requires a graphics display device capable of displaying the Graphics Editor in SAS/GRAPH output. You can run frame-based applications on nongraphics devices, but graphics objects will not be displayed, and control objects will be displayed as question marks (?). Such text- based frames are those that do not use SAS/GRAPH output, SAS/GRAPH fonts, graphics control boxes, or special region outlining and titles. For detailed requirements and the most current information, see the system requirements sheet that is shipped with SAS/AF software. To create and run applications in FRAME entries, you need the following SAS software products: • Base SAS software • SAS/AF software (required only for creating Frame applications; not required for running Frame applications) • SAS/GRAPH software (required for creating or displaying graphics objects or images, for using SAS/GRAPH fonts, and for printing some frame objects) viii About This Book 1 Part 1 Introducing the SAS/AF Development Environment Chapter 1 The Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 2 An Applications Development Methodology . . . . . . . . . . . . . . . . . . . . . . . 5 2

Description:
This content was previously published as SAS® Guide to Applications Development, Second Edition. The scanning .. components to create applications, this book provides a single reference to begin developing text pad control provide a
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.