ebook img

SAS/ACCESS 9.1.3 Supplement for DB2 under z/OS (SAS/ACCESS PDF

68 Pages·2006·1.06 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 SAS/ACCESS 9.1.3 Supplement for DB2 under z/OS (SAS/ACCESS

SAS/ACCESS® 9.1.3 Supplement for DB2 under z/OS SAS/ACCESS for Relational Databases The correct bibliographiccitation forthis manualis asfollows: SAS InstituteInc. 2006. SAS/ACCESS® 9.1.3 Supplementfor DB2underz/OS(SAS/ACCESS forRelational Databases). Cary, NC:SAS InstituteInc. SAS/ACCESS® 9.1.3 SupplementforDB2under z/OS(SAS/ACCESS forRelational Databases) Copyright ©2006,SAS Institute Inc.,Cary, NC,USA ISBN-13: 978-1-59047-805-9 ISBN-10: 1-59047-805-3 Allrights reserved. Producedinthe UnitedStates ofAmerica. For ahard-copybook: Nopart of this publicationmaybe reproduced, stored ina retrieval system, or transmitted,inanyformor byanymeans, electronic, mechanical, photocopying, orotherwise,without theprior writtenpermissionof thepublisher, SAS Institute Inc. For aWeb download ore-book: Your useofthis publicationshall be governed bythe terms establishedbythe vendor atthe time youacquirethis publication. U.S.Government RestrictedRights Notice. Use,duplication,or disclosureof this software andrelated documentation bythe U.S.governmentis subjectto theAgreement with SASInstitute andthe restrictions setforthinFAR 52.227–19CommercialComputer Software-RestrictedRights (June1987). SAS InstituteInc., SAS CampusDrive,Cary, NorthCarolina 27513. 1stprinting, February 2006 SAS Publishingprovidesa completeselectionofbooks andelectronicproducts to help customersuse SASsoftware toitsfullest potential. For moreinformation aboutour e-books,e-learning products,CDs,andhard-copybooks,visit theSASPublishingWebsite at support.sas.com/pubsor call1-800-727-3228. SAS®and allother SASInstituteInc. productorservicenamesareregistered trademarks or trademarksof SASInstitute Inc. intheUSA andother countries. ®indicates USA registration. Otherbrand and productnamesare registered trademarksor trademarksof their respective companies. Contents Chapter 1 (cid:0) SAS/ACCESS for DB2 under z/OS 1 Introduction to the SAS/ACCESS Interface to DB2 under z/OS 2 LIBNAME Statement Specifics for DB2 under z/OS 3 Data Set Options for DB2 under z/OS 5 Pass-Through Facility Specifics for DB2 under z/OS 6 Autopartitioning Scheme for DB2 under z/OS 7 Temporary Table Support for DB2 under z/OS 9 Calling Stored Procedures in DB2 under z/OS 11 ACCESS Procedure Specifics for DB2 under z/OS 13 DBLOAD Procedure Specifics for DB2 under z/OS 15 Passing Joins to DB2 under z/OS 17 The DB2EXT Procedure 17 The DB2UTIL Procedure 19 SAS System Options and Settings for DB2 under z/OS 24 Naming Conventions for DB2 under z/OS 27 Data Types for DB2 under z/OS 27 Maximizing DB2 under z/OS Performance 32 Locks in the DB2 under z/OS Interface 35 DB2 under z/OS Bulk Loading 36 Understanding DB2 under z/OS Client/Server Authorization 44 DB2 under z/OS Information for the Database Administrator 47 Appendix 1 (cid:0) Recommended Reading 51 Recommended Reading 51 Glossary 53 Index 59 iv 1 C H A P T E R 1 SAS/ACCESS for DB2 under z/OS IntroductiontotheSAS/ACCESSInterfacetoDB2underz/OS 2 LIBNAMEStatementSpecificsforDB2underz/OS 3 Arguments 3 DB2underz/OSLIBNAMEStatementExample 5 DataSetOptionsforDB2underz/OS 5 Pass-ThroughFacilitySpecificsforDB2underz/OS 6 Examples 6 AutopartitioningScheme forDB2underz/OS 7 Overview 7 AutopartitioningRestrictions 8 ColumnSelectionforMODPartitioning 8 HowWHEREClausesRestrictAutopartitioning 8 UsingDBSLICEPARM= 9 UsingDBSLICE= 9 TemporaryTable SupportforDB2underz/OS 9 EstablishingaTemporaryTable 9 TerminatingaTemporaryTable 9 Examples 10 CallingStored ProceduresinDB2underz/OS 11 Overview 11 Examples 11 BasicStoredProcedureCall 11 Stored ProcedureThatReturnsaResultSet 11 Stored ProcedureThatPassesParameters 11 Stored ProcedureThatPassesNULLParameter 12 Specifyingtheschemaforastoredprocedure 12 Executingremotestoredprocedures 13 ACCESSProcedureSpecificsforDB2underz/OS 13 Examples 14 DBLOADProcedureSpecificsforDB2underz/OS 15 Examples 16 PassingJoinstoDB2underz/OS 17 TheDB2EXTProcedure 17 Overview 17 Syntax 17 PROCDB2EXTStatementOptions 17 FMTStatement 18 RENAMEStatement 18 SELECTStatement 18 EXITStatement 18 Examples 19 2 IntroductiontotheSAS/ACCESSInterfacetoDB2underz/OS (cid:0) Chapter1 TheDB2UTIL Procedure 19 DB2UTILStatementsandOptions 20 PROCDB2UTILStatementsandOptions 20 MAPTOStatement 21 RESETStatement 21 SQLStatement 21 UPDATEStatement 22 WHEREStatement 22 ERRLIMITStatement 22 EXITStatement 22 ModifyingDB2Data 22 InsertingData 22 UpdatingData 22 DeletingData 23 PROCDB2UTILExample 23 SASSystemOptionsandSettingsforDB2underz/OS 24 SettingYourDB2SubsystemIdentifier 25 CapturingDB2ReturnCodesUsingSYSDBRC 26 NamingConventionsforDB2underz/OS 27 DataTypesforDB2underz/OS 27 StringData 27 NumericData 28 Dates,Times, andTimestamps 28 DB2NullandDefaultValues 29 LIBNAMEStatement DataConversions 30 ACCESSProcedureData Conversions 30 DBLOADProcedureDataConversions 31 MaximizingDB2underz/OSPerformance 32 OptimizingYour Connections 33 PassingSASFunctionstoDB2underz/OS 34 LocksintheDB2underz/OSInterface 35 DB2underz/OSBulkLoading 36 DataSetOptionsforBulkLoading 36 FileAllocationand NamingforBulkLoading 41 Examples 42 UnderstandingDB2underz/OSClient/ServerAuthorization 44 Non-LibrefConnections 46 KnownIssueswithRRSAFSupport 47 DB2underz/OSInformationfortheDatabaseAdministrator 47 HowtheInterfacetoDB2Works 48 HowandWhen ConnectionsAreMade 48 TheDistributedData Facility 49 DB2AttachmentFacilities(CAFandRRSAF) 49 AccessingtheDB2SystemCatalogs 50 Introduction to the SAS/ACCESS Interface to DB2 under z/OS This document describes the SAS/ACCESS interface to DB2 under z/OS. It includes details only about the SAS/ACCESS interface to DB2 under z/OS, and it should be used as a supplement to the main SAS/ACCESS documentation, SAS/ACCESS for Relational Databases: Reference. SAS/ACCESSforDB2underz/OS (cid:0) Arguments 3 Note: z/OS is the successor to the OS/390 operating system. SAS 9.1 for z/OS is supported on both OS/390 and z/OS operating systems and, throughout this document, any reference to z/OS also applies to OS/390, unless otherwise stated. (cid:0) LIBNAME Statement Specifics for DB2 under z/OS This section describes the LIBNAME statement as supported in the SAS/ACCESS interface to DB2 under z/OS. For a complete description of this feature, see the LIBNAME statement section in SAS/ACCESS for Relational Databases: Reference. The DB2 under z/OS specific syntax for the LIBNAME statement is: LIBNAME libref db2 <connection-options> <LIBNAME-options>; Arguments libref is any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views. db2 is the SAS/ACCESS engine name for the interface to DB2 under z/OS. connection-options provides connection information and control which database you are connecting to. The connection options for the interface to DB2 under z/OS are the following: SSID=DB2-subsystem-id specifies the DB2 subsystem ID to connect to at connection time. SSID= is optional. If you omit it, SAS connects to the DB2 subsystem that is specified in the SAS system option, DB2SSID=. The DB2 subsystem ID is limited to four characters. See “Setting Your DB2 Subsystem Identifier” on page 25 for more information. SERVER=DRDA-server specifies the DRDA server that you want to connect to. SERVER= enables you to access DRDA resources stored at remote locations. Check with your system administrator for system names. You can connect to only one server per LIBNAME statement. SERVER= is optional. If you omit it, you access tables from your local DB2 database, unless you have specified a value for the LOCATION= LIBNAME option. There is no default value for this option. For information about accessing a database server on Linux, UNIX, or Windows using a libref, see the REMOTE_DBTYPE= LIBNAME option. Note: Refer to the installation instructions for this interface for information about configuring SAS to use the SERVER= option. (cid:0) LIBNAME-options defines how DBMS objects are processed by SAS. Some LIBNAME options can enhance performance; others determine locking or naming behavior. The following table describes which LIBNAME options are supported for DB2 under z/OS, and presents default values where applicable. See the section about the SAS/ACCESS LIBNAME statement in SAS/ACCESS for Relational Databases: Reference for detailed information about these options. 4 Arguments (cid:0) Chapter1 Table 1.1 SAS/ACCESS LIBNAMEOptions Option DefaultValue ACCESS= none AUTHID= none CONNECTION= SHAREDREAD CONNECTION_GROUP= none DBCOMMIT= 1000 wheninsertingrows;0whenupdatingrows DBCONINIT= none DBCONTERM= none DBCREATE_TABLE_OPTS= none DBGEN_NAME= DBMS DBLIBINIT= none DBLIBTERM= none DBNULLKEYS= YES DBSASLABEL= COMPAT DBSLICEPARM= THREADED_APPS,2 DEFER= NO DEGREE= ANY DIRECT_EXE= none DIRECT_SQL= YES IN= none LOCATION= none MULTI_DATASRC_OPT= NONE PRESERVE_COL_NAMES= NO PRESERVE_TAB_NAMES= NO READ_ISOLATION_LEVEL= DB2z/OSdeterminestheisolationlevel READ_LOCK_TYPE= DB2z/OShandleslocking REMOTE_DBTYPE= ZOS REREAD_EXPOSURE= NO SCHEMA= youruserID SPOOL= YES UPDATE_ISOLATION_LEVEL= DB2z/OSdeterminestheisolationlevel SAS/ACCESSforDB2underz/OS (cid:0) DataSetOptionsforDB2underz/OS 5 Option DefaultValue UPDATE_LOCK_TYPE= DB2z/OS handleslocking UTILCONN_TRANSIENT= NO DB2 under z/OS LIBNAME Statement Example In the following example, the libref MYLIB uses the DB2 under z/OS interface to connect to the DB2 database that is specified by the SSID= option, with a connection to the testserver remote server. libname mylib db2 ssid=db2 authid=testuser server=testserver; proc print data=mylib.staff; where state=’CA’; run; Data Set Options for DB2 under z/OS The following list includes all of the SAS/ACCESS data set options that are supported for the DB2 under z/OS interface, except for the data set options that are available with the bulk load facility. Default values are provided where applicable. See the section on data set options in SAS/ACCESS for Relational Databases: Reference for detailed information about these options. Table 1.2 SAS/ACCESS Data SetOptionsforDB2 under z/OS Option DefaultValue AUTHID= currentLIBNAMEoptionsetting BULKLOAD= NO DBCOMMIT= currentLIBNAMEoptionsetting DBCONDITION= none DBCREATE_TABLE_OPTS= currentLIBNAMEoptionsetting DBFORCE= NO DBGEN_NAME= DBMS DBKEY= none DBLABEL= NO DBMASTER= none DBNULL= YES DBNULLKEYS= currentLIBNAMEoptionsetting DBSASLABEL= COMPAT DBSLICE= none DBSLICEPARM= THREADED_APPS,2 DBTYPE= none 6 Pass-ThroughFacilitySpecificsforDB2underz/OS (cid:0) Chapter1 Option DefaultValue ERRLIMIT= 1 IN= currentLIBNAME optionsetting LOCATION= currentLIBNAME optionsetting NULLCHAR= SAS NULLCHARVAL= ablankcharacter PRESERVE_COL_NAMES= currentLIBNAME optionsetting READ_ISOLATION_LEVEL= currentLIBNAME optionsetting READ_LOCK_TYPE= currentLIBNAME optionsetting TRAP_151= NO UPDATE_ISOLATION_LEVEL= currentLIBNAME optionsetting UPDATE_LOCK_TYPE= currentLIBNAME optionsetting Pass-Through Facility Specifics for DB2 under z/OS See the section about the Pass-Through Facility in SAS/ACCESS for Relational Databases: Reference for general information about this feature. The Pass-Through Facility specifics for DB2 under z/OS are as follows: (cid:0) The dbms-name is DB2. (cid:0) The CONNECT statement is optional. (cid:0) The interface supports connections to multiple databases. (cid:0) The CONNECT statement database-connection-arguments are as follows: SSID=DB2-subsystem-id specifies the DB2 subsystem ID to connect to at connection time. SSID= is optional. If you omit it, SAS connects to the DB2 subsystem that is specified in the SAS system option, DB2SSID=. The DB2 subsystem ID is limited to four characters. See “Setting Your DB2 Subsystem Identifier” on page 25 for more information. SERVER=DRDA-server specifies the DRDA server that you want to connect to. SERVER= enables you to access DRDA resources stored at remote locations. Check with your system administrator for system names. You can connect to only one server per LIBNAME statement. SERVER= is optional. If you omit it, you access tables from your local DB2 database unless you have specified a value for the LOCATION= LIBNAME option. There is no default value for this option. Note: Refer to the installation instructions for this interface for information about setting up DB2 z/OS to enable SAS to connect to the DRDA server when the SERVER= option is used. (cid:0) Examples The following example connects to DB2 and sends it two EXECUTE statements to process:

Description:
ISBN-13: 978-1-59047-805-9. ISBN-10: Introduction to the SAS/ACCESS Interface to DB2 under z/OS. 2 Capturing DB2 Return Codes Using SYSDBRC 26.
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.