SAS/C Library Reference, Third Edition, Release 6.00 Volume 2
Total Page:16
File Type:pdf, Size:1020Kb
SAS/C Library Reference, Third Edition, Release 6.00 Volume 2 SAS Institute Inc. SAS Campus Drive Cary, NC 27513 The correct bibliographic citation for this manual is as follows: SAS Institute Inc., SAS/C Library Reference, Third Edition, Volume 2, Release 6.00, Cary, NC: SAS Institute Inc., 1995. 623 pp. SAS/C Library Reference, Third Edition, Volume 2, Release 6.00 Copyright 1995 by SAS Institute Inc., Cary, NC, USA. ISBN 1-55544-667-1 All rights reserved. Printed in the United States of America. 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. Restricted Rights Legend. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, October 1995 The SAS System is an integrated system of software providing complete control over data access, management, analysis, and presentation. Base SAS software is the foundation of the SAS System. Products within the SAS System include SAS/ACCESS, SAS/AF, SAS/ASSIST, SAS/CALC, SAS/CONNECT, SAS/CPE, SAS/DMI, SAS/EIS, SAS/ENGLISH, SAS/ETS, SAS/FSP, SAS/GRAPH, SAS/IMAGE, SAS/IML, SAS/IMS-DL/I, SAS/INSIGHT, SAS/LAB, SAS/NVISION, SAS/OR, SAS/PH-Clinical, SAS/QC, SAS/REPLAY-CICS, SAS/SESSION, SAS/SHARE, SAS/SPECTRAVIEW, SAS/STAT, SAS/TOOLKIT, SAS/TRADER, SAS/TUTOR, SAS/DB2, SAS/GEO, SAS/GIS, SAS/PH-Kinetics, SAS/SHARE*NET, and SAS/SQL-DS software. Other SAS Institute products are SYSTEM 2000 Data Management Software, with basic SYSTEM 2000, CREATE, Multi-User, QueX, Screen Writer, and CICS interface software; InfoTap software; NeoVisuals software; JMP, JMP IN, JMP Serve, and JMP Design software; SAS/RTERM software; and the SAS/C Compiler and the SAS/CX Compiler; VisualSpace software; and Emulus software. MultiVendor Architecture and MVA are trademarks of SAS Institute Inc. SAS Institute also offers SAS Consulting, SAS Video Productions, Ambassador Select, and On-Site Ambassador services. Authorline, Books by Users, The Encore Series, JMPer Cable, Observations, SAS Communications, SAS Training, SAS Views, the SASware Ballot, and SelecText documentation are published by SAS Institute Inc. The SAS Video Productions logo and the Books by Users SAS Institute’s Author Service logo are registered service marks and the Helplus logo and The Encore Series logo are trademarks of SAS Institute Inc. All trademarks above are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. The Institute is a private company devoted to the support and further development of its software and related services. IBM and OpenEdition are registered trademarks or trademarks of International Business Machines Corporation. indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. Doc P17, 092595 Contents Part 1 Special Features of the SAS/C Library 1-1 Chapter 1 Dynamic-Loading Functions 1-1 Introduction 1-2 Function Descriptions 2-1 Chapter 2 CMS Low-Level I/O Functions 2-1 Introduction 2-2 CMS Low-Level I/O Functions 2-5 XEDIT Low-Level I/O Functions 2-8 Related Utility Functions 3-1 Chapter 3 MVS Low-Level I/O Functions 3-1 Introduction 3-2 DCBs and DCB Exit Routines 3-3 Direct BSAM Interface Functions 3-9 The Record-Oriented BSAM Interface 3-11 BSAM Record-Oriented Interface Functions 3-16 The osdynalloc Function 4-1 Chapter 4 MVS Multitasking and Other Low-Level System Interfaces 4-1 Introduction 4-1 Multitasking SAS/C Applications 4-2 Compatibility Changes 4-3 Function Descriptions 5-1 Chapter 5 Inter-User Communications Vehicle (IUCV) Functions 5-1 Introduction 5-1 IUCV Communications Overview 5-3 IUCV, Signal Handling, and Message Processing 5-5 IUCV Parameter Lists and External Interrupt Data Formats 5-7 Message Queues 5-8 Return Codes 5-8 Function Descriptions 5-15 An Example of IUCV Communication 5-21 Guidelines and Cautions 6-1 Chapter 6 Advanced Program-to-Program Communication/Virtual Machine (APPC/VM) Functions 6-1 Introduction 6-2 APPC/VM Parameter Lists and External Interrupt Data Formats 6-4 Function Descriptions 6-8 APPC/VM Communication Example Programs 6-16 Guidelines and Cautions 4 7-1 Chapter 7 The Subcommand Interface to EXECs and CLISTs 7-1 Introduction 7-1 Subcommand Processing in C Programs 7-3 Overview of the SUBCOM Environment 7-5 Function Descriptions 7-27 Examples of SUBCOM Processing 7-32 Guidelines for Subcommand Processing 8-1 Chapter 8 The CMS REXX SAS/C Interface 8-1 Introduction 8-1 REXX Concepts and Background 8-3 How the Library Interfaces with REXX 8-6 Function Descriptions 8-17 An Example of a REXX Function Package 8-19 Additional Guidelines and Related Topics 9-1 Chapter 9 Coprocessing Functions 9-1 Introduction 9-2 cocall and coreturn 9-3 Coprocess States 9-4 Passing Data between Coprocesses 9-5 Coprocess Data Types and Constants 9-6 Coprocess Identifiers 9-6 Restrictions 9-6 A Coprocessing Example 9-9 Advanced Topics: Program Termination 9-10 Advanced Topics: Signal Handling 9-11 Function Descriptions 10-1 Chapter 10 Localization 10-1 Introduction 10-1 Locales and Categories 10-4 The ‘‘S370’’ Locale 10-4 The ‘‘POSIX’’ Locale 10-4 Library-Supplied Locales 10-5 Function Descriptions 10-17 User-Added Locales 11-1 Chapter 11 Multibyte Character Functions 11-1 Introduction 11-1 SAS/C Implementation of Multibyte Character Sequences 11-4 Locales and Multibyte Character Sequences 11-4 Function Descriptions 12-1 Chapter 12 User-Added Signals 12-1 Introduction 12-2 Notes on Handlers for User-Defined Signals 12-2 Restrictions on Synchronous and Asynchronous Signals 12-2 Summary of Routines for Adding Signals 12-8 SAS/C Library Routines for Adding New Signals SAS/C Library Reference, Third Edition, Release 6.00 Contents v 13-1 Chapter 13 Getting Environmental Information 13-1 Introduction 13-1 The L$UENVR Routine 13-3 Function Descriptions Part 2 SAS/C Socket Library for TCP/IP 14-1 Chapter 14 The TCP/IP Protocol Suite 14-1 Overview of TCP/IP 14-2 Internet Protocol (IP) 14-2 User Datagram Protocol (UDP) 14-3 Transmission Control Protocol (TCP) 14-3 Domain Name System (DNS) 14-4 MVS and CMS TCP/IP Implementation 15-1 Chapter 15 The BSD UNIX Socket Library 15-1 Introduction 15-2 Overview of the BSD UNIX Socket Library 15-3 Header Files 15-12 Socket Functions 16-1 Chapter 16 Porting UNIX Socket Applications to the SAS/C Environment 16-1 Introduction 16-1 Integrated and Non-Integrated Sockets 16-2 Socket Library Restrictions 16-3 Function Names 16-4 Header Filenames 16-4 errno 16-4 BSD Library Dependencies 16-5 INETD and BSD Kernel Routine Dependencies 16-6 Character Sets 16-6 The Resolver 17-1 Chapter 17 Network Administration 17-1 Introduction 17-1 Configuration Data Sets 17-1 Search Logic 17-3 Specifying TCPIP_PREFIX for MVS 17-4 Specifying TCPIP_MACH 17-4 gethostbyname and Resolver Configuration 17-5 Configuring for the CMS Environment 17-5 Configuring for the MVS Environment 18-1 Chapter 18 Socket Function Reference 18-1 Introduction Part 3 SAS/C POSIX Support 19-1 Chapter 19 Introduction to POSIX 19-1 POSIX and OpenEdition Concepts 19-3 The errno Variable 19-6 SAS/C OpenEdition Interfaces Contents vi Contents 20-1 Chapter 20 POSIX Function Reference 20-1 Introduction Function Index Index SAS/C Library Reference, Third Edition, Release 6.00 Syntax vii Using This Book SAS/C Library Reference, Third Edition, Volume 2, Release 6.00 provides complete reference documentation for the functions that comprise the SAS/C Library. It is primarily intended for experienced C programmers. It makes no attempt to discuss either programming fundamentals or how to program in C. SAS Online Samples Many of the examples used in this book are available through SAS Online Samples. SAS Online Samples enables you to download the sample programs from many SAS books by using one of three facilities: Anonymous FTP, SASDOC-L, or the World Wide Web. ™ Anonymous FTP SASDOC-L Anonymous FTP enables you to download SASDOC-L is a listserv maintained by the ASCII files and binary files (SAS data Publications Division at SAS Institute. As a libraries in transport format). To use subscriber, you can request ASCII files that anonymous FTP, connect to FTP.SAS.COM. contain sample programs. Once connected, enter the following To use SASDOC-L, send e-mail, with no responses as you are prompted: subject, to [email protected]. Name (ftp.sas.com:user-id): The body of the message should be one of anonymous the lines listed below. Password: To subscribe to SASDOC-L, send this <your e-mail address> message: Next, change to the publications directory: SUBSCRIBE SASDOC-L <firstname lastname> >cd pub/publications To get general information about files, For general information about files, download the file INFO by sending this download the file info: message: >get info <target-filename> GET INFO EXAMPLES SASDOC-L For a list of available sample programs, To get a list of available sample programs, download the file index: download the file INDEX by sending this >get index <target-filename> message: Once you know the name of the file you GET INDEX EXAMPLES SASDOC-L want, issue a GET command to download Once you know the name of the file you the file.