Download SAS ACCESS 9.1 Interface to IMS: Reference PDF

TitleSAS ACCESS 9.1 Interface to IMS: Reference
LanguageEnglish
File Size2.1 MB
Total Pages313
Table of Contents
                            SAS ACCESS 9.1 Interface to IMS
	Cover
	What’s New
		Overview
	SAS/ACCESS Interface to IMS: Introduction
	Overview of the SAS/ACCESS Interface to IMS
		Introduction to the SAS/ACCESS Interface to IMS
		Purpose of the SAS/ACCESS Interface to IMS
		Using the SAS/ACCESS Interface to IMS
			How the IMS Engine and DATA Step Interfaces Differ
		SAS/ACCESS Descriptor Files for IMS
			Access Descriptor Files
			View Descriptor Files
		Executing SAS/ACCESS Programs in Batch Mode
			Executing a Cataloged Procedure
			DD Statements
		Executing SAS/ACCESS Programs under TSO
			Allocating Database Data Sets
		About the Example Data in the Document
			Running the Examples in This Document
	IMS Essentials
		Introduction to IMS Essentials
		The IMS DBMS
		Overview of IMS Databases
			Segment Occurrences
			Segment Relationships
			Path Navigation
			Fields
		Physical Databases and Program Views
			What You Need to Know to Create Descriptors
			Database Description
			Program Specification Block
		DL/I Calls
			DL/I Call Functions
			Program Communication Block
			Database Position
			Segment Search Arguments
			Multiple SSAs in the DATA Step Interface
			Command Codes
		IMS Execution Modes
			Outline of a Batch DL/I Subsystem
			Outline of an Online DL/I Subsystem
			Summary of Region Types
		Shared IMS Database Access
			General Considerations for Sharing Resources
			Database-Level Shared Access
			Block-Level Shared Access
	The IMS Engine Interface: Usage
	Defining SAS/ACCESS Descriptor Files
		Introduction to Defining SAS/ACCESS Descriptor Files
		SAS/ACCESS Descriptor Files Essentials
		Creating and Using Descriptor Files
			Creating Access and View Descriptors in One PROC Step
			Creating Access and View Descriptors in Separate PROC Steps
		Using View Descriptors in SAS Programs
			Printing Data
			Reviewing Variables
	IMS Data in SAS Programs
		Introduction to Using IMS Data in SAS Programs
		Charting IMS Data
		Calculating Statistics with IMS Data
			Calculating Statistics Using the FREQ Procedure
			Calculating Statistics Using the MEANS Procedure
			Calculating Statistics Using the RANK Procedure
		Selecting and Combining IMS Data
			Selecting and Combining Data Using the WHERE Statement
			Selecting and Combining Data Using the SAS SQL Procedure
		Updating a SAS Data File with IMS Data
			Example of VALIDVARNAME=V6
		Example of VALIDVARNAME=V7
	Browsing and Updating IMS Data
		Introduction to Browsing and Updating IMS Data
		Browsing and Updating IMS Data with SAS/FSP Procedures
			Browsing Data Using the FSBROWSE Procedure
			Updating Data Using the FSEDIT Procedure
			Browsing and Updating Data Using the FSVIEW Procedure
			Specifying a SAS WHERE Statement While Browsing or Updating Data
			Scrolling with SAS/FSP Procedures
			Inserting and Deleting Segments with SAS/FSP Procedures
		Browsing and Updating IMS Data with the SQL Procedure
			Retrieving and Updating Data with the SQL Procedure
			Inserting and Deleting Data with the SQL Procedure
			Updating Data with the MODIFY Statement
		Updating SAS Files with IMS Data
		Appending IMS Data with the APPEND Procedure
	SAS/ACCESS Interface to the IMS Engine: Reference
	ACCESS Procedure Reference
		Introduction to ACCESS Procedure Reference
		ACCESS Procedure Syntax for IMS
			Description
			PROC ACCESS Statement Options
		SAS Passwords for SAS/ACCESS Descriptors
			Assigning Passwords
		Invoking the ACCESS Procedure
			Database-Description Statements
			Editing Statements
		ACCESS Procedure Statements for IMS
		Tools for Creating IMS Access Descriptors
			COB2SAS Tool
			SAS Macro and DATA Step Code
		Performance and Efficient View Descriptors
			General Information
			Extracting Data Using a View
			Deciding How to Subset Your Data
			Writing Efficient WHERE Statements
			Identifying Inefficient SAS WHERE Conditions
			Identifying SAS WHERE Conditions That Are Not Acceptable to IMS
	Advanced User Topics for the SAS/ ACCESS Interface View Engine for IMS
		Introduction to Advanced Topics for the Interface View Engine
		Changing an IMS Database and the Effects on Descriptors
			Changes That Cause Existing View Descriptors to Fail
		Understanding Character Set Encoding
		Ensuring IMS Data Security
			IMS Security
			SAS Security
		Maximizing IMS Performance
		Understanding the IMS Interface
			Understanding the Flattened File Concept
			Handling Missing Values
			Handling Special Fields
			Using BY Variables
		IMS Engine Calls to the Database
			Data Retrieval
			Data Retrieval by Using a Secondary Index
			Data Modification Processing
	The IMS DATA Step Interface: Reference
	Overview of the IMS DATA Step Interface
		Introduction to the IMS DATA Step Interface
		Overview of the DATA Step Statement Extensions
			DL/I Input and Output Buffers
			An Introductory Example of a DATA Step Program
		Example of Using DATA Step Views
		The DL/I INFILE Statement
			PCB Selection Options
			Other DL/I INFILE Options
			Using the DL/I INFILE Statement
		The DL/I INPUT Statement
			Example 1: A Get Call
			Using the DL/I INPUT Statement
		The DL/I FILE Statement
		The DL/I PUT Statement
			Example 3: An Update Call
			Using the DL/I PUT Statement
		IMS DATA Step Examples
			Example 6: Issuing Path Calls
			Example 7: Updating Information in the CUSTOMER Segment
			Example 8: Using the Blank INPUT Statement
			Example 9: Using the Qualified SSA
	How to Use the IMS DATA Step Interface
		Introduction to Using the IMS DATA Step Interface
		OS/390 DL/I System Calls
		Fast Path DL/I Database Access
			FLD Call
			POS Call
		Non-Database Access Calls
			I/O PCBs
			TP PCBs
			Basic CHKP Call
			LOG Call
			ROLL Call
			ROLB Call
			IMS/ESA BMP System Calls
			IMS/ESA Message Queue Access
	Advanced Topics for the IMS DATA Step Interface
		Introduction to Advanced Topics for the IMS DATA Step Interface
		Restarting an Update Program
			Examples
		SSAs in IMS DATA Step Programs
			The Concatenation Operator
			The PUT Function
			Setting SSAs Conditionally
			Changing SSA Variable Values between Calls
	SAS System Options for IMS Databases
		Introduction to SAS System Options for IMS Databases
		Specifying System Options
			Restrictable Options
			Displaying the Current Values of the Options
			Overriding Option Defaults
		SAS System Options for IMS
			Detailed Reference for Options
		Quick Reference for Options
	Example Data
		Introduction to IMS Example Data
		Access Descriptors for IMS
			ACCTDBD Database Access Descriptor
			EMPLINF2 Database Access Descriptor
			WIRETRAN Database Access Descriptor
		View Descriptors Based on the Access Descriptors for IMS
			ACCTDBD Database View Descriptors
			EMPLINF2 Database View Descriptors
			WIRETRAN Database View Descriptor
		Creating SAS Data Sets for IMS
			MYDATA.BIRTHDAY Data Set
			MYDATA.CHECKS Data Set
			MYDATA.CHGDATA Data Set
			MYDATA.CHKCRED Data Set
			MYDATA.CHKDEBD Data Set
			MYDATA.EMPLDATA Data Set
			MYDATA.INITSEG Data Set
			MYDATA.PHONENUM Data Set
			MYDATA.SAVCRED Data Set
			MYDATA.SAVDEBD Data Set
			MYDATA.CUSTOMER Data Set
			MYDATA.NEWADDR Data Set
			VER6.SSNUMS Data Set
		SAS Statements for Loading DB2 Table BANKCHRG
			Creating SAS Data Set MYDATA.BANK
			Loading DB2 Table BANKCHRG from MYDATA.BANK
			DB2 View Descriptor for BANKCHRG
	Recommended Reading
		Recommended Reading
	Glossary
	Index
                        
Document Text Contents
Page 2

PTK_ÿ77777650_14_K_mac.eps


SAS/ACCESS
®

9.1 Interface to IMS
Reference

Page 156

Advanced User Topics Data Retrieval by Using a Secondary Index 147

� identify the index source segment type

� identify the index source segment fields that are used in creating a secondary
index.

One XDFLD statement is required for each secondary index relationship.

Combining Segments to Define Descriptors
This section lists ways in which target and source segments can be related and,

therefore, how you should define your descriptors in order to access the IMS data
through a secondary index.

� When the source segment and the target segment are the same, and the target
segment is the root segment the following is true:

The source segment supplies the field(s) values that comprise the secondary
index. The secondary index stores these values in order with other information
that specifies where the target segment is located for any value of the secondary
index.

The XDFLD statement contains the NAME= value that is used in the
SEARCH= argument, because doing so gives the secondary index the same name
as will be used in the application’s SSAs.

� When the source segment and the target segment are the same, and the target
segment is not the root segment the following is true:

The database is conceptually restructured. The DBA and the SAS applications
analyst or programmer lay out how the database will look conceptually. Physically,
the database is still the same. This causes the SAS application to access the data
by using the secondary index data structure of the database. For this case, in
addition to the scenario described in the first item of this list, the entire access
descriptor definition must describe the secondary index data structure and not the
primary structure.

� When the source segment and the target segment are not the same, and the target
segment is the root segment the following is true:

There is no secondary index data structure because the target segment is the
root segment. However, the target and source segments are separate segments in
the database.

In order for you to create an access descriptor using separate segments, you
must add a dummy field to the end of the root segment. This dummy field must
contain a length that matches the field(s) length for the target segment key value.
In addition, the SEGLNG value for the entire root segment must be increased in
the DBD to allow for this additional field. Any valid SAS name can be assigned to
this dummy field, but the SEARCH= value must be the XDFLD name for the field
from the DBD.

In essence, the dummy field is a virtual field in the access descriptor definition
for the root. It does not physically exist there, but a SAS application can submit
SSA references for the target (in this case the root) that is qualified on this field.

For example, consider a SAS application that uses the following WHERE
statement:

WHERE sasname EQ value

Sasname is the SAS variable name for the virtual field and value is a value for
the field in the source segment. The IMS engine properly builds a SSA for the
target (root) that is qualified by using the XDFLD name for the field and the value
from the WHERE clause.

Page 157

148 Data Modification Processing Chapter 7

� When the source segment and the target segment are not the same, and the target
segment is not the root the following is true:

This is the most complicated. It combines the scenarios described in the previous
two list items. The same dummy field must be added to the target segment as in
the previous list item. In addition, the entire access descriptor must map to or
define the secondary data structure that results from the target not being the root.

Data Modification Processing
Modifying a hierarchical database such as an IMS database can be complicated.

Therefore, you need to know how the IMS engine operates in order to perform database
modifications.

If you plan to use a view descriptor to update the database, the IMS engine requires
that you designate one search field as a key (that is, one key field) for each hierarchical
level in the database. You designate the key field when you create the access descriptor
on which the view descriptor is based. The key fields must be selected in the view
descriptor.

Note: The search field that you designate as the key must be defined in the DBD as
a key field; otherwise, updating results might be unpredictable. In addition, you cannot
skip hierarchical levels in a view descriptor that you want to use to update the
database. Because the IMS engine uses path calls to perform most updates, no ROLB
(ROLLBACK) calls are required. If a path call fails, the engine returns an error to SAS
and no update is performed. �

The engine, by default, issues checkpoints at the beginning and end of the update
process. You can use the AUTOSAVE option with SAS/FSP software to increase the
frequency of issuing checkpoints. Your update PSB must allow path call processing, and
an I/O PCB must be included for checkpoint calls.

The only time an update is performed with multiple DL/I calls is when you request
both an update and an insert. For example, you could use the FSEDIT procedure to
update a CUSTOMER segment and, on the same display, enter information to insert a
new CHCKACCT segment under the CUSTOMER parent segment you just modified. In
this case, if the insert call fails after the engine has processed the modification, the IMS
engine issues another update call that replaces the modified parent segment with the
original data in that segment. This process uses fewer resources than a ROLB call.
(See Chapter 9, “How to Use the IMS DATA Step Interface,” on page 197 for
information about ROLB and other non-database access calls.)

Delete Processing
You can delete only the lowest existing segment defined in the view descriptor.

CAUTION:
If you delete a segment that has children that are not defined in the view descriptor, the
children are also deleted. �

For example, if your view includes the CUSTOMER and CHCKACCT segments only
and you delete a CHCKACCT segment, any CHCKDEBT segments under CHCKACCT
are also deleted even though they are not defined in the view descriptor.

If your view descriptor includes all the hierarchical levels but a particular segment
has no children, the lowest existing segment is deleted. For example, if a CUSTOMER
segment occurrence has no CHCKDEBT segments under a CHCKACCT segment,
issuing the DELETE command deletes the CHCKACCT segment. If you then have only
a CUSTOMER segment and you issue the DELETE command, the CUSTOMER
segment is deleted.

Similer Documents