Transcription of Base SAS 9.2 Procedures Guide
1 Base SAS Procedures 11/22/09 11:41:14 AMThe correct bibliographic citation for this manual is as follows: SAS Institute Inc. SAS Procedures Guide . Cary, NC: SAS Institute SAS Procedures GuideCopyright 2009 by SAS Institute Inc., Cary, NC, USAISBN 978 1-59994-714-3 All rights reserved. Produced in the United States of a hard-copy book:No part of this publication may be reproduced, stored in aretrieval system, or transmitted, in any form or by any means, electronic, mechanical,photocopying, or otherwise, without the prior written permission of the publisher, SASI nstitute a Web download or e-book:Your use of this publication shall be governed by theterms established by the vendor at the time you acquire this Government Restricted Rights , duplication, or disclosure of thissoftware and related documentation by the government is subject to the Agreementwith SAS Institute and the restrictions set forth in FAR 19 Commercial ComputerSoftware-Restricted Rights (June 1987).
2 SAS Institute Inc., SAS Campus Drive, Cary, North Carolina electronic printing, February 20092nd electronic printing, September 20093rd electronic printing, May 20101st printing, June 2009 SAS Publishing provides a complete selection of books and electronic products to helpcustomers use SAS software to its fullest potential. For more information about oure-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web call and all other SAS Institute Inc. product or service names are registered trademarksor trademarks of SAS Institute Inc. in the USA and other countries. indicates brand and product names are registered trademarks or trademarks of theirrespective s NewxiiiOverviewxiiiNew Base SAS ProceduresxivEnhanced Base SAS ProceduresxvDocumentation EnhancementsxxivPART1 Concepts 1 Chapter 1 Choosing the Right Procedure 3 Functional Categories of Base SAS Procedures3 Report-Writing Procedures5 Statistical Procedures6 Utility Procedures8 Brief Descriptions of Base SAS Procedures10 Chapter 2 Fundamental Concepts for Using Base SAS Procedures 17 Language Concepts17 Procedure Concepts20 Output Delivery System33 Chapter 3 Statements with the Same Function in Multiple Procedures 35 Overview35 Statements36 Chapter 4 In-Database Processing of Base Procedures 49 Base Procedures That Are Enhanced for In-Database Processing49 PART2 Procedures 51 Chapter 5 The APPEND Procedure 55
3 Overview: APPEND Procedure55 Syntax: APPEND Procedure55 Chapter 6 The CALENDAR Procedure 57 Overview: CALENDAR Procedure59 Syntax: CALENDAR Procedure64 Concepts: CALENDAR Procedure82 Results: CALENDAR Procedure92 Examples: CALENDAR Procedure93 Chapter 7 The CALLRFC Procedure 129 Information about the CALLRFC Procedure129ivChapter 8 The CATALOG Procedure 131 Overview: CATALOG Procedure131 Syntax: CATALOG Procedure132 Concepts: CATALOG Procedure142 Results: CATALOG Procedure146 Examples: CATALOG Procedure147 Chapter 9 The CHART Procedure 155 Overview: CHART Procedure155 Syntax: CHART Procedure160 Concepts: CHART Procedure173 Results: CHART Procedure174 Examples: CHART Procedure175 References189 Chapter 10 The CIMPORT Procedure 191 Overview: CIMPORT Procedure191 Syntax: CIMPORT Procedure192 CIMPORT Problems: Importing Transport Files198 Examples: CIMPORT Procedure203 Chapter 11 The COMPARE Procedure 207 Overview: COMPARE Procedure208 Syntax: COMPARE Procedure211 Concepts: COMPARE Procedure222 Results: COMPARE Procedure226 Examples: COMPARE Procedure239 Chapter 12 The CONTENTS Procedure 259 Overview: CONTENTS Procedure259 Syntax: CONTENTS Procedure259 Chapter 13 The COPY Procedure 261 Overview: COPY Procedure261 Syntax: COPY Procedure261 Concepts: COPY Procedure262 Example: COPY Procedure263 Chapter 14 The CORR Procedure 267 Information about the CORR Procedure267 Chapter 15 The CPORT Procedure 269 Overview: CPORT Procedure269 Syntax: CPORT Procedure270 READ= Data Set Option in the PROC CPORT Statement278 Results: CPORT Procedure279 Examples.
4 CPORT Procedure279vChapter 16 The CV2 VIEW Procedure 285 Information about the CV2 VIEW Procedure285 Chapter 17 The DATASETS Procedure 287 Overview: DATASETS Procedure288 Syntax: DATASETS Procedure291 Concepts: DATASETS Procedure353 Results: DATASETS Procedure359 Examples: DATASETS Procedure372 Chapter 18 The DBCSTAB Procedure 399 Information about the DBCSTAB Procedure399 Chapter 19 The DISPLAY Procedure 401 Overview: DISPLAY Procedure401 Syntax: DISPLAY Procedure401 Example: DISPLAY Procedure402 Chapter 20 The DOCUMENT Procedure 405 Information about the DOCUMENT Procedure405 Chapter 21 The EXPLODE Procedure 407 Information about the EXPLODE Procedure407 Chapter 22 The EXPORT Procedure 409 Overview: EXPORT Procedure409 Syntax: EXPORT Procedure409 Examples: EXPORT Procedure412 Chapter 23 The FCMP Procedure 417 Overview: FCMP Procedure420 Syntax: FCMP Procedure420 Concepts: FCMP Procedure431 PROC FCMP and DATA Step Differences435 Working with Arrays438 Reading Arrays and Writing Arrays to a Data Set439 Using Macros with PROC FCMP Routines442 Variable Scope in PROC FCMP Routines442 Recursion443 Directory Transversal445 Identifying the Location of Compiled Functions and Subroutines: The CMPLIB=System Option448 Special Functions and CALL Routines: Overview451 Special Functions and CALL Routines: Matrix CALL Routines451 Special Functions and CALL Routines: C Helper Functions and CALL Routines463 Special Functions and CALL Routines: Other Functions467 Functions for Calling SAS Code from Within Functions472 The FCmp Function Editor477viExamples.
5 FCMP Procedure488 Chapter 24 The FONTREG Procedure 497 Overview: FONTREG Procedure497 Syntax: FONTREG Procedure498 Concepts: FONTREG Procedure504 Examples: FONTREG Procedure506 Chapter 25 The FORMAT Procedure 511 Overview: FORMAT Procedure512 Syntax: FORMAT Procedure513 Informat and Format Options534 Specifying Values or Ranges536 Concepts: FORMAT Procedure537 Results: FORMAT Procedure541 Examples: FORMAT Procedure546 Chapter 26 The FORMS Procedure 573 Information about the FORMS Procedure573 Chapter 27 The FREQ Procedure 575 Information about the FREQ Procedure575 Chapter 28 The FSLIST Procedure 577 Overview: FSLIST Procedure577 Syntax: FSLIST Procedure577 Using the FSLIST Window582 Chapter 29 The HTTP Procedure 589 Overview: HTTP Procedure589 Syntax: HTTP Procedure589 Using Hypertext Transfer Protocol Secure (HTTPS)591 Examples: HTTP Procedure592 Chapter 30 The IMPORT Procedure 595 Overview: IMPORT Procedure595 Syntax: IMPORT Procedure596 Examples: IMPORT Procedure599 Chapter 31 The INFOMAPS Procedure 605 Information about the INFOMAPS Procedure605 Chapter 32 The JAVAINFO Procedure 607 Overview: JAVAINFO Procedure607 Syntax: JAVAINFO Procedure607 Chapter 33 The MEANS Procedure 609 Overview: MEANS Procedure610 Syntax: MEANS Procedure612viiConcepts: MEANS Procedure637In-Database Processing for PROC MEANS640 Statistical Computations: MEANS Procedure641 Results: MEANS Procedure644 Examples.
6 MEANS Procedure646 References675 Chapter 34 The METADATA Procedure 677 Information about the METADATA Procedure677 Chapter 35 The METALIB Procedure 679 Information about the METALIB Procedure679 Chapter 36 The METAOPERATE Procedure 681 Information about the METAOPERATE Procedure681 Chapter 37 The MIGRATE Procedure 683 Overview: MIGRATE Procedure683 Syntax: MIGRATE Procedure685 Concepts: MIGRATE Procedure687 Migrating a Library with Validation Tools693 Using the SLIBREF= Option693 Examples695 Chapter 38 The OPTIONS Procedure 701 Overview: OPTIONS Procedure701 Syntax: OPTIONS Procedure707 Results: OPTIONS Procedure710 Examples: OPTIONS Procedure710 Chapter 39 The OPTLOAD Procedure 715 Overview: OPTLOAD Procedure715 Syntax: OPTLOAD Procedure715 Chapter 40 The OPTSAVE Procedure 717 Overview: OPTSAVE Procedure717 Syntax: OPTSAVE Procedure717 Chapter 41 The PLOT Procedure 719 Overview: PLOT Procedure720 Syntax: PLOT Procedure722 Concepts: PLOT Procedure738 Results: PLOT Procedure743 Examples: PLOT Procedure744 Chapter 42 The PMENU Procedure 777 Overview: PMENU Procedure777 Syntax: PMENU Procedure778viiiConcepts: PMENU Procedure792 Examples: PMENU Procedure794 Chapter 43 The PRINT Procedure 815 Overview: PRINT Procedure815 Syntax: PRINT Procedure818 Results: Print Procedure832 Examples: PRINT Procedure835 Chapter 44 The PRINTTO Procedure 887 Overview: PRINTTO Procedure887 Syntax: PRINTTO Procedure888 Concepts: PRINTTO Procedure891 Examples: PRINTTO Procedure892 Chapter 45 The PROTO Procedure 903 Overview: PROTO Procedure903 Syntax: PROTO Procedure904 Concepts.
7 PROTO Procedure906C Helper Functions and CALL Routines916 Results: PROTO Procedure918 Examples: PROTO Procedure919 Chapter 46 The PRTDEF Procedure 921 Overview: PRTDEF Procedure921 Syntax: PRTDEF Procedure921 Input Data Set: PRTDEF Procedure923 Examples: PRTDEF Procedure928 Chapter 47 The PRTEXP Procedure 933 Overview: PRTEXP Procedure933 Syntax: PRTEXP Procedure933 Concepts: PRTEXP Procedure935 Examples: PRTEXP Procedure935 Chapter 48 The PWENCODE Procedure 937 Overview: PWENCODE Procedure937 Syntax: PWENCODE Procedure937 Concepts: PWENCODE Procedure938 Examples: PWENCODE Procedure939 Chapter 49 The RANK Procedure 943 Overview: RANK Procedure943 Syntax: RANK Procedure945 Concepts: RANK Procedure951In-Database Processing for PROC RANK953 Results: RANK Procedure954ixExamples: RANK Procedure955 References961 Chapter 50 The REGISTRY Procedure 963 Overview: REGISTRY Procedure963 Syntax: REGISTRY Procedure963 Creating Registry Files with the REGISTRY Procedure968 Examples: REGISTRY Procedure971 Chapter 51 The REPORT Procedure 979 Overview: REPORT Procedure981 Concepts: REPORT Procedure986In-Database Processing for PROC REPORT1003 Syntax: REPORT Procedure1004 REPORT Procedure Windows1052 How PROC REPORT Builds a Report1075 Examples: REPORT Procedure1087 Chapter 52 The SCAPROC Procedure 1143 Overview: SCAPROC Procedure1143 Syntax: SCAPROC Procedure1144 Results: SCAPROC Procedure1145 Examples: SCAPROC Procedure1148 Chapter 53 The SOAP Procedure 1153 Overview: SOAP Procedure1153 Syntax: SOAP Procedure1154 Concepts: SOAP Procedure1157WS-Security.
8 Client Configuration1157 Using PROC SOAP with Secure Socket Layer (SSL)1158 Methods of Calling SAS Web Services1159 Examples: SOAP Procedure1160 Chapter 54 The SORT Procedure 1165 Overview: SORT Procedure1165 Syntax: SORT Procedure1167 Concepts: SORT Procedure1181In-Database Processing: PROC SORT1184 Integrity Constraints: SORT Procedure1185 Results: SORT Procedure1186 Examples: SORT Procedure1187 Chapter 55 The SQL Procedure 1197 Overview: SQL Procedure1199 Syntax: SQL Procedure1201 SQL Procedure Component Dictionary1247 PROC SQL and the ANSI Standard1293xExamples: SQL Procedure1296 Chapter 56 The STANDARD Procedure 1335 Overview: STANDARD Procedure1335 Syntax: STANDARD Procedure1337 Results: STANDARD Procedure1343 Statistical Computations: STANDARD Procedure1343 Examples: STANDARD Procedure1344 Chapter 57 The SUMMARY Procedure 1351 Overview: SUMMARY Procedure1351 Syntax: SUMMARY Procedure1351 Chapter 58 The TABULATE Procedure 1355 Overview: TABULATE Procedure1356 Terminology: TABULATE Procedure1359 Syntax: TABULATE Procedure1362 Concepts: TABULATE Procedure1391In-Database Processing for PROC TABULATE1400 Results: TABULATE Procedure1401 Examples: TABULATE Procedure1413 References1474 Chapter 59 The TEMPLATE Procedure 1475 Information about the TEMPLATE Procedure1475 Chapter 60 The TIMEPLOT Procedure 1477 Overview: TIMEPLOT Procedure1477 Syntax: TIMEPLOT Procedure1479 Results: TIMEPLOT Procedure1487 Examples: TIMEPLOT Procedure1489 Chapter 61 The TRANSPOSE Procedure 1501 Overview: TRANSPOSE Procedure1501 Syntax: TRANSPOSE Procedure1504 Results.
9 TRANSPOSE Procedure1510 Examples: TRANSPOSE Procedure1512 Chapter 62 The TRANTAB Procedure 1525 Information about the TRANTAB Procedure1525 Chapter 63 The UNIVARIATE Procedure 1527 Information about the UNIVARIATE Procedure1527 Chapter 64 The XSL Procedure (Preproduction) 1529 Overview: XSL Procedure1529 Syntax: XSL Procedure1530 Examples: XSL Procedure1531xiPART3 Appendixes 1533 Appendix 1 SAS Elementary Statistics Procedures 1535 Overview1535 Keywords and Formulas1536 Statistical Background1544 References1569 Appendix 2 Operating Environment-Specifi