ebook img

Guide to SAS/AF Applications Development PDF

228 Pages·2011·1.96 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 The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2011. Guide to SAS/AF® Applications Development. Cary, NC: SAS Institute Inc. Guide to SAS/AF® Applications Development Copyright © 2011, SAS Institute Inc., Cary, NC, USA All rights reserved. Produced in the United States of America. For a hardcopy 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. This content was previously published as SAS® Guide to Applications Development, Second Edition. 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 Restricted Rights Notice: Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227–19, Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st electronic book, July 2011 SAS® Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/publishing or call 1-800-727-3228. 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 registered trademarks or trademarks of their respective companies. Contents About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix 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 Using SAS Tools to Develop Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 iv Contents Debugging and Optimizing Your Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Saving and Storing Frame SCL Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 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 Contents v Implementing Model/View Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Enabling Drag and Drop Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Modifying or Adding Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 56 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 86 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 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 vi Contents vii About This Book Audience SAS/AF software provides IS and IT 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 To use 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 any graphics objects in the frame will not be displayed, except for control objects (which are displayed as question marks (?) by default). 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 ix Recommended Reading Other resources that may be useful to you: • The SAS Component Language: Reference provides detailed reference information about the statements, functions, and other elements of SCL. Available from the SAS/AF Product Documentation page at support.sas.com/documentation/ onlinedoc/af/. • The online Help for SAS/AF software. The Help system provides a complete Component Reference, enabling you to quickly view class and property information. • Getting Started with SAS/AF and Frames provides a more basic introduction to using FRAME entries and SCL. Available from the SAS/AF Product Documentation page at support.sas.com/documentation/onlinedoc/af/. • SAS offers instructor-led training and self-paced e-learning courses to help you get started with SAS/AF. For more information about the courses available, see support.sas.com/training. For a complete list of SAS publications, go to support.sas.com/bookstore. If you have questions about which titles you need, please contact a SAS Publishing Sales Representative: SAS Publishing Sales SAS Campus Drive Cary, NC 27513-2414 Phone: 1-800-727-3228 Fax: 1-919-677-8166 E-mail: [email protected] Web address: support.sas.com/bookstore x Recommended Reading

Description:
SAS® Publishing provides a complete selection of books and electronic products, CDs, and hard-copy books, visit the SAS Publishing Web site at.
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.