Download as pdf or txt
Download as pdf or txt
You are on page 1of 376

!

()+ OS 2200
Distributed Data
Processing (DDP-PPC)
OSI Interface COBOL
Programming
Guide

(
Copyright 1997 Unisys Corporation.
All rights reserved.
Unisys is a registered trademark of Unisys Corporation.

Level 7R1 September 1997

Printed in U S America
Priced Item 3787 3296-200
The names, places, and/or events used in this publication are not intended to correspond to any
individual, group, or association existing, living, or otherwise. Any similarity or likeness of the names,
places, and/or events with the names of any individual, living or otherwise, or that of any group or
association is purely coincidental and unintentional.

NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THE DOCUMENT. Any product and related
material disclosed herein are only furnished pursuant and subject to the terms and conditions of a duly
executed Program Product License or Agreement to purchase or lease equipment. The only warranties
made by Unisys, if any, with respect to the products described in this document are set forth in such
License or Agreement. Unisys cannot accept any financial or other responsibility that may be the result
of your use of the information in this document or software material, including direct, indirect, special,
or consequential damages.

You should be very careful to ensure that the use of this information and/or software material complies
with the laws, rules, and regulations of the jurisdictions with respect to which it is used.

The information contained herein is subject to change without notice. Revisions may be issued to advise
of such changes and/or additions.

RESTRICTED - Use, reproduction, or disclosure is subject to the restrictions set forth in DFARS
252.227-7013 and 252.11-15/FAR 52.227-14 and 52.227-19 for commercial computer software.

Correspondence regarding this publication should be forwarded to Unisys Corporation either by using
the Business Reply Mail form included with this document, or by addressing remarks to Unisys
Corporation, Tredyffrin/Malvern Product Information, Malvern Development Center, P.O. Box 203, Paoli,
PA, 19301, U.S.A. Comments about documentation can also be sent through e-mail to

aspgpi@unisys.com

All terms mentioned in this document that are known to be trademarks or service marks have been
appropriately capitalized. Unisys Corporation cannot attest to the accuracy of this information. Use of a
term in this document should not be regarded as affecting the validity of any trademark or service mark.
Contents

About This Guide : : : : :: : : : : : : : : : :: : : : : : : : : :: : : : : : : : : : :: : : : : : : : : xv

Section 1. Introduction

1.1. Open System Networking : : : : : : : : : : : : : : : : : : : : : : 1-1


1.1.1. The Open Systems Interconnection (OSI) Reference
Model : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1-1
1.1.2. DDP-PPC and the OSI Model : : : : : : : :: : : : : : : : : 1-3
1.1.3. DDP-PPC and the OSI Interface : : : : : : : : : : : : : : : 1-5
Session Layer Services : : : : : : : : : : : : : : : : : : : 1-5
Application Layer Services : : : : : : :: : : : : : : : : 1-6
1.2. Overview of Program-to-Program Applications : : : 1-7
1.3. DDP-PPC COBOL Interface : : : : : : : : : : : : : : : : : : : : : 1-8

Section 2. Procedural Overview

2.1. COBOL Program Structure : : : : : : : : : : :: : : : : : : : : 2-1


2.2. DDP-PPC Function Call Formats : : : : : : : : : : : : : : : : 2-2
2.2.1. OSI Functions, COBOL Function Calls, and COPY
Verbs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2-3
2.2.2. DDP-PPC/OSI Data Packets : : : : : : : : : : : : : : : : : : 2-4
2.3. Copying Data Packets into the Data Division : : : : : 2-6
2.4. Message Buffer Area : : : : :: : : : : : : : : : :: : : : : : : : : 2-7
2.5. Message Size and Segmentation Considerations : : 2-8
2.6. Copying Function Calls into the Procedure Division 2-9

Section 3. DDP-PPC/OSI Function Calls

3.1. Aborting a Conversation (OSI$ABORT) : :: : : : : : : : : 3-1


3.1.1. OSI$ABORT Format : : : : : : : : : : : : : : : : : : : : : : : : 3-2
3.1.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-3
3.1.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-4
3.1.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-5

3787 3296-200 iii


Contents

3.1.5. OSI-APPL-PRES-PKT : : : : : : : : :: : : : : : : : : :: : : : : 3-7


3.1.6. OSI$ABORT Example - Send with No Message : : : 3-8
3.1.7. OSI$ABORT Example - Send with Message :: : : : : 3-9
3.2. Initiating an Activity (OSI$ACTMGT) : : : : : : : :: : : : : 3-11
3.2.1. OSI$ACTMGT Format : : : : : : : : : : : : : : : : : : : : : : : 3-11
3.2.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-12
3.2.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-13
3.2.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-14
3.2.5. OSI-ACTIVITY-PKT : : : : : : : : : : : : : : : : : : : : : : : : : : 3-17
3.2.6. OSI$ACTMGT Example - Send with No Message : : 3-24
3.2.7. OSI$ACTMGT Example - Send with Message : : : : : 3-25
3.3. Registering an Application Program with the
DDP-PPC/OSI Network (OSI$BIND) : : : : : : : : : : : 3-26
3.3.1. OSI$BIND Format : : : : : : : : : : :: : : : : : : : : :: : : : : 3-26
3.3.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-27
3.3.3. OSI-REGISTER-PKT : : : : : : : : : :: : : : : : : : : :: : : : : 3-28
3.3.4. OSI$BIND Example : : : : : : : : :: : : : : : : : : :: : : : : 3-29
3.3.5. OSI$BIND Example (TIP-Called Session Selector
Format) : : : : :: : : : : : : : : :: : : : : : : : : : :: : : : 3-29
3.4. Closing a Conversation (OSI$CLOSE) : : : : : : :: : : : : 3-30
3.4.1. OSI$CLOSE Format : : : : : : : : : : : : : : : : : : : : : : : : 3-30
3.4.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-31
3.4.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-32
3.4.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-33
3.4.5. OSI$CLOSE Example - Send with No Message : : : 3-35
3.4.6. OSI$CLOSE Example - Send with Message :: : : : : 3-36
3.5. Accepting a Close Request (OSI$CLRESP) : :: : : : : 3-37
3.5.1. OSI$CLRESP Format : : : : : : : : : : : : : : : : : : : : : : : 3-37
3.5.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-38
3.5.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-39
3.5.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-40
3.5.5. OSI$CLRESP Example - Send with No Message : : 3-42
3.5.6. OSI$CLRESP Example - Send with Message : : : : : 3-43
3.6. Sending Capability Data (OSI$CPDATA) : : : : :: : : : : 3-44
3.6.1. OSI$CPDATA Format : : : : : : : : : : : : : : : : : : : : : : : 3-44
3.6.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-45
3.6.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-46
3.6.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-47
3.6.5. OSI$CPDATA Example - Send with No Message : : 3-50
3.6.6. OSI$CPDATA Example - Send with Message : : : : : 3-51

iv 3787 3296-200
Contents

3.7. Sending a Response to Capability Data Received


(OSI$CPRESP) : : : : : : : : :: : : : : : : : : : :: : : : : : : : 3-52
3.7.1. OSI$CPRESP Format : : : : : : : : : : : : : : : : : : : : : : : 3-52
3.7.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-53
3.7.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-54
3.7.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-55
3.7.5. OSI$CPRESP Example - Send with No Message : : 3-58
3.7.6. OSI$CPRESP Example - Send with Message : : : : : 3-59
3.8. Creating a New DDP-PPC Dump File (OSI$DUMP) : 3-60
3.8.1. OSI$DUMP Format : : : : :: : : : : : : : : : :: : : : : : : : : 3-60
3.8.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-61
3.8.3. OSI$DUMP Example : : : :: : : : : : : : : : :: : : : : : : : : 3-61
3.9. Passing Control to a Peer Host (OSI$GVCNTRL) : : 3-62
3.9.1. OSI$GVCNTRL Format : : : : : : : : : : : : : : : : : : : : : : 3-62
3.9.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-63
3.9.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-64
3.9.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-65
3.9.5. OSI$GVCNTRL Example - Send with No Message : 3-68
3.9.6. OSI$GVCNTRL Example - Send with Message : : : : 3-69
3.10. Passing Tokens to a Peer Host (OSI$GVTOKEN) : : 3-70
3.10.1. OSI$GVTOKEN Format : : : : : : : : : : : : : : : : : : : : : : 3-70
3.10.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-71
3.10.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-72
3.10.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-73
3.10.5. OSI$GVTOKEN Example - Send with No Message : 3-76
3.10.6. OSI$GVTOKEN Example - Send with Message : : : : 3-77
3.11. Opening a Conversation (OSI$OPEN) : : :: : : : : : : : : 3-78
3.11.1. OSI$OPEN Format : : : : : : : : : : : : : : : : : : : : : : : : : 3-78
3.11.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-79
3.11.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-80
3.11.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-81
3.11.5. OSI-CONNECT-PKT : : : : : : : : : : : : : : : : : : : : : : : : : 3-85
3.11.6. OSI-APPL-PRES-PKT : : : : : : : : : : : : : : : : : : : : : : : : 3-92
3.11.7. Additional Information for the Application
Presentation Packet : : : : : : : : : : : : : : : : : : : : : 3-95
3.11.8. OSI-ADDRESS-PKT : : : : : : : : : : : : : : : : : : : : : : : : : 3-98
3.11.9. OSI$OPEN Example - Send with No Message : : : : 3-106
3.11.10. OSI$OPEN Example - Send with Message : : : : : : : 3-108
3.12. Accepting or Rejecting an Open Request
(OSI$OPRESP) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-110
3.12.1. OSI$OPRESP Format : : :: : : : : : : : : : :: : : : : : : : : 3-110

3787 3296-200 v
Contents

3.12.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-111


3.12.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-112
3.12.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-113
3.12.5. OSI-CONNECT-PKT : : : : : : : : : : : : : : : : : : : : : : : : : 3-116
3.12.6. OSI-APPL-PRES-PKT : : : : : : : : : : : : : : : : : : : : : : : : 3-124
3.12.7. Additional Information for the Application
Presentation Packet : : : : : : : : : : : : : : : : : : : : : 3-129
Presentation Context Information : : : : : : : : : : : 3-129
Application Context Information : : : : : : : : : : : : : 3-130
3.12.8. OSI-ADDRESS-PKT : : : : : : : : : : : : : : : : : : : : : : : : : 3-131
3.12.9. OSI$OPRESP Example - Send with No Message : : 3-133
3.12.10. OSI$OPRESP Example - Send with Message : : : : : 3-135
3.13. Requesting Tokens from a Peer Host
(OSI$PLTOKEN) : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-137
3.13.1. OSI$PLTOKEN Format : : : : : : : : : : : : : : : : : : : : : : 3-137
3.13.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-138
3.13.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-139
3.13.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-140
3.13.5. OSI$PLTOKEN Example - Send with No Message : 3-143
3.13.6. OSI$PLTOKEN Example - Send with Message : : : : 3-144
3.14. Receiving a Message from a Peer Program
(OSI$RECEIVE) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-145
3.14.1. OSI$RECEIVE General Format : : : : : : : : : : : : : : : : 3-145
3.14.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-147
3.14.3. Receive New Format : : : : : : : : : : : : : : : : : : : : : : : 3-148
OSI-STATUS-PKT (Receive New Format) : : : : : : 3-148
OSI-MSG-BUFFER Area (Receive New Format) : : 3-148
OSI-DATA-PKT (Receive New Format) : : :: : : : : 3-150
OSI-CONNECT-PKT (Receive New Format) : : : : : 3-153
OSI-APPL-PRES-PKT (Receive New Format) : : : : 3-156
OSI-ADDRESS-PKT (Receive New Format) : : : : : 3-159
OSI-RCV-PKT (Receive New Format) : : : :: : : : : 3-164
3.14.4. Receive Open Response Format : : : : : : : : : : : : : : 3-165
OSI-STATUS-PKT (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-165
OSI-MSG-BUFFER Area (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-165
OSI-DATA-PKT (Receive Open Response Format) 3-167
OSI-CONNECT-PKT (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-170
OSI-APPL-PRES-PKT (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-174

vi 3787 3296-200
Contents

OSI-ADDRESS-PKT (Receive Open Response


Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-180
OSI-RCV-PKT (Receive Open Response Format) 3-182
3.14.5. Receive Existing Format : : : : : : : : : : :: : : : : : : : : 3-183
OSI-STATUS-PKT (Receive Existing Format) : : : 3-183
OSI-MSG-BUFFER Area (Receive Existing
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-183
OSI-DATA-PKT (Receive Existing Format) : : : : : : 3-186
OSI-APPL-PRES-PKT (Receive Existing Format) : 3-193
OSI-RCV-PKT (Receive Existing Format) : : : : : : : 3-194
OSI-SYNC-PKT (Receive Existing Format) : : : : : 3-197
OSI-ACTIVITY-PKT (Receive Existing Format) : : : 3-198
OSI-RESYNC-PKT (Receive Existing Format) : : : 3-201
3.14.6. OSI$RECEIVE (Receive New Format) Example : : : : 3-202
3.14.7. OSI$RECEIVE (Receive Open Response and Receive
Existing Formats) Example : : : : : : : : : : : : : : : : 3-203
3.15. Resynchronizing a Connection (OSI$RESYNC) : : : : 3-204
3.15.1. OSI$RESYNC Format : : : : : : : : : : : : : : : : : : : : : : : 3-204
3.15.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-205
3.15.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-206
3.15.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-207
3.15.5. OSI-RESYNC-PKT : : : : : : : : : : : : : : : : : : : : : : : : : : 3-211
3.15.6. OSI$RESYNC Example - Send with No Message : : 3-214
3.15.7. OSI$RESYNC Example - Send with Message : : : : : 3-215
3.16. Sending Normal Data (OSI$SEND) : : : : :: : : : : : : : : 3-216
3.16.1. OSI$SEND Format : : : : : : : : : : : : : : : : : : : : : : : : : 3-216
3.16.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-217
3.16.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-218
3.16.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-219
3.16.5. OSI$SEND Example : : : :: : : : : : : : : : :: : : : : : : : : 3-222
3.17. Setting Synchronization Points (OSI$SYNC) : : : : : : 3-223
3.17.1. OSI$SYNC Format : : : : : : : : : : : : : : : : : : : : : : : : : 3-223
3.17.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-224
3.17.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-225
3.17.4. OSI-DATA-PKT : : : : : : : :: : : : : : : : : : :: : : : : : : : : 3-226
3.17.5. OSI-SYNC-PKT : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-229
3.17.6. OSI$SYNC Example - Send with No Message : : : : 3-232
3.17.7. OSI$SYNC Example - Send with Message : : : : : : : 3-233
3.18. Sending Typed Data (OSI$TPDATA) : : : :: : : : : : : : : 3-234
3.18.1. OSI$TPDATA Format : : : : : : : : : : : : : : : : : : : : : : : 3-234
3.18.2. OSI-STATUS-PKT : : : : : :: : : : : : : : : : :: : : : : : : : : 3-235
3.18.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-236

3787 3296-200 vii


Contents

3.18.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-237


3.18.5. OSI$TPDATA Example : : : : : : : : : : : : : : : : : : : : : : 3-240
3.19. Deregistering an Application Program from the
DDP-PPC Network (OSI$UNBIND) : : : : : : : : : : : : 3-241
3.19.1. OSI$UNBIND Format : : : : : : : : : : : : : : : : : : : : : : : 3-241
3.19.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-242
3.19.3. OSI$UNBIND Example : : : : : : :: : : : : : : : : :: : : : : 3-242
3.20. Reporting Errors without Aborting (OSI$XRPT) : : : : 3-243
3.20.1. OSI$XRPT Format : : : : : : : : : :: : : : : : : : : :: : : : : 3-243
3.20.2. OSI-STATUS-PKT : : : : : : : : : : :: : : : : : : : : :: : : : : 3-244
3.20.3. OSI-MSG-BUFFER Area : : : : : : : : : : : : : : : : : : : : : : 3-245
3.20.4. OSI-DATA-PKT : :: : : : : : : : : : :: : : : : : : : : :: : : : : 3-246
3.20.5. OSI$XRPT Example - Send with No Message : : : : : 3-249
3.20.6. OSI$XRPT Example - Send with Message : :: : : : : 3-250

Section 4. Writing Application Programs

4.1. Sample Program Flow Design : : : : : : : : : : : : : : : : : : 4-1


4.2. Automatic Scheduling : : : : : : : : : : : : : : : : : : : : : : : : : 4-5
4.2.1. Automatic Scheduling of Batch Programs : : : : : : : 4-5
4.2.2. Automatic Scheduling of TIP Transactions : : : : : : : 4-8
Method 1: Referencing a PROGRAM Record : : : 4-9
Method 2: Defining the Transaction Using the TIP$
Called Session Selector Format : : : : :: : : : 4-11

Section 5. Compiling, Collecting, and Executing DDP-PPC


COBOL Application Programs

5.1. Preparing Programs for Execution : : : : : : : : : : : : : : 5-1


5.2. The Runstream for an ASCII COBOL
Program-to-Program Application : : : : : : : : : : : : 5-3
5.3. The Runstream for a UCS COBOL
Program-to-Program Application : : : : : : : : : : : : 5-4
5.4. Multi-Activity and Banking Considerations : :: : : : : 5-5
5.4.1. UCS COBOL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5-5
5.4.2. ASCII COBOL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5-5

Appendix A. Data Packets

A.1. ACTIVITY Packet : : :: : : : : : : : : : :: : : : : : : : : :: : : : : A-1


A.2. ADDRESS Packet : : :: : : : : : : : : : :: : : : : : : : : :: : : : : A-2

viii 3787 3296-200


Contents

A.3. APPLICATION PRESENTATION Packet : : : : : : : : : : : A-4


A.4. CONNECT Packet : : : : : : : :: : : : : : : : : : :: : : : : : : : : A-6
A.5. DATA Packet : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : A-8
A.6. RECEIVE Packet : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : A-9
A.7. REGISTER Packet : : : : : : : : : : : : : : : : : : : : : : : : : : : : : A-10
A.8. RESYNCHRONIZATION Packet : : : : : : : :: : : : : : : : : A-11
A.9. STATUS Packet : : : : : : : : : :: : : : : : : : : : :: : : : : : : : : A-12
A.10. SYNCHRONIZATION Packet : : : : : : : : : : : : : : : : : : : : A-13

Appendix B. DDP-PPC/OSI Sample Programs

B.1. ACOB Session-level Entry Primary Program


Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-3
B.2. UCOB Session-level Primary Program Runstream B-4
B.3. Session-level Entry Primary Program : : : : : : : : : : : B-5
B.4. ACOB Session-level Entry Secondary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-15
B.5. UCOB Session-level Entry Secondary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-16
B.6. Session-level Entry Secondary Program : : : : : : : : B-17
B.7. ACOB Application-level Entry Primary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-26
B.8. UCOB Application-level Entry Primary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-27
B.9. Application-level Entry Primary Program : : : : : : : : B-28
B.10. ACOB Application-level Entry Secondary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-39
B.11. UCOB Application-level Entry Secondary Program
Runstream :: : : : : : : : : : :: : : : : : : : : : :: : : : : : : : B-40
B.12. Application-level Entry Secondary Program : : : : : B-41

Appendix C. DDP-PPC/OSI and ISO/OSI Cross-Reference

Glossary

Bibliography

3787 3296-200 ix
Figures

1-1. The OSI Reference Model : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1-2


1-2. DDP-PPC in an OSI Network : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1-3
1-3. DDP-PPC and Transport Services : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1-4
1-4. DDP-PPC COBOL Program-to-Program Facility : : : : : : : : : : : : : : : : : : : : : : 1-7

2-1. DDP-PPC COBOL Program Working Storage Section : : : : : : : :: : : : : : : : : 2-6

4-1. Typical COBOL DDP-PPC Block Diagram : : : : : : : : : : : : : : : : : : : : : : : : : : 4-2


4-2. Automatic Scheduling of a Batch Program : : : :: : : : : : : : : : :: : : : : : : : : 4-7
4-3. Scheduling a TIP Program by Referencing an APPLICATION ENTITY
Record : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 4-10
4-4. Scheduling a TIP Transaction Using the TIP$ Format : : : : : : :: : : : : : : : : 4-12

5-1. Runstream to Compile, Collect, and Execute an ASCII COBOL


Program-to-Program Application : : : : : : : : : :: : : : : : : : : : :: : : : : : : : 5-3
5-2. Runstream to Compile and Execute a UCS COBOL Program-to-Program
Application : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5-4

3787 3296-200 xi
Tables

2-1. OSI Functions and Their Associated DDP-PPC COBOL Function Calls : : : : 2-3
2-2. DDP-PPC COBOL Function Calls and Their Associated Data Packets : : : : 2-4

3-1. OSI-STATUS-PKT Parameters for OSI$ABORT : : : : : : : : : : : : : : : : : : : : : : 3-3


3-2. OSI-DATA-PKT Parameters for OSI$ABORT : : : : : : : : : : : : : : : : : : : : : : : : 3-5
3-3. OSI-APPL-PRES-PKT Parameters for OSI$ABORT : : : : : : : : : : : : : : : : : : : : 3-7
3-4. OSI-STATUS-PKT Parameters for OSI$ACTMGT : : : : : : : : : : : : : : : : : : : : : 3-12
3-5. OSI-DATA-PKT Parameters for OSI$ACTMGT : : : : : : : : : : : : : : : : : : : : : : : 3-14
3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT : : : : : : : : : : : : : : : : : : : : 3-17
3-7. OSI-STATUS-PKT Parameters for OSI$BIND : : : : : : : : : : : : : : : : : : : : : : : : 3-27
3-8. OSI-REGISTER-PKT Parameters for OSI$BIND : : : : : : : : : : : : : : : : : : : : : : 3-28
3-9. OSI-STATUS-PKT Parameters for OSI$CLOSE : : : : : : : : : : : : : : : : : : : : : : 3-31
3-10. OSI-DATA-PKT Parameters for OSI$CLOSE : : : : : : : : : : : : : : : : : : : : : : : : 3-33
3-11. OSI-STATUS-PKT Parameters for OSI$CLRESP : : : : : : : : : : : : : : : : : : : : : 3-38
3-12. OSI-DATA-PKT Parameters for OSI$CLRESP : : :: : : : : : : : : : :: : : : : : : : : 3-40
3-13. OSI-STATUS-PKT Parameters for OSI$CPDATA : : : : : : : : : : : : : : : : : : : : : 3-45
3-14. OSI-DATA-PKT Parameters for OSI$CPDATA : : : : : : : : : : : : : : : : : : : : : : : 3-47
3-15. OSI-STATUS-PKT Parameters for OSI$CPRESP : : : : : : : : : : : : : : : : : : : : : 3-53
3-16. OSI-DATA-PKT Parameters for OSI$CPRESP : : : : : : : : : : : : : : : : : : : : : : : 3-55
3-17. OSI-STATUS-PKT Parameters for OSI$DUMP : : : : : : : : : : : : : : : : : : : : : : : 3-61
3-18. OSI-STATUS-PKT Parameters for OSI$GVCNTRL : : : : : : : : : : : : : : : : : : : : 3-63
3-19. OSI-DATA-PKT Parameters for OSI$GVCNTRL : : : : : : : : : : : : : : : : : : : : : : 3-65
3-20. OSI-STATUS-PKT Parameters for OSI$GVTOKEN : : : : : : : : : : : : : : : : : : : : 3-71
3-21. OSI-DATA-PKT Parameters for OSI$GVTOKEN : : : : : : : : : : : : : : : : : : : : : : 3-73
3-22. OSI-STATUS-PKT Parameters for OSI$OPEN : : : : : : : : : : : : : : : : : : : : : : : 3-79
3-23. OSI-DATA-PKT Parameters for OSI$OPEN : : : : : : : : : : : : : : : : : : : : : : : : : 3-81
3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN :: : : : : : : : : : :: : : : : : : : : 3-85
3-25. Alternate Class Transports : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-91
3-26. OSI-APPL-PRES-PKT Parameters for OSI$OPEN : : : : : : : : : : : : : : : : : : : : : 3-92
3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN : : : : : : : : : : : : : : : : : : : : : : 3-98
3-28. OSI-STATUS-PKT Parameters for OSI$OPRESP : : : : : : : : : : : : : : : : : : : : : 3-111
3-29. OSI-DATA-PKT Parameters for OSI$OPRESP : : : : : : : : : : : : : : : : : : : : : : : 3-113
3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP : : : : : : : : : :: : : : : : : : : 3-116
3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP : : : : : : : : : : : : : : : : : : : 3-124
3-32. OSI-ADDRESS-PKT Parameters for OSI$OPRESP : : : : : : : : : : : : : : : : : : : : 3-131
3-33. OSI-STATUS-PKT Parameters for OSI$PLTOKEN : : : : : : : : : : : : : : : : : : : : 3-138
3-34. OSI-DATA-PKT Parameters for OSI$PLTOKEN : : : : : : : : : : : : : : : : : : : : : : 3-140
3-35. OSI-STATUS-PKT Parameters for OSI$RECEIVE : : : : : : : : : : : : : : : : : : : : : 3-147
3-36. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive New Format) : : : : : 3-150
3-37. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive New Format) : 3-153
3-38. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive New Format) : 3-156
3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format) : : 3-159

3787 3296-200 xiii


Tables

3-40. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive New Format) : : : : : : 3-164


3-41. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-167
3-42. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-170
3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-174
3-44. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-180
3-45. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Open Response
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-182
3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format) : : 3-186
3-47. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Existing
Format) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3-193
3-48. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Existing Format) : : : 3-194
3-49. OSI-SYNC-PKT Parameters for OSI$RECEIVE (Receive Existing Format) : : 3-197
3-50. OSI-ACTIVITY-PKT Parameters for OSI$RECEIVE (Receive Existing Format) 3-198
3-51. OSI-RESYNC-PKT Parameters for OSI$RECEIVE (Receive Existing Format) 3-201
3-52. OSI-STATUS-PKT Parameters for OSI$RESYNC : : : : : : : : : : : : : : : : : : : : : 3-205
3-53. OSI-DATA-PKT Parameters for OSI$RESYNC : : : : : : : : : : : : : : : : : : : : : : : 3-207
3-54. OSI-RESYNC-PKT Parameters for OSI$RESYNC : : : : : : : : : : : : : : : : : : : : : 3-211
3-55. OSI-STATUS-PKT Parameters for OSI$SEND : : : : : : : : : : : : : : : : : : : : : : : 3-217
3-56. OSI-DATA-PKT Parameters for OSI$SEND : : : : : : : : : : : : : : : : : : : : : : : : : 3-219
3-57. OSI-STATUS-PKT Parameters for OSI$SYNC : : : : : : : : : : : : : : : : : : : : : : : 3-224
3-58. OSI-DATA-PKT Parameters for OSI$SYNC : : : : : : : : : : : : : : : : : : : : : : : : : 3-226
3-59. OSI-SYNC-PKT Parameters for OSI$SYNC : : : : : : : : : : : : : : : : : : : : : : : : : 3-229
3-60. OSI-STATUS-PKT Parameters for OSI$TPDATA : : : : : : : : : : : : : : : : : : : : : 3-235
3-61. OSI-DATA-PKT Parameters for OSI$TPDATA : : : : : : : :: : : : : : : : : :: : : : : 3-237
3-62. OSI-STATUS-PKT Parameters for OSI$UNBIND : : : : : :: : : : : : : : : :: : : : : 3-242
3-63. OSI-STATUS-PKT Parameters for OSI$XRPT : : : : : : : :: : : : : : : : : :: : : : : 3-244
3-64. OSI-DATA-PKT Parameters for OSI$XRPT : : : : : : : : : : : : : : : : : : : : : : : : : : 3-246

B-1. Conversion Coding from Session Entry to Application Entry : : : : : :: : : : : B-2

C-1. Relationship between DDP-PPC and OSI Services : : : : : : : : : : : : : : : : : : : C-1


C-2. Relationship between OSI Services and DDP-PPC : : : : : : : : : : : : : : : : : : : C-2
C-3. Relationship between OSI Parameters and DDP-PPC COBOL Fields : : : : : C-2

xiv 3787 3296-200


About This Guide

This guide is one of a series designed to instruct and guide you in using Unisys Distributed
Data Processing Program-to-Program Communications (DDP-PPC) in an Open Systems
Interconnection (OSI) network. The DDP-PPC OSI interface lets users write
program-to-program COBOL application programs in a network that adheres to OSI
standards. ASCII or Universal Compiling System (UCS) COBOL program-to-program
applications can exchange data in batch, demand, or transaction processing (TIP)
environments with similar programs in the same or in remote systems in an OSI network.

Purpose
The purpose of this guide is to instruct an applications programmer how to:

$ Use a Unisys-supplied COBOL copy library to insert DDP-PPC/OSI COBOL interface


pre-written data packets and function calls into a COBOL application program.
$ Write a COBOL application program using the DDP-PPC/OSI COBOL interface data
packets and function calls.
$ Compile the program.
$ For ASCII COBOL:
v Collect (map) the application element and DDP-PPC relocatable element as one
absolute element.
v Execute a run of the absolute element.
$ For UCS COBOL:
v Link the application object module with the DDP-PPC-supplied object module.
v Execute a run of the object module.

Scope
This guide provides detailed information on DDP-PPC/OSI COBOL function calls and data
packets. It describes how to organize the calls and packets so users can write customized
COBOL applications that can exchange data between programs in the same or on remote
nodes of a multihost OSI network.

3787 3296-200 xv
About This Guide

Audience
This person is typically a COBOL programmer with several years of experience in the
language. He or she must have a thorough background in communications, as well as a
working knowledge of the session service definition.

If this person will be writing applications using the application-layer service entry, rather
than the session-layer service entry, then he or she must also have a working knowledge of
the presentation service definition and the Association Control Service Element (ACSE)
service definition. This person must also be able to encode user data as defined by the
presentation protocol specification and user information as defined by the ACSE protocol
specification using the Basic Encoding Rules for Abstract Syntax Notation One (ASN.1).

Prerequisites
To understand this guide, you must know the COBOL programming language as well as the
open systems interconnection services and protocol as described in the International
Standards Organization (ISO) documents listed in the Bibliography.

How to Use This Guide


Programmers should use this guide to learn how to design and construct
program-to-program applications in an OSI environment. The guide shows you how to use
COBOL COPY verbs and function calls to insert and set information packets in your
program. Use this guide also to learn how to compile, link, and execute the application
program.

Organization
Section 1. Introduction

Explains open systems interconnection and how DDP-PPC supports an OSI interface.
Describes what you can do with a DDP-PPC/OSI COBOL application. Gives an overview of
how to write a DDP-PPC COBOL program for the OSI interface. Discusses interaction with
communications elements.

Section 2. Procedural Overview

Describes the structure of a DDP-PPC COBOL application program used in an OSI


environment.

Section 3. DDP-PPC/OSI Function Calls

Describes, in alphabetical order, each of the DDP-PPC/OSI COBOL function calls and its
associated data packets.

xvi 3787 3296-200


About This Guide

Section 4. Writing Application Programs

Discusses how to design and construct OSI application programs that can transfer data
between programs in the same or remote hosts in an OSI environment using COBOL
function calls. Also describes how to schedule batch runs and TIP transactions to run
automatically.

Section 5. Compiling, Collecting, and Executing DDP-PPC COBOL Application


Programs

Describes the executive control language (ECL) runstream to compile, collect (map), and
execute the DDP-PPC/OSI COBOL programs.

Appendix A. Data Packets

Contains the data packets and values to be copied into the working-storage section of the
application program.

Appendix B. DDP-PPC/OSI Sample Programs

Contains a working example of a DDP-PPC application.

Appendix C. DDP-PPC/OSI and ISO/OSI Cross-Reference

Shows the relationship between the DDP-PPC/OSI functions and the OSI services invoked.

Related Product Information


Note: For all manuals, use the version that corresponds to the release level of the product
software in use on the system.

OS 1100 ASCII COBOL Programming Reference Manual (UP-8582)


Describes the syntax and structure for writing symbolic (source) language ASCII COBOL
statements and how to combine them into subroutines for ASCII COBOL programs.

OS 2200 Distributed Data Processing (DDP-PPC/DDP-FJT) Messages Reference


Manual (3787 3528)
This document lists and explains messages and program error codes for DDP-PPC.

OS 2200 Distributed Data Processing Program to Program Communications


(DDP-PPC) Implementation and Administration Guide (3787 3270)
This manual describes how to configure DDP-PPC, Communications Management System
(CMS 1100) software, and Telcon software for a DDP-PPC network. It also describes how
to collect, log, trace, and dump information that can help Unisys support personnel
diagnose a problem reported in a user communication form (UCF).

3787 3296-200 xvii


About This Guide

OS 2200 Universal Compiling System (UCS) COBOL Programming Reference


Manual, Volume 1: COBOL Statements (7831 0448)
Describes the syntax and structure for writing symbolic (source) language UCS COBOL
statements and how to combine them into subroutines for UCS-compiled COBOL
programs.

OS 2200 Universal Compiling System (UCS) COBOL Programming Reference


Manual, Volume 2: Compiler and Library Information (7831 0455)
Describes how to compile UCS COBOL programs.

New Features and Changes


This release provides the following enhancements and changes:

$ Changes to the considerations and limitations for D-Bank address ranges and
multi-activity programs.
$ A new parameter in the OSI-ADDRESS-PKT that can be used for the OSI$OPEN
function.

xviii 3787 3296-200


Section 1
Introduction

The Distributed Data Processing Program-to-Program/Open Systems Interconnection


(DDP-PPC/OSI) COBOL interface enables the exchange of data between programs in the
same or remote hosts in an OSI network. This interface permits communication between
any computer systems that use the international standards for OSI and also provide a
user-callable program application or session layer interface.

This section provides an overview of:

$ Open System Networking, including the OSI Reference Model


$ Program-to-program applications
$ The DDP-PPC COBOL interface

1.1. Open System Networking


Communication networks that interconnect systems having different architectures are
possible because the manufacturers of these systems have agreed to adhere to a set of
standards. As communication networks have become commonplace, national and
international organizations have recognized the need to establish such standards to allow a
cooperative exchange of information in open system networks.

1.1.1. The Open Systems Interconnection (OSI) Reference Model


Although systems from various manufacturers may have different architectures, all
communication systems perform the same functions. By looking at the functions
performed rather than their implementation, you can more easily understand how
DDP-PPC fits into the OSI network.

International standards for open system networking are based on the OSI reference model,
a conceptual model for a communications network developed by the International
Standards Organization (ISO).

This model represents each system in a network as a logical series of seven functional
layers (see Figure 1-1). Each layer interfaces with the layer below and the layer above.

3787 3296-200 1-1


Open System Networking

Common Protocol Layers


Message Path

Application

Presentation

Session

Transport

Network

Data Link

Physical

Originating System Receiving System

Figure 1-1. The OSI Reference Model

Each logical layer represents a single service performed by the system. Because different
systems perform these services in different ways, these logical layers may or may not
correspond to physical components of the system. A hardware or software entity can
overlap layers or include more than one layer by performing more than one service.

Hardware or software components that perform comparable services within a single layer
of the model but on different systems in the network are called peer entities. A set of rules
for communication between peer entities is called a peer protocol. The peer protocols for
each layer are independent of the protocols of any other layer.

According to the model, when different systems in an OSI network agree on the peer
protocols, peer entities across the network can exchange information, regardless of the
internal functioning of each system. That is, application programs on one system can
exchange messages with application programs on any system in the network regardless of
system architecture.

1-2 3787 3296-200


Open System Networking

1.1.2. DDP-PPC and the OSI Model


Figure 1-2 represents DDP-PPC in an OSI network.

Common Protocol Layers


Message Path

7
Application
6
DDP-PPC Presentation
5
Session
4
Transport
3
Transport Network
Services 2
Data Link
1
Physical

Originating System Receiving System

Figure 1-2. DDP-PPC in an OSI Network

In an OS 2200 system, DDP-PPC performs the application, presentation, and session layer
processes (Figure 1-3) as follows:

$ The application layer provides the means to establish an association between itself and
another application program for the purpose of exchanging information.
$ The presentation layer provides translation or interpretation of data formats.
$ The session layer coordinates the exchange of information between the end-user
applications.

3787 3296-200 1-3


Open System Networking

Either Communications Management System (CMS 1100) or Telcon in the distributed


communication processor (DCP) front-end processor performs the functions of the lowest
four layers (transport services). Some of the functions transport services performs are
message routing, device connection, and transmission error detection.

Host A Host B

Application Program Application Program


File

DDP-PPC
Host LAN
Transport CMS 1100 Connection
Services

TELCON

Transport OSITS OSI-PDN


Services
X.25 PSCS

3787 3296
F01_03

Figure 1-3. DDP-PPC and Transport Services

1-4 3787 3296-200


Open System Networking

When you use DDP-PPC/OSI applications in a network with only OS 2200 or U Series, you
can use one of three kinds of transport:

$ Open Systems Interconnection (OSI)


$ Distributed Communications Architecture (DCA)
$ Transmission Control Protocol/Internet Protocol (TCP/IP)

When you use DDP-PPC/OSI applications in a network with foreign hosts, you normally
use the OSI transport protocols but, depending on the foreign system, may also be able to
use TCP/IP transport protocols. The software that provides OSI Transport Layer Services
is located in CMS 1100 or in the DCP. Depending on your configuration, you may use either
of these transport service providers or, in some cases, both.

If you want to use DDP-PPC/OSI with a foreign vendor using TCP/IP Transport Services,
that vendor must have implemented RFC 1006, which allows OSI Transport Layer Services
to be mapped onto TCP/IP.

1.1.3. DDP-PPC and the OSI Interface


The two interface points into OSI services for all user functions are:

$ Application layer services


$ Session layer services

The function call is the same for both interfaces. Specify a parameter
(OSI-SERVICE-ENTRY) at connection establishment to determine the interface for the
remainder of the connection.

Session Layer Services


The session layer services entry is for programmers who want to write their own
application and presentation layers, or who want direct access to the OSI session layer
services. When you request the session layer entry, only the services the session layer
provides are accessible. DDP-PPC does not provide any services of the application or
presentation layers when you select session layer entry.

3787 3296-200 1-5


Open System Networking

Application Layer Services

When you select the application layer entry, DDP-PPC provides the OSI ACSE and
presentation layer services. These consist of:

$ All ACSE services


$ Negotiation of presentation context lists
$ Generation of all ACSE and presentation layer protocol except user data

However, when you specify the application level entry, the application program may still
have to perform some of the following presentation layer functionality, depending on
which user data type is used:

$ Encode the user data with the correct transfer syntax before requesting any
DDP-PPC/OSI services. This involves coding the data according to the rules of the
selected transfer syntax. DDP-PPC expects the data to be encoded correctly as it has
no way of verifying the encoding. The application program should use the presentation
context list, negotiated during connection establishment, when encoding the data.
$ Decode any user data received in a message from DDP-PPC and return the appropriate
presentation layer error messages if it encounters errors during the decoding.

1-6 3787 3296-200


Overview of Program-to-Program Applications

1.2. Overview of Program-to-Program Applications


The DDP-PPC COBOL program-to-program facility passes data between programs in the
same host or remote hosts using Unisys DCA or OSI protocol. (This data may include
status or informational messages, control information, records from a file, etc.)

Computer A Computer B

COBOL
Program
A

Data

COBOL COBOL
Program Data Program
B C

Figure 1-4. DDP-PPC COBOL Program-to-Program Facility

3787 3296-200 1-7


DDP-PPC COBOL Interface

1.3. DDP-PPC COBOL Interface


The DDP-PPC/OSI COBOL copy element (OSI-COBOLCPY) supports both the ASCII and
UCS COBOL compilers. The DDP-PPC function calls and COPY packets are common for
both COBOL compilers; thus, DDP-PPC does not require any source code changes to
convert from one compiler to the other. The difference is in the way the resultant
relocatables are collected and executed:

$ A program compiled under ASCII COBOL is collected with a Unisys-supplied


relocatable element, OSI-COBINTF, which converts the COBOL function calls into
DDP-PPC format.
$ A program compiled under UCS COBOL is statically linked at execution time prior to
an execution or dynamically linked at execution time to a Unisys-supplied object
module called OSI-UCSIF-OM. This module converts the COBOL function calls into
DDP-PPC format.

1-8 3787 3296-200


Section 2
Procedural Overview

This section discusses procedures for writing DDP-PPC/OSI COBOL programs. The
following topics are discussed:

$ COBOL program structure (Section 2.1)


$ DDP-PPC function call formats (Section 2.2)
$ Coding the Environment Division (Section 2.3)
$ Copying data packets into the Data Division (Section 2.4)
$ The message buffer area (Section 2.5)
$ Message size and segmentation considerations (Section 2.6)
$ Copying function calls into the Procedure Division (Section 2.7)

2.1. COBOL Program Structure


Although DDP-PPC COBOL programs are similar to conventional programs, they require
certain additional features to perform in an OSI network. These features are:

$ DDP-PPC/OSI function calls in the Procedure Division


$ DDP-PPC/OSI data packets in the working-storage section of the Data Division

3787 3296-200 2-1


DDP-PPC Function Call Formats

2.2. DDP-PPC Function Call Formats


Function calls:

$ Are your program’s means of transferring data between programs


$ Always contain USING clauses that reference data packets contained in your
working-storage section (see Table 2-2).

Data packets consist of control information and data needed for program-to-program
communications.

The basic format for all function calls is:


CALL 'function' USING param-1,...param-n.

where:

function
Is the name of the DDP-PPC function the application program requested (see
Table 2-1).

USING
Is the clause that references data packets in the working-storage section.

param
Is the name of the data packet storage area in the working-storage section.

Parameters in the USING list are positional. Code them in the order in which they are
shown in each function call described in this section. Failure to do so causes
unpredictable results when the program is executed.

After processing a function call, DDP-PPC returns a general status code, a detailed status
code, and, possibly, a specific error code. The DDP-PPC/DDP-FJT Messages Reference
Manual explains these codes.

2-2 3787 3296-200


DDP-PPC Function Call Formats

2.2.1. OSI Functions, COBOL Function Calls, and COPY Verbs


Table 2-1 lists the OSI functions used in an OSI network and their associated DDP-PPC
COBOL function calls and COPY verbs. Section 3describes each of these functions in detail.

Table 2-1. OSI Functions and Their Associated DDP-PPC COBOL Function Calls

Function Function Call COPY Verb

Abort the conversation OSI$ABORT COPY OSI-ABORT

Initiate an OSI activity OSI$ACTMGT COPY OSI-ACTMGT

Register with DDP-PPC (initiate a session) OSI$BIND COPY OSI-BIND

Close the connection OSI$CLOSE COPY OSI-CLOSE

Accept a close request OSI$CLRESP COPY OSI-CLRESP

Send capability data OSI$CPDATA COPY OSI-CPDATA

Send a response to capability data OSI$CPRESP COPY OSI-CPRESP

Create new dump file OSI$DUMP COPY OSI-DUMP

Pass all available tokens to a peer OSI$GVCNTRL COPY OSI-GVCNTRL

Pass a combination of tokens to the peer OSI$GVTOKEN COPY OSI-GVTOKEN

Open the conversation OSI$OPEN COPY OSI-OPEN

Accept or reject an open OSI$OPRESP COPY OSI-OPRESP

Request a combination of tokens from OSI$PLTOKEN COPY OSI-PLTOKEN


the peer

Receive messages OSI$RECEIVE COPY OSI-RECEIVE

Reset synchronization points OSI$RESYNC COPY OSI-RESYNC

Send messages OSI$SEND COPY OSI-SEND

Set synchronization points OSI$SYNC COPY OSI-SYNC

Send typed data OSI$TPDATA COPY OSI-TPDATA

Release DDP-PPC resources (terminate a OSI$UNBIND COPY OSI-UNBIND


session)

Report errors - no abort OSI$XRPT COPY OSI-XRPT

3787 3296-200 2-3


DDP-PPC Function Call Formats

2.2.2. DDP-PPC/OSI Data Packets


Each function call in the Procedure Division references a set of data packets in the
working-storage section. Data packets contain the information DDP-PPC needs to execute
its various functions. Table 2-2 lists the DDP-PPC COBOL function calls and their
associated data packets. Appendix Ashows the data packets in detail.

Table 2-2. DDP-PPC COBOL Function Calls and Their Associated Data Packets

Function Call Data Packets Referenced in


USING Clause by Function Call

OSI$ABORT OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-APPL-PRES-PKT

OSI$ACTMGT OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-ACTIVITY-PKT

OSI$BIND OSI-STATUS-PKT
OSI-REGISTER-PKT

OSI$CLOSE OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$CLRESP OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$CPDATA OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$CPRESP OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$DUMP OSI-STATUS-PKT

OSI$GVCNTRL OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$GVTOKEN OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

continued

2-4 3787 3296-200


DDP-PPC Function Call Formats

Table 2-2. DDP-PPC COBOL Function Calls and Their Associated Data Packets (cont.)

Function Call Data Packets Referenced in


USING Clause by Function Call

OSI$OPEN OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-CONNECT-PKT
OSI-APPL-PRES-PKT
OSI-ADDRESS-PKT

OSI$OPRESP OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-CONNECT-PKT
OSI-APPL-PRES-PKT
OSI-ADDRESS-PKT

OSI$PLTOKEN OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$RECEIVE OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-CONNECT-PKT

OSI$RESYNC OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-RESYNC-PKT

OSI$SEND OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$SYNC OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT
OSI-SYNC-PKT

OSI$TPDATA OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

OSI$UNBIND OSI-STATUS-PKT

OSI$XRPT OSI-STATUS-PKT
OSI-MSG-BUFFER
OSI-DATA-PKT

3787 3296-200 2-5


Copying Data Packets into the Data Division

2.3. Copying Data Packets into the Data Division


To copy the data packets into a program, use the COPY OSI-PKTS statement in the
working-storage section of your COBOL program. When you compile the program, the
packets expand inline. All the fields and parameters forming the data packets are copied
into the program. Appendix A contains the data packets; Section 3 describes the packets
and their related function calls.

The following code

DATA DIVISION.
WORKING-STORAGE SECTION.
COPY OSI-PKTS.

produces

01 OSI-STATUS-PKT.
.
.
01 OSI-REGISTER-PKT.
.
.
01 OSI-CONNECT-PKT.
.
.
01 OSI-APPL-PRES-PKT.
.
.
01 OSI-ADDRESS-PKT.
.
.
01 OSI-DATA-PKT.
.
.
01 OSI-RCV-PKT.
.
.
01 OSI-ACTIVITY-PKT.
.
.
01 OSI-SYNC-PKT.
.
.
01 OSI-RESYNC-PKT.
.
.

Figure 2-1. DDP-PPC COBOL Program Working Storage Section

2-6 3787 3296-200


Message Buffer Area

2.4. Message Buffer Area


You need to define a message buffer area. It will contain the data to be given to DDP-PPC
for output functions or the data DDP-PPC receives for the OSI$RECEIVE function. The
COPY statement does not supply this area.

This area does not have to have a specific name, since it is passed as a parameter on all the
function calls or macros that require it. In fact, you can define different areas for different
types of functions such as INPUT-MESSAGE-BUFFER for the OSI$RECEIVE function,
OUTPUT-MESSAGE-BUFFER for the OSI$SEND function, and ERROR-BUFFER for the
OSI$ABORT function.

Example:
01 OSI-MSG-BUFFER PIC X(1024).

3787 3296-200 2-7


Message Size and Segmentation Considerations

2.5. Message Size and Segmentation


Considerations
The OSI session layer protocol limits how much user data can be sent on most session
services. It imposes these limits at the session layer (called session user data), where the
message includes the user data and any additional protocol parameters the DDP-PPC/OSI
services generate. The length of the protocol header cannot be determined before it is
actually built because many dynamic factors determine its length. Therefore, the user
program may get an error indicating that too much data was specified in the message
buffer, even though its user data did not exceed the maximum allowed for that function.

For example, the OSI$OPEN function (using session version 1) is the most susceptible to
this type of error because of the 512-byte size limitation and the large amount of protocol
header information it generates to open a connection.

The normal and typed data session services (using session version 2) allow for the transfer
of messages of unlimited size. Since DDP-PPC limits the user program message size for
each function to 13000 bytes, it supports unlimited-size messages by using OSI session and
transport layer segmentation and treating the data passed on each function call as a
segment of the larger message.

You can send segmented messages on the OSI$SEND and OSI$TPDATA functions by
setting the OSI-UNIT-INDICATOR parameter in OSI-DATA-PKT to 0, OSI-MSG-INCOMPL.
This tells DDP-PPC to treat the data passed on this function as a segment of a larger
message. DDP-PPC will treat data from subsequent OSI$SEND or OSI$TPDATA functions
in the same manner until one of the functions sets the OSI-UNIT-INDICATOR to 1,
OSI-MSG-COMPL, which signifies the end of the large message.

DDP-PPC also uses the unit-indicator on the OSI$RECEIVE function to indicate that the
data given to the user program is part of a larger message. It returns a value of
OSI-MSG-INCOMPL on subsequent OSI$RECEIVE functions, until it receives an
end-of-message indication from the transport layer services.

To prevent data loss, the receiving program should be prepared to receive messages as
large as 13000 bytes if segmentation can be used on the connection, even if the peer
program has always sent smaller segments. This is necessary because the OSI protocol
does not provide a way to reconstruct the segments on the receiving side the same as they
were constructed on the sending side. Consequently, DDP-PPC may receive a message as
large as 13000 bytes from the lower layers.

2-8 3787 3296-200


Copying Function Calls into the Procedure Division

2.6. Copying Function Calls into the Procedure


Division
You can code these function calls in the Procedure Division or use a COPY verb to issue a
function call. The inline expansion of the COPY verb at compile time then ensures the
correct order of the operands in the call. An example of this usage is:
COPY OSI-RECEIVE.

producing
CALL 'OSI$RECEIVE' USING OSI-STATUS-PKT OSI-MSG-BUFFER OSI-DATA-PKT
OSI-CONNECT-PKT OSI-APPL-PRES-PKT OSI-ADDRESS-PKT
OSI-RCV-PKT OSI-SYNC-PKT OSI-ACTIVITY-PKT OSI-RESYNC-PKT.

3787 3296-200 2-9


Section 3
DDP-PPC/OSI Function Calls

This section provides detailed information on setting data packets and issuing function
calls. It describes the DDP-PPC/OSI COBOL program-to-program function calls and their
associated COPY verbs. The function calls appear alphabetically in this section. For each
function call, this section:

$ Describes the use of message buffer areas.


$ Describes the data packet parameters the user sets and DDP-PPC returns.
$ Provides examples that illustrate how to use each COPY verb/function call.

3.1. Aborting a Conversation (OSI$ABORT)


The OSI$ABORT function call unconditionally terminates a conversation. The call passes
an abort notification to the paired program. All resources pertaining to the side of the
conversation that requested the abort are released. No further commands pertaining to the
conversation are permitted or processed.

An abort can cause messages that were previously sent but not received to be discarded.

3787 3296-200 3-1


Aborting a Conversation (OSI$ABORT)

3.1.1. OSI$ABORT Format


The OSI$ABORT format is as follows:
COPY OSI-ABORT.

or
CALL 'OSI$ABORT' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-APPL-PRES-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$ABORT request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an abort permits you to send a message along with the
abort request. OSI-MSG-BUFFER is the default name. You can specify your own name in
the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

The OSI-APPL-PRES-PKT parameter references the application presentation packet. It is


only used when the application layer is selected. It contains information about
presentation contexts for data sent with the abort.

3-2 3787 3296-200


Aborting a Conversation (OSI$ABORT)

3.1.2. OSI-STATUS-PKT
Appendix A contains the status packet. The OSI$ABORT function call uses the following
status packet parameters:

Table 3-1. OSI-STATUS-PKT Parameters for OSI$ABORT

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol
you are using. This value must be 1538 for this release. This
value is set automatically if you use the COPY verb format. If
you use the function call format, you must set this value using a
standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies


this application program. This value must remain unchanged as
long as this application program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no


additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-3


Aborting a Conversation (OSI$ABORT)

3.1.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$ABORT function call. It is
specified in the working storage of the application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the user-information
parameter of the ABRT-apdu in ISO 8650 - Open Systems Interconnection - Protocol
specification for the Association Control Service Element. It should be encoded
according to ISO 8825 - Specification of Basic Encoding Rules for Abstract Syntax
Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
encodes and what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-
DDP-PPC information [30] length

encoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
encoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

3-4 3787 3296-200


Aborting a Conversation (OSI$ABORT)

3.1.4. OSI-DATA-PKT

Table 3-2. OSI-DATA-PKT Parameters for OSI$ABORT

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive


new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding,
set this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set
to 134 or 140 for connections to non-OS 2200 hosts because
any other value requires the use of DDP-PPC proprietary
abstract and transfer syntaxes that those hosts will probably
not recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract
and transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11)
for details about syntax selection. See the OSI-APPL-PRES-PKT
(3.11) for information about negotiating syntaxes on the open
response.

v OSI-TRANSPARENT- TYPE 134 DDP-PPC does not reformat the user data. The user TYPE
must encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMPRESSED- TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user
must encode the ASN.1 EXTERNAL type as part of user data.

v OSI-PAD- TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the ASN.1 EXTERNAL type as
part of user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes,
and also compresses the data. If it cannot perform
compression, it treats the data type as a 138 type. The user
must encode the ASN.1 EXTERNAL type as part of user data.

continued

3787 3296-200 3-5


Aborting a Conversation (OSI$ABORT)

Table 3-2. OSI-DATA-PKT Parameters for OSI$ABORT (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using


ASN.1 Basic Encoding Rules. This data type does not require
any additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET- STRING 141 DDP-PPC encodes user data as an octet string using
ASN.1 Basic Encoding Rules, and also compresses the data. If
it cannot perform compression, it treats the data type as a 140
type. This data type does not require any additional protocol to
be encoded as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the first
byte of the buffer is to be used. DDP-PPC ignores this
parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 9 bytes of session data enforced
by OSI session protocol. If you selected session version 2,
there is a limit of 10240 bytes of session data enforced by OSI
session protocol. In either case, all user data and additional
protocol header information generated by DDP-PPC cannot
exceed the respective limit.
Always set the text length to 0 if not sending text.
If you selected session version 1 and the application layer
interface is used, no user data is sent because the 9-byte limit
is too small to encode data.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

3-6 3787 3296-200


Aborting a Conversation (OSI$ABORT)

3.1.5. OSI-APPL-PRES-PKT

Table 3-3. OSI-APPL-PRES-PKT Parameters for OSI$ABORT

Parameter Description

Values Set by User

OSI-PRES-CONTEXT-TABLE- ENTRIES The number of OSI-CONTEXT-TABLE entries for this


OSI$ABORT function call. Valid values are 1 through 15.
If there is no user data for this ABORT request, set this
value to 0.

OSI-PRES-CONTEXT-TABLE

v OSI-PRES-CONTEXT- IDENT A presentation context identifier successfully negotiated


during open processing, which appears in the user data
for this ABORT request.

v OSI-ABSTRACT-SYNTAX- ALIAS The alias for the abstract syntax used to describe the
user SYNTAX-ALIAS data for this connection. It is paired
with its corresponding presentation context identifier.

v OSI-TRANSFER-SYNTAX- ALIAS The alias for the transfer syntax used to encode the user
SYNTAX-ALIAS data for the presentation context
identified by OSI-PRES-CONTEXT-IDENT.

Note: Although you can include the ACSE context in this list, it is not necessary
because DDP-PPC automatically includes it.

3787 3296-200 3-7


Aborting a Conversation (OSI$ABORT)

3.1.6. OSI$ABORT Example - Send with No Message

Procedure Typical COBOL Procedure Division


Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO


OSI-CONNECTION.

3. Set the output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC.

8. Issue the function. COPY OSI-ABORT.

3-8 3787 3296-200


Aborting a Conversation (OSI$ABORT)

3.1.7. OSI$ABORT Example - Send with Message

Procedure Typical COBOL Procedure Division


Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO


OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE ABORT-MSG-LENGTH TO


OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set Application Presentation Packet


parameters.

10. Set the context ident. MOVE 1 TO OSI-PRES-CONTEXT-IDENT (1).

11. Set the abstract syntax for user MOVE ’ACSE-AS’ TO


info. OSI-ABSTRACT_SYNTAX-ALIAS (1).

12. Set the transfer syntax for user MOVE ’ASN1-TS’ TO


info. OSI-TRANSFER-SYNTAX-ALIAS (1).

13. Set the context id. MOVE 3 TO OSI-PRES-CONTEXT-IDENT (2).

14. Set the abstract syntax for user MOVE ’OIW-OCTET-STRING’ TO


info. OSI-ABSTRACT-SYNTAX-ALIAS (2).

15. Set the transfer syntax for user MOVE ’ASN1-TS’ TO


info. OSI-TRANSFER-SYNTAX-ALIAS (2).

16. Set the number of table entries. MOVE 2 TO


OSI-PRES-CONTEXT-TABLE-ENTRIES.

Set the output message buffer area.

17. Put the message in the output MOVE ABORT-MSG TO OSI-MSG-BUFFER.


buffer.

Call DDP-PPC

continued

3787 3296-200 3-9


Aborting a Conversation (OSI$ABORT)

continued

Procedure Typical COBOL Procedure Division


Statements

18. Issue the function. COPY OSI-ABORT.

3-10 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

3.2. Initiating an Activity (OSI$ACTMGT)


Use the OSI$ACTMGT function call to start, interrupt, resume, discard, or end an OSI
activity. The activity concept allows users to distinguish among different pieces of work
called activities. Only one activity can be in progress on a connection at a time, but there
may be several consecutive activities during a connection. An activity can also span more
than one connection. An activity can be interrupted and then resumed on the same or
subsequent connection, which can be considered a form of resynchronization.

Data can be passed with this function only when the activity management subfunction
(OSI-ACT-MGT-FUNC, ACTIVITY packet) is one of the following:

$ Start (0, OSI-ACT-START)


$ Resume (1, OSI-ACT-RESUME)
$ End (6, OSI-ACT-END)
$ End acknowledge (7, OSI-ACT-END-ACK)

3.2.1. OSI$ACTMGT Format


COPY OSI-ACTMGT.

or
CALL 'OSI$ACTMGT' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-ACTIVITY-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$ACTMGT request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an activity request permits you to send a message along
with the request. OSI-MSG-BUFFER is the default name. You can specify your own name
in the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.The OSI-ACTIVITY-PKT parameter
references the activity packet to select the activity function to be performed.

3787 3296-200 3-11


Initiating an Activity (OSI$ACTMGT)

3.2.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$ACTMGT function call uses the following
status packet parameters:

Table 3-4. OSI-STATUS-PKT Parameters for OSI$ACTMGT

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are
using. This value must be 1538 for this release. This value is set
automatically if you use the COPY verb format. If you use the function
call format, you must set this value using a standard COBOL
statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies this


application program. This value must remain unchanged as long as
this application program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3-12 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

3.2.3. OSI-MSG-BUFFER Area


This is a storage area for user data sent with the OSI$ACTMGT function call. It is specified
in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer activity management service requests. It should be encoded according to
the rules specified in ISO 8823 Connection oriented presentation protocol specification
for encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3787 3296-200 3-13


Initiating an Activity (OSI$ACTMGT)

3.2.4. OSI-DATA-PKT

Table 3-5. OSI-DATA-PKT Parameters for OSI$ACTMGT

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set it to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED- TRANSP 135 DDP-PPC compresses user data. If DDP-PPC


cannot perform compression, it treats the data type as a
134 type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3-14 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

Table 3-5. OSI-DATA-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit


bytes, and also compresses the data. If DDP-PPC cannot
compress the data, it treats the data type as a 138 type.
The user must encode the presentation layer User-data
type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET- STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. This parameter is
ignored if OSI-TEXT-LENGTH is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you select


session version 1, there is a limit of 512 bytes of session
data enforced by OSI session protocol. If you select
session version 2, there is a limit of 10240 bytes of
session data enforced by OSI session protocol. In either
case, all user data and additional protocol header
information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.
Note: If session version 1 was selected, set this field
to 0 for the following activity management
subfunctions (OSI-ACT-MGT-FUNC):
$ Activity interrupt (2, OSI-ACT-INT)
$ Activity interrupt acknowledge (3, OSI-
ACT-INT-ACK)
$ Activity discard (4, OSI-ACT-DISC)
$ Activity discard acknowledge (5,
OSI-ACT-DISC-ACK)

continued

3787 3296-200 3-15


Initiating an Activity (OSI$ACTMGT)

Table 3-5. OSI-DATA-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no


message segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

OSI-SYNC-POINT-SERIAL- NUMBER Must be supplied only for the activity resume subfunction
(OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES). Set it to the
synchronization point serial number where you want the
activity to be resumed; the number is passed to the peer
program.

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


this conversation. Valid values are:
$ 0 = OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 = OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
DDP-PPC uses this parameter for programs executing in
full duplex to determine when to issue an OSI$RECEIVE
function.

OSI-SYNC-POINT-SERIAL- NUMBER This parameter can return the following values,


depending on the OSI-ACT-MGT-FUNC subfunction issued:
$ If 0 (OSI-ACT-START), DDP-PPC sets this to 1.
$ If 2 (OSI-ACT-INT), DDP-PPC returns the current
synchronization point serial number.

3-16 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

3.2.5. OSI-ACTIVITY-PKT

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT

Parameter Description

Values Set by User

OSI-ACT-MGT-FUNC The activity management subfunction to be performed


for this activity management request.

v OSI-ACT-START (Activity Start) 0 Start a new activity.


This subfunction is used only if the following are true:
$ The program possesses the activity major token.
$ No activity is currently in progress.
$ The activity management functional unit was
selected for this connection.
$ The full duplex functional unit was selected
or
the half-duplex functional unit was selected and the
program possesses the data token.
$ The minor synchronize functional unit was not
selected
or
the minor synchronize functional unit was selected
and the program possesses the sync minor token.

continued

3787 3296-200 3-17


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-ACT-MGT-FUNC (cont.)

v OSI-ACT-RES (Activity Resume) 1 Resume an activity that was previously interrupted.


This subfunction is used only if the following are true:
$ The program possesses the activity major token.
$ No activity is currently in progress and the activity to
be resumed was interrupted by a previous activity
interrupt.
$ The activity management functional unit was
selected for this connection.
$ The full duplex functional unit was selected
or
the half-duplex functional unit was selected and the
program possesses the data token.
$ The minor synchronize functional unit was not
selected
or
the minor synchronize functional unit was selected
and the program possesses the sync minor token.

continued

3-18 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-ACT-MGT-FUNC (cont.)

v OSI-ACT-INT (Activity Interrupt) 2 The current activity is to be interrupted, but not


cancelled, so that it can be resumed at a later time.
This subfunction is used only if the following are true:
$ The program possesses the activity major token.
$ No activity is currently in progress.
$ The activity management functional unit was
selected for this connection.
This is a confirmed function. The user program must
receive the acknowledgment for this activity interrupt
before it initiates any other DDP-PPC OSI functions
except OSI$ABORT.

v OSI-ACT-INT-ACK (Activity Interrupt 3 The program acknowledges an activity interrupt it


Acknowledge) received for this activity.
The program can use this subfunction if it received an
OSI activity management message (OSI-MSG-TYPE = 9,
OSI-MSG-ACTMGT) with OSI-ACT-MGT-FUNC = 2,
OSI-ACT-INT.
When the program sends this acknowledgement, it
passes all the tokens it possesses to the peer program.

continued

3787 3296-200 3-19


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-ACT-MGT-FUNC (cont.)

v OSI-ACT-DISC (Activity Discard) 4 The current activity is to be discarded (abnormally


terminated). It cannot be resumed at a later time.
This subfunction is used only if the following are true:
$ The program possesses the activity major token.
$ An activity is currently in progress.
$ The activity management functional unit was
selected for this connection.
This is a confirmed function. The user program must
receive the acknowledgment for this activity discard
before it initiates any other DDP-PPC OSI functions
except OSI$ABORT.

v OSI-ACT-DISC-ACK (Activity Discard 5 The program acknowledges an activity discard it


Acknowledge) received for this activity.
The program can use this subfunction only if it received
an OSI activity management message (OSI-MSG-TYPE =
9, OSI-MSG-ACTMGT) with OSI-ACT-MGT-FUNC = 4,
OSI-ACT-DISC.
When the program sends this acknowledgment, it passes
all the tokens it possesses to the peer program.

continued

3-20 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-ACT-MGT-FUNC (cont.)

v OSI-ACT-END (Activity End) 6 End the current activity.


This subfunction can be used only if the following are
true:
$ The program possesses the activity major token.
$ An activity is currently in progress.
$ The activity management functional unit was
selected for this connection.
$ The full-duplex functional unit was selected
or
the half-duplex functional unit was selected and the
program possesses the data token.
$ The minor synchronize functional unit was not
selected
or
the minor synchronize functional unit was selected
and the program possesses the sync minor token.
This is a confirmed function. The user program must
receive the acknowledgment for this activity end before it
initiates any other DDP-PPC OSI functions except
OSI$ABORT, OSI$GVTOKEN, or OSI$ACTMGT with
OSI-ACT-MGT-FUNC set to 2 (OSI-ACT-INT) or 4
(OSI-ACT-DISC).

v OSI-ACT-END-ACK (Activity End 7 The program acknowledges an activity end that it


Acknowledge) received for this activity.
The program can use this subfunction only if it received
an OSI activity management message (OSI-MSG-TYPE =
9, OSI-MSG-ACTMGT) with OSI-ACT-MGT-FUNC equal to
activity end (6, OSI-ACT-END).

continued

3787 3296-200 3-21


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-ACT-REASON This field provides a reason for interrupting or discarding


the current activity. Only set this field for the activity
interrupt (2, OSI-ACT-INT) and activity discard (4,
OSI-ACT-DISC) subfunctions.

v OSI-ACT-NO-REASON 0 No specific reason provided.

v OSI-ACT-RCV-ABILITY- JEOP 1 The user program receiving ability is jeopardized and


is temporarily unable to continue (that is, the data
received may not be handled correctly).

v OSI-ACT-SEQUENCE-ERR 3 The user program has encountered a sequence error.

v OSI-ACT-LOCAL-USR-ERR 5 The program has encountered a local error.

v OSI-ACT-UNRECOV-PROC- ERR 6 The program has encountered an unrecoverable


procedural error.

OSI-ACT-DEMAND-DATA- TOKEN 128 The user program demands the data token.

OSI-ACT-ID-LEN The length in bytes of the OSI-ACT-ID parameter, which


can range from 1 to 6. You must supply this value if
OSI-ACT-MGT-FUNC is set for activity start (0,
OSI-ACT-START) or activity resume (1, OSI-ACT-RES).

OSI-ACT-ID The activity id for an activity being started or the new


activity id for an activity being resumed. You must supply
this value if OSI-ACT-MGT-FUNC is set for activity start (0,
OSI-ACT-START) or activity resume (1, OSI-ACT-RES).

OSI-OLD-ACT-ID-LEN The length, in bytes, of the OSI-OLD-ACT-ID parameter,


which can range from 1 to 6. You must supply this value
for the activity resume subfunction (OSI-ACT-MGT-FUNC =
1, OSI-ACT-RES).

OSI-OLD-ACT-ID The old activity id for an activity that was previously


interrupted. You must supply this id for the activity
resume subfunction (OSI-ACT-MGT-FUNC = 1,
OSI-ACT-RES).

continued

3-22 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

Table 3-6. OSI-ACTIVITY-PKT Parameters for OSI$ACTMGT (cont.)

Parameter Description

OSI-OLD-SCI-CALLING- REF-LEN The length, in bytes, of the data supplied in the


OSI-OLD-SCI-CALLING-REF parameter. It can be in the
range 0 to 64. Since the OSI-OLD-SCI-CALLING-REF
parameter is optional, a value of 0 indicates that
DDP-PPC should not encode and pass that parameter.
DDP-PPC only uses this parameter for the activity resume
subfunction (OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES).

OSI-OLD-SCI-CALLED- REF-LEN The length, in bytes, of the data supplied in the


OSI-OLD-SCI-CALLED-REF parameter. It can be in the
range 0 to 64. Since the OSI-OLD-SCI-CALLED-REF
parameter is optional, a value of 0 indicates that
DDP-PPC should not encode and pass that parameter.
DDP-PPC only uses this parameter for the activity resume
subfunction (OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES).

OSI-OLD-SCI-COMMON- REF-LEN The length, in bytes, of the data supplied in the


OSI-OLD-SCI-COMMON-REF parameter. It can be in the
range 0 to 64. Since the OSI-OLD-SCI-COMMON-REF
parameter is optional, a value of 0 indicates that
DDP-PPC should not encode and pass that parameter.
DDP-PPC only uses this parameter for the activity resume
subfunction (OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES).

OSI-OLD-SCI-ADD-REF-LEN The length, in bytes, of the data supplied in the


OSI-OLD-SCI-ADD-REF parameter. It can be in the range 0
to 64. Since the OSI-OLD-SCI-ADD-REF parameter is
optional, a value of 0 indicates that DDP-PPC should not
encode and pass that parameter.
DDP-PPC only uses this parameter for the activity resume
subfunction (OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES).

OSI-ACT-SESSION- CONNECTION-ID This parameter contains user-defined fields that can help
determine the connection on which the activity being
resumed was originally started.
DDP-PPC only uses this parameter for the activity resume
subfunction (OSI-ACT-MGT-FUNC = 1, OSI-ACT-RES).

v OLD-SCI-CALLING-REF ISO 8326 suggests that these four fields match the
corresponding parameters passed on the open request
v OLD-SCI-CALLED-REF for the connection. However, this is not required and
v OLD-SCI-COMMON-REF DDP-PPC passes their contents without validation against
previous information.
v OLD-SCI-ADD-REF

3787 3296-200 3-23


Initiating an Activity (OSI$ACTMGT)

3.2.6. OSI$ACTMGT Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set Activity Management Packet


parameters.

8. Set the activity to start. MOVE 0 TO OSI-ACT-MGT-FUNC.

9. Set the activity id. MOVE ’ID0001’ TO OSI-ACT-ID.

10. Set the activity id length. MOVE 6 TO OSI-ACT-ID-LEN.

Call DDP-PPC.

11. Issue the function. COPY OSI-ACTMGT.

3-24 3787 3296-200


Initiating an Activity (OSI$ACTMGT)

3.2.7. OSI$ACTMGT Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE ACTMGT-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set Activity Management Packet


parameters.

10. Set the activity to start. MOVE 0 TO OSI-ACT-MGT-FUNC.

11. Set the activity id. MOVE ’ID0001’ TO OSI-ACT-ID.

12. Set the activity id length. MOVE 6 TO OSI-ACT-ID-LEN.

Set the output message buffer area.

13. Put the message in the output buffer. MOVE ACTMGT-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

14. Issue the function. COPY OSI-ACTMGT.

3787 3296-200 3-25


Registering an Application Program with the DDP-PPC/OSI Network(OSI$BIND)

3.3. Registering an Application Program with the


DDP-PPC/OSI Network (OSI$BIND)
Use the OSI$BIND function call to:

$ Register your application program with DDP-PPC


$ Obtain a user-id from DDP-PPC

You must issue this call before issuing any other DDP-PPC calls. When you receive a
user-id from DDP-PPC, you must use it on all subsequent calls to DDP-PPC.

3.3.1. OSI$BIND Format


COPY OSI-BIND.

or
CALL 'OSI$BIND' USING OSI-STATUS-PKT OSI-REGISTER-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas in your
working-storage section for the release version, user-id, and status codes. On completion
of the function, DDP-PPC returns a user-id in the status packet. Your program must then
supply the user-id on all subsequent calls to DDP-PPC. DDP-PPC also returns general and
detailed status codes that you should check after completion of each function call.

The OSI-REGISTER-PKT parameter references the information packet in which you insert
the name of this program before issuing the call.

3-26 3787 3296-200


Registering an Application Program with the DDP-PPC/OSI Network(OSI$BIND)

3.3.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$BIND function call uses the following status
packet parameters:

Table 3-7. OSI-STATUS-PKT Parameters for OSI$BIND

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are
using. This value must be 1538 for this release. This value is set
automatically if you use the COPY verb format. If you use the function call
format, you must set this value using a standard COBOL statement.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-USER-ID An identifier for this application program. This value must remain
unchanged as long as this application program is signed on to DDP-PPC.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-27


Registering an Application Program with the DDP-PPC/OSI Network(OSI$BIND)

3.3.3. OSI-REGISTER-PKT

Table 3-8. OSI-REGISTER-PKT Parameters for OSI$BIND

Parameter Description

Values Set by User

OSI-INT-AP-NAME Required. The name you want to assign to your primary


or secondary program. Specify up to 16 ASCII
characters. Valid characters are A to Z, a to z, 0 to 9, $,
and v (dash).
DDP-PPC uses this parameter for routing. If the program
receives an incoming open request, this field must match
the Called Session Selector on that request.

OSI-REGISTER-TIP If your program is a TIP application, you can optionally


use the following format for the name of your program
(see 4.2 for more information).

v OSI-REG-TIP-IND Must be set to TIP$.

v OSI-REG-APPL-NO The number of the message control block (MCB)


application group in which this TIP program will execute.

v OSI-REG-TPX-CODE The TIP program’s transaction code.

3-28 3787 3296-200


Registering an Application Program with the DDP-PPC/OSI Network(OSI$BIND)

3.3.4. OSI$BIND Example

Procedure Typical COBOL Procedure Division Statements

Set Register Packet parameters.

1. Set program name. MOVE ’PROGA’ TO OSI-INT-AP-NAME.

Call DDP-PPC.

2. Issue the function. COPY OSI-BIND.

3. Save the user-id. MOVE OSI-USER-ID TO USER-SAVE.

3.3.5. OSI$BIND Example (TIP-Called Session Selector Format)

Procedure Typical COBOL Procedure Division Statements

Set Register Packet parameters.

1. Set TIP indicator. MOVE ’TIP$’ TO OSI-REG-TIP-IND.

2. Set application group number. MOVE 1 TO OSI-REG-APPL-NO.

3. Set TIP transaction code. MOVE ’TRANSA’ TO OSI-REG-TPX-CODE.

Call DDP-PPC.

4. Issue the function. COPY OSI-BIND.

5. Save the user-id. MOVE OSI-USER-ID TO USER-SAVE.

3787 3296-200 3-29


Closing a Conversation (OSI$CLOSE)

3.4. Closing a Conversation (OSI$CLOSE)


Use the OSI$CLOSE function call to request normal termination of a conversation. Your
program must:

$ Possess all available tokens


$ Not be waiting for a response from the peer program to a previous request
$ Not have an activity in progress

The following chart indicates the relationship of token availability and the functional units
selected during conversation establishment.

Token Available Functional Unit Selected

OSI-DATA-TOKEN FUNC-UNIT-HALF-DUPLEX

OSI-SYNC-MINOR-TOKEN FUNC-UNIT-MINOR-SYNC

OSI-ACT-MAJOR-TOKEN FUNC-UNIT-ACT-MGT

3.4.1. OSI$CLOSE Format


COPY OSI-CLOSE.

or
CALL 'OSI$CLOSE' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$CLOSE request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a close permits you to send a message along with the
close request. OSI-MSG-BUFFER is the default name. You can specify your own name in
the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-30 3787 3296-200


Closing a Conversation (OSI$CLOSE)

3.4.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$CLOSE function call uses the following
status packet parameters:

Table 3-9. OSI-STATUS-PKT Parameters for OSI$CLOSE

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-31


Closing a Conversation (OSI$CLOSE)

3.4.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$CLOSE function call. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the user-information
parameter of the RLRQ-apdu in ISO 8650 Protocol specification for the Association
Control Service Element. It should be encoded according to ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
encodes and what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-
DDP-PPC information [30] length

encoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
encoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]
Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3-32 3787 3296-200


Closing a Conversation (OSI$CLOSE)

3.4.4. OSI-DATA-PKT

Table 3-10. OSI-DATA-PKT Parameters for OSI$CLOSE

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
Section 3.11for additional information on application presentation
packet context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes. This
is called padding the data and is necessary to send nine-bit bytes
over communication networks that only support eight-bit bytes. The
user must encode the ASN.1 EXTERNAL type as part of user data.

continued

3787 3296-200 3-33


Closing a Conversation (OSI$CLOSE)

Table 3-10. OSI-DATA-PKT Parameters for OSI$CLOSE (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
ASN.1 EXTERNAL type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a
limit of 10240 bytes of session data enforced by OSI session
protocol. In either case, all user data and additional protocol
header information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD)

3-34 3787 3296-200


Closing a Conversation (OSI$CLOSE)

3.4.5. OSI$CLOSE Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC.

8. Issue the function. COPY OSI-CLOSE.

3787 3296-200 3-35


Closing a Conversation (OSI$CLOSE)

3.4.6. OSI$CLOSE Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE CLOSE-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set the output message buffer area.

10. Put the message in the output buffer. MOVE CLOSE-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

11. Issue the function. COPY OSI-CLOSE.

3-36 3787 3296-200


Accepting a Close Request (OSI$CLRESP)

3.5. Accepting a Close Request (OSI$CLRESP)


Use the OSI$CLRESP function to respond to a close request. This closes the connection
normally on both sides.

3.5.1. OSI$CLRESP Format


COPY OSI-CLRESP.

or
CALL 'OSI$CLRESP' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$CLRESP request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a OSI$CLRESP function call permits you to send a
message along with the close response request. OSI-MSG-BUFFER is the default name.
You can specify your own name in the working-storage section for this area, but because
the USING clause contains positional parameters, the name you specify must be the
second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3787 3296-200 3-37


Accepting a Close Request (OSI$CLRESP)

3.5.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$CLRESP function call uses the following
status packet parameters:

Table 3-11. OSI-STATUS-PKT Parameters for OSI$CLRESP

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3-38 3787 3296-200


Accepting a Close Request (OSI$CLRESP)

3.5.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$CLRESP function call. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the user-information
parameter of the RLRE-apdu in the ISO 8650 Protocol specification for the Association
Control Service Element. It should be encoded according to ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
encodes and what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-
DDP-PPC information [30] length

encoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
encoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3787 3296-200 3-39


Accepting a Close Request (OSI$CLRESP)

3.5.4. OSI-DATA-PKT

Table 3-12. OSI-DATA-PKT Parameters for OSI$CLRESP

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
3.11 for additional information on application presentation packet
context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes. This
is called padding the data and is necessary to send nine-bit bytes
over communication networks that only support eight-bit bytes. The
user must encode the ASN.1 EXTERNAL type as part of user data.

continued

3-40 3787 3296-200


Accepting a Close Request (OSI$CLRESP)

Table 3-12. OSI-DATA-PKT Parameters for OSI$CLRESP (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
ASN.1 EXTERNAL type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a
limit of 10240 bytes of session data enforced by OSI session
protocol. In either case, all user data and additional protocol
header information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

3787 3296-200 3-41


Accepting a Close Request (OSI$CLRESP)

3.5.5. OSI$CLRESP Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC.

8. Issue the function. COPY OSI-CLRESP.

3-42 3787 3296-200


Accepting a Close Request (OSI$CLRESP)

3.5.6. OSI$CLRESP Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE CLRESP-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set the output message buffer area.

10. Put the message in the output buffer. MOVE CLRESP-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

11. Issue the function. COPY OSI-CLRESP.

3787 3296-200 3-43


Sending Capability Data (OSI$CPDATA)

3.6. Sending Capability Data (OSI$CPDATA)


Use the OSI$CPDATA function call to send capability data to a peer program. When the
peer program successfully receives a capability data transfer, it must issue a capability
data response.

The OSI$CPDATA function call is only allowed if the following set of conditions is true:

$ The activity management functional unit (FUNC-UNIT-ACT-MGT) and the capability


data functional unit (FUNC-UNIT-CAP-DATA) were selected.
$ The program possesses the OSI-ACT-MAJOR-TOKEN.
$ No activity is currently in progress.
$ The full duplex functional unit (FUNC-UNIT-DUPLEX) was selected
or
the half-duplex functional unit (FUNC-UNIT-HALF-DUPLEX) was selected and the
program possesses the data token.
$ The minor synchronize functional unit (FUNC-UNIT-MINOR-SYNC) was not selected
or
the minor synchronize functional unit was selected and the program possesses the
OSI-SYNC-MINOR-TOKEN.

3.6.1. OSI$CPDATA Format


COPY OSI-CPDATA.

or
CALL 'OSI$CPDATA' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$CPDATA request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an OSI$CPDATA function call permits you to send
capability data that you have placed in this area. OSI-MSG-BUFFER is the default name.
You can specify your own name in the working-storage section for this area, but because
the USING clause contains positional parameters, the name you specify must be the
second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-44 3787 3296-200


Sending Capability Data (OSI$CPDATA)

3.6.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$CPDATA function call uses the following
status packet parameters:

Table 3-13. OSI-STATUS-PKT Parameters for OSI$CPDATA

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are using.
This value must be 1538 for this release. This value is set automatically if
you use the COPY verb format. If you use the function call format, you must
set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies this


application program. This value must remain unchanged as long as this
application program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-45


Sending Capability Data (OSI$CPDATA)

3.6.3. OSI-MSG-BUFFER Area


This is a storage area for user data sent with the OSI$CPDATA function call. It is specified
in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the User-data parameter of
the presentation protocol data unit TC PPDU. It should be encoded according to the rules
specified in ISO 8823, Connection oriented presentation protocol specification, for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-46 3787 3296-200


Sending Capability Data (OSI$CPDATA)

3.6.4. OSI-DATA-PKT

Table 3-14. OSI-DATA-PKT Parameters for OSI$CPDATA

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
3.11 for additional information on application presentation packet
context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the presentation layer User-data type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the presentation layer User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the presentation layer User-data type
as part of user data.

continued

3787 3296-200 3-47


Sending Capability Data (OSI$CPDATA)

Table 3-14. OSI-DATA-PKT Parameters for OSI$CPDATA (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
presentation layer User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a
limit of 10240 bytes of session data enforced by OSI session
protocol. In either case, all user data and additional protocol
header information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-FLWCTL-WAIT The amount of time DDP-PPC attempts to send the message


before returning control to the program. Sometimes DDP-PPC
cannot send a message because flow control conditions in the
network prevent it from transferring any data for this connection.
DDP-PPC attempts to send the message until the flow control
conditions no longer occur or the time specified in this field
elapses. If the time elapses, DDP-PPC returns an output flow
control timeout status indicating the message was not sent.
$ A positive value indicates the number of seconds to wait.
$ 0 indicates DDP-PPC does not attempt to resend the message
but returns control to the program immediately.
$ A negative value indicates DDP-PPC attempts to send the
message indefinitely.

continued

3-48 3787 3296-200


Sending Capability Data (OSI$CPDATA)

Table 3-14. OSI-DATA-PKT Parameters for OSI$CPDATA (cont.)

Parameter Description

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for the


conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an OSI$RECEIVE
function.
This parameter can be used for programs executing in full duplex
to determine when an OSI$RECEIVE function should be issued.

3787 3296-200 3-49


Sending Capability Data (OSI$CPDATA)

3.6.5. OSI$CPDATA Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

8. Set flow control wait time. MOVE 100 TO OSI-FLWCTL-WAIT.

Call DDP-PPC.

9. Issue the function. COPY OSI-CPDATA.

3-50 3787 3296-200


Sending Capability Data (OSI$CPDATA)

3.6.6. OSI$CPDATA Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE CPDATA-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

10. Set flow control wait time. MOVE 100 TO OSI-FLWCTL-WAIT.

Set the output message buffer area.

11. Put the message in the output buffer. MOVE CPDATA-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

12. Issue the function. COPY OSI-CPDATA.

3787 3296-200 3-51


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7. Sending a Response to Capability Data


Received (OSI$CPRESP)
Use the OSI$CPRESP function to respond to capability data received. The response
affirms the successful receipt of the capability data transfer.The OSI$CPRESP function call
is only allowed if the following set of conditions is true:

$ The activity management functional unit (FUNC-UNIT-ACT-MGT) and the capability


data functional unit (FUNC-UNIT-CAP-DATA) were selected.
$ The program received a capability data message (OSI-MSG-TYPE = 15,
OSI-MSG-CPDATA).

3.7.1. OSI$CPRESP Format


COPY OSI-CPRESP.

or
CALL 'OSI$CPRESP' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$CPRESP request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a OSI$CPRESP function call permits you to send a
message along with the capability data received response. OSI-MSG-BUFFER is the default
name. You can specify your own name in the working-storage section for this area, but
because the USING clause contains positional parameters, the name you specify must be
the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-52 3787 3296-200


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$CPRESP function call uses the following
status packet parameters:

Table 3-15. OSI-STATUS-PKT Parameters for OSI$CPRESP

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are using.
This value must be 1538 for this release. This value is set automatically if
you use the COPY verb format. If you use the function call format, you must
set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies this


application program. This value must remain unchanged as long as this
application program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-53


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$CPRESP function call. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the User-data parameter of
the presentation protocol data unit TCC PPDU. It should be encoded according to the rules
specified in ISO 8823, Connection-oriented presentation protocol specification, for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-54 3787 3296-200


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7.4. OSI-DATA-PKT

Table 3-16. OSI-DATA-PKT Parameters for OSI$CPRESP

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
3.11 for additional information on application presentation packet
context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the presentation layer User-data type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the presentation layer User-data type as part of user data.

continued

3787 3296-200 3-55


Sending a Response to Capability Data Received (OSI$CPRESP)

Table 3-16. OSI-DATA-PKT Parameters for OSI$CPRESP (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the presentation layer User-data type
as part of user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
presentation layer User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data. However,
this data type can only be used with non-OS 2200 hosts if they
support session segmentation.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a
limit of 10240 bytes of session data enforced by OSI session
protocol. In either case, all user data and additional protocol
header information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

continued

3-56 3787 3296-200


Sending a Response to Capability Data Received (OSI$CPRESP)

Table 3-16. OSI-DATA-PKT Parameters for OSI$CPRESP (cont.)

Parameter Description

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for the


conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an OSI$RECEIVE
function.
This parameter can be used for programs executing in full duplex
to determine when an OSI$RECEIVE function should be issued.

3787 3296-200 3-57


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7.5. OSI$CPRESP Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC.

8. Issue the function. COPY OSI-CPRESP.

3-58 3787 3296-200


Sending a Response to Capability Data Received (OSI$CPRESP)

3.7.6. OSI$CPRESP Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE CPRESP-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set the output message buffer area.

10. Put the message in the output buffer. MOVE CPRESP-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

11. Issue the function. COPY OSI-CPRESP.

3787 3296-200 3-59


Creating a New DDP-PPC Dump File (OSI$DUMP)

3.8. Creating a New DDP-PPC Dump File


(OSI$DUMP)
You can issue an OSI$DUMP function at any time to write a DDP-PPC dump file
DDP$DUMP*mm-dd-hhmmss. The file name prints in the PRINT$ file of the calling run.

3.8.1. OSI$DUMP Format


COPY OSI-DUMP.

or
CALL 'OSI$DUMP' USING OSI-STATUS-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$DUMP request, DDP-PPC returns the status codes for you to test.

3-60 3787 3296-200


Creating a New DDP-PPC Dump File (OSI$DUMP)

3.8.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$DUMP function call uses the following
status packet parameters:

Table 3-17. OSI-STATUS-PKT Parameters for OSI$DUMP

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are using.
This value must be 1538 for this release. This value is set automatically if
you use the COPY verb format. If you use the function call format, you must
set this value using a standard COBOL statement.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3.8.3. OSI$DUMP Example

Procedure Typical COBOL Procedure Division Statements

Call DDP-PPC.

Issue the function. COPY OSI-DUMP.

3787 3296-200 3-61


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9. Passing Control to a Peer Host (OSI$GVCNTRL)


Use the OSI$GVCNTRL function to give the entire set of available tokens to the peer
program. This function must be followed by an OSI$RECEIVE of an OSI-NO-INDICATION
message type before functions such as OSI$CLOSE, OSI$RESYNC, and OSI$XRPT will
work.

The OSI$GVCNTRL function call is only allowed if the following set of conditions is true:

$ The activity management functional unit (FUNC-UNIT-ACT-MGT) was selected.


$ No activity is currently in progress.
$ At least one of the available tokens belongs to this program.

The following chart indicates the relationship of token availability and the functional units
selected during conversation establishment.

Token Available Functional Unit Selected

DATA-TOKEN FUNC-UNIT-HALF-DUPLEX

SYNC-MINOR-TOKEN FUNC-UNIT-MINOR-SYNC

ACT-MAJOR-TOKEN FUNC-UNIT-ACT-MGT

If you selected OSI-SESSION-VERSION-1, no data can be sent with this function. If you
selected OSI-SESSION-VERSION-2, then up to 10240 bytes of data can be sent.

3.9.1. OSI$GVCNTRL Format


COPY OSI-GVCNTRL.

or
CALL 'OSI$GVCNTRL' USING OSI-STATUS-PKT OSI-MSG-BUFFER OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an OSI$GVCNTRL function call permits you to send a
message along with the request. OSI-MSG-BUFFER is the default name. You can specify
your own name in the working-storage section for this area, but because the USING clause
contains positional parameters, the name you specify must be the second parameter in the
clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-62 3787 3296-200


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$GVCNTRL function call uses the following
status packet parameters:

Table 3-18. OSI-STATUS-PKT Parameters for OSI$GVCNTRL

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you are
using. This value must be 1538 for this release. This value is set
automatically if you use the COPY verb format. If you use the function call
format, you must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies this


application program. This value must remain unchanged as long as this
application program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no additional


information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-63


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9.3. OSI-MSG-BUFFER Area


If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer give control service request. It should be encoded according to the rules
specified in ISO 8823 Connection-oriented presentation protocol specification for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-64 3787 3296-200


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9.4. OSI-DATA-PKT

Table 3-19. OSI-DATA-PKT Parameters for OSI$GVCNTRL

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
3.11 for additional information on application presentation packet
context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the presentation layer User-data type as part of user data.

continued

3787 3296-200 3-65


Passing Control to a Peer Host (OSI$GVCNTRL)

Table 3-19. OSI-DATA-PKT Parameters for OSI$GVCNTRL (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the presentation layer User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the presentation layer User-data type
as part of user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
presentation layer User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data. However,
this data type can only be used with non-OS 2200 hosts if they
support session segmentation.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, you must set this field to 0. If you selected session
version 2, there is a limit of 10240 bytes of session data enforced
by OSI session protocol. This means that all user data and
additional protocol header information generated by DDP-PPC
cannot exceed the 10240-byte limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

continued

3-66 3787 3296-200


Passing Control to a Peer Host (OSI$GVCNTRL)

Table 3-19. OSI-DATA-PKT Parameters for OSI$GVCNTRL (cont.)

Parameter Description

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE.
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE.
A message can be received by issuing an OSI$RECEIVE
function.
This parameter can be used for programs executing in full duplex
to determine when an OSI$RECEIVE function should be issued.

3787 3296-200 3-67


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9.5. OSI$GVCNTRL Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

Call DDP-PPC.

5. Issue the function. COPY OSI-GVCNTRL.

3-68 3787 3296-200


Passing Control to a Peer Host (OSI$GVCNTRL)

3.9.6. OSI$GVCNTRL Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE GVCNTRL-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

Set the output message buffer area.

7. Put the message in the output buffer. MOVE GVCNTRL-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

8. Issue the function. COPY OSI-GVCNTRL.

3787 3296-200 3-69


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10. Passing Tokens to a Peer Host


(OSI$GVTOKEN)
Use the OSI$GVTOKEN function to pass tokens available to this connection and this
program to the peer program. The following chart indicates the relationship of token
availability and the functional units selected during conversation establishment.

Token Available Functional Unit Selected

OSI-DATA-TOKEN FUNC-UNIT-HALF-DUPLEX

OSI-SYNC-MINOR-TOKEN FUNC-UNIT-MINOR-SYNC

OSI-ACT-MAJOR-TOKEN FUNC-UNIT-ACT-MGT

3.10.1. OSI$GVTOKEN Format


COPY OSI-GVTOKEN.

or
CALL 'OSI$GVTOKEN' USING OSI-STATUS-PKT OSI-MSG-BUFFER OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$GVTOKEN request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an OSI$GVTOKEN function call permits you to send a
message along with the tokens. OSI-MSG-BUFFER is the default name. You can specify
your own name in the working-storage section for this area, but because the USING clause
contains positional parameters, the name you specify must be the second parameter in the
clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-70 3787 3296-200


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$GVTOKEN function call uses the following
status packet parameters:

Table 3-20. OSI-STATUS-PKT Parameters for OSI$GVTOKEN

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-71


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$GVTOKEN function. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer give tokens service request. It should be encoded according to the rules
specified in ISO 8823 Connection-oriented presentation protocol specification for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-72 3787 3296-200


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10.4. OSI-DATA-PKT

Table 3-21. OSI-DATA-PKT Parameters for OSI$GVTOKEN

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
3.11 for additional information on application presentation packet
context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12)
for information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the presentation layer User-data type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the presentation layer User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the presentation layer User-data type
as part of user data.

continued

3787 3296-200 3-73


Passing Tokens to a Peer Host (OSI$GVTOKEN)

Table 3-21. OSI-DATA-PKT Parameters for OSI$GVTOKEN (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
presentation layer User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data. However,
this data type can only be used with non-OS 2200 hosts if they
support session segmentation.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, you must set this field to 0. If you selected session
version 2, there is a limit of 10240 bytes of session data enforced
by OSI session protocol. This means that all user data and
additional protocol header information generated by DDP-PPC
cannot exceed the 10240-byte limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Available to pass only if half-duplex is selected for the connection.


Valid values are:
$ 0uDo not pass the token to the peer program.
$ 1uPass the token to the peer program.

OSI-SYNC-MINOR-TOKEN Available to pass only if minor synchronize is selected for the


connection. Valid values are:
$ 0uDo not pass the token to the peer program.
$ 1uPass the token to the peer program.

continued

3-74 3787 3296-200


Passing Tokens to a Peer Host (OSI$GVTOKEN)

Table 3-21. OSI-DATA-PKT Parameters for OSI$GVTOKEN (cont.)

Parameter Description

OSI-ACT-MAJOR-TOKEN Available to pass only if activity management is selected for the


connection. Valid values are:
$ 0uDo not pass the token to the peer program.
$ 1uPass the token to the peer program.

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for the


conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE.
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE.
A message can be received by issuing an OSI$RECEIVE
function.
This parameter can be used for programs executing in full duplex
to determine when an OSI$RECEIVE function should be issued.

3787 3296-200 3-75


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10.5. OSI$GVTOKEN Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to PASS. MOVE 1 TO OSI-DATA-TOKEN.

6. Set the synchronization minor token to MOVE 1 TO OSI-SYNC-MINOR-TOKEN.


PASS.

7. Set the activity major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC.

8. Issue the function. COPY OSI-GVTOKEN.

3-76 3787 3296-200


Passing Tokens to a Peer Host (OSI$GVTOKEN)

3.10.6. OSI$GVTOKEN Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE GVTOKEN-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to PASS. MOVE 1 TO OSI-DATA-TOKEN.

8. Set the synchronization minor token to MOVE 1 TO OSI-SYNC-MINOR-TOKEN.


PASS.

9. Set the activity major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set the output message buffer area.

10. Put the message in the output buffer. MOVE GVTOKEN-MSG TO OSI-BUFFER.

Call DDP-PPC.

11. Issue the function. COPY OSI-GVTOKEN.

3787 3296-200 3-77


Opening a Conversation (OSI$OPEN)

3.11. Opening a Conversation (OSI$OPEN)


Use this function to:

$ Initiate a connection between the calling program and a peer program


$ Establish presentation contexts
$ Determine the session version
$ Select session or application layer services

3.11.1. OSI$OPEN Format


COPY OSI-OPEN.

or
CALL 'OSI$OPEN' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-CONNECT OSI-APPL-PRES-PKT
OSI-ADDRESS-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$OPEN request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an open permits you to send a message along with the
open request. OSI-MSG-BUFFER is the default name. You can specify your own name in
the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and information concerning the data to be sent.

The OSI-CONNECT-PKT parameter references the connect packet statements for all
information necessary to establish a connection with a peer program.

The OSI-APPL-PRES-PKT parameter references the application presentation packet. It is


only used when the application layer is selected. It contains information necessary for
opening connections between application layer entities and information for presentation
contexts.

The OSI-ADDRESS-PKT parameter references the data packet that contains addressing
information necessary to establish a connection with a peer program.

3-78 3787 3296-200


Opening a Conversation (OSI$OPEN)

3.11.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$OPEN function call uses the following
status packet parameters:

Table 3-22. OSI-STATUS-PKT Parameters for OSI$OPEN

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 or
1539 for this release. This value is set automatically to
1538 if you use the COPY verb format. If you use the
function call format, you must set this value using a
standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Notes:

$ The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.


$ To set the OSI-VERSION parameter to 1539 when using the COPY verb format, you
must use the COBOL replacing keyword as part of the COPY statement. For example:
copy osi-open replacing ==1538 == by ==1539==.
$ Use version 1539 if you need to use the CALLED-TRANSPORT parameter of the
0SI-ADDRESS-PKT.

3787 3296-200 3-79


Opening a Conversation (OSI$OPEN)

3.11.3. OSI-MSG-BUFFER Area


This is a storage area for user data sent with the OSI$OPEN function call. It is specified in
the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the user-information
parameter of the AARQ-apdu in ISO 8650 Protocol specification for the Association
Control Service Element. It should be encoded according to ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
encodes and what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-
DDP-PPC information [30] length

encoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
encoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]
Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3-80 3787 3296-200


Opening a Conversation (OSI$OPEN)

3.11.4. OSI-DATA-PKT

Table 3-23. OSI-DATA-PKT Parameters for OSI$OPEN

Parameter Description

Values Set by User

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding, set
this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set to 134
or 140 for connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract and
transfer syntaxes that those hosts will probably not recognize. See
"OSI-APPL-PRES-PKT" later in this subsection for additional
information on application presentation packet context table
syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See "OSI-APPL-PRES-PKT" later in this
subsection for details about syntax selection. See the
OSI-APPL-PRES-PKT (3.12) for information about negotiating
syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes. This
is called padding the data and is necessary to send nine-bit bytes
over communication networks that only support eight-bit bytes. The
user must encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it
treats the data type as a 138 type. The user must encode the
ASN.1 EXTERNAL type as part of user data.

continued

3787 3296-200 3-81


Opening a Conversation (OSI$OPEN)

Table 3-23. OSI-DATA-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any
additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This
data type does not require any additional protocol to be encoded
as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter
to a multiple of 4. A value of 0 indicates the first byte of the buffer
is to be used. DDP-PPC ignores this parameter if the
OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a
limit of 10240 bytes of session data enforced by OSI session
protocol. In either case, all user data and additional protocol
header information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN This parameter determines which application program can send


data in a half-duplex connection. DDP-PPC uses this parameter only
if it proposes the half-duplex functional unit
(FUNC-UNIT-HALF-DUPLEX = 1) or the default functional units. (See
OSI-FUNC-UNITS-SELECTED in the CONNECT packet.)
Determine the initial setting by selecting one of the following
values:
$ 0 OSI-DATA-HOLD
This program holds the token.
$ 1 OSI-DATA-PASS
The token is passed to the peer program.
$ 2 OSI-DATA-CHOICE
The peer program has the choice to pass or hold the token.

continued

3-82 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-23. OSI-DATA-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-SYNC-MINOR-TOKEN This parameter determines which application program can initiate


minor synchronization points. DDP-PPC uses this parameter only if
it proposes the minor synchronization function unit
(FUNC-UNIT-MINOR-SYNC = 1) or the default functional units. (See
OSI-FUNC-UNITS-SELECTED in the CONNECT packet.)
Determine the initial setting by selecting one of the following
values:
$ 0 OSI-SYNC-MINOR-HOLD
This program holds the token.
$ 1 OSI-SYNC-MINOR-PASS
The token is passed to the peer program.
$ 2 OSI-SYNC-MINOR-CHOICE
The peer program has the choice to pass or hold the token.

OSI-ACT-MAJOR-TOKEN This parameter determines which application program controls the


initiation and termination of activities. DDP-PPC uses this
parameter only if it proposes the activity management functional
unit (FUNC-UNIT-ACT-MGT = 1) or the default functional units. (See
OSI-FUNC-UNITS-SELECTED in the CONNECT packet.)
Determine the initial setting by selecting one of the following
values:
$ 0 OSI-ACT-MAJOR-HOLD
This program holds the token.
$ 1 OSI-ACT-MAJOR-PASS
The token is passed to the peer program.
$ 2 OSI-ACT-MAJOR-CHOICE
The peer program has the choice to pass or hold the token.

continued

3787 3296-200 3-83


Opening a Conversation (OSI$OPEN)

Table 3-23. OSI-DATA-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-SYNC-POINT- The proposed initial minor synchronization point serial number,


SERIAL-NUMBER which identifies a value for the initial synchronization point
(checkpoint) in a connection. DDP-PPC uses this parameter only if
it proposes the minor synchronize functional unit
(FUNC-UNIT-MINOR-SYNC) or the resynchronize functional unit
(FUNC-UNIT-RESYNC).
The value must be in the range from 0 to 999999.
Note: If the activity management functional unit
(FUNC-UNIT-ACT-MGT) is selected (agreed upon by both
programs), or the minor synchronize
(FUNC-UNIT-MINOR-SYNC) or resynchronize
(FUNC-UNIT-RESYNC) functional unit is not selected,
DDP-PPC ignores the original value of this parameter and
sets it to 0 upon the successful receipt of the response
to this open request.

As a user option, you can propose an initial serial number


even if DDP-PPC proposes the activity management
functional unit, provided DPP-PPC also proposes the
minor synchronize or resynchronize functional unit.

Values Returned by DDP-PPC

OSI-CONNECTION DDP-PPC returns this value on completion of the OSI$OPEN


function call. This value identifies the connection and must be used
on all subsequent function calls for this connection.

3-84 3787 3296-200


Opening a Conversation (OSI$OPEN)

3.11.5. OSI-CONNECT-PKT

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN

Parameter Description

Values Set by User

OSI-TRANSPORT-CLASS Determines the preferred transport class of service. The CLASS


values depend on the communications network and the transport
service providers. The higher the value, the more services the
transport layer provides. The protocol supports downward
negotiation of this parameter, so the transport service providers
actually determine the class used based on Table 3-25.
Valid values for X.25 connections are:
$ 0 Provides the simplest class of transport connection.
$ 2 Provides a way to multiplex several transport connections
onto a single network connection.
$ 4 Provides the functionality of Class 2 and the ability to
recover from network disconnection or reset, and to detect
and recover from errors due to a low grade of network
services.
The valid value for X.25 and 802.3 connections is:
20 Provides the functionality of Class 4 across a connectionless
network service with the added features of internet protocol, which
allows communication on a local area network (LAN) or X.25.
The valid value for TCP/IP connections is:
32 TCP/IP Transport Services should be used instead of OSI
Transport Services.
The valid value for local connections is:
99 The peer program is running on the local host.

OSI-TRANSPORT-CLASS-ALT Determines the alternate transport class of service if both


transport service providers cannot support the preferred transport
service class. See Table 3-25.
If you enter a value of 32 for OSI-TRANSPORT-CLASS, also enter a
value of 32 for this parameter.
If you enter a value of 99 for OSI-TRANSPORT-CLASS, also enter a
value of 99 for this parameter.

continued

3787 3296-200 3-85


Opening a Conversation (OSI$OPEN)

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-TRANSPORT-FACILITIES The transport services to be negotiated by the transport service


providers for this connection. To determine the value of this field,
select from the following list of services and add together the
values corresponding to each of the services selected.
$ 1 Use of transport-expedited data transfer services.
Transport-expedited data is permitted for specific session
messages such as abort, resynchronization, and certain
activity management functions. The use of expedited data is
transparent to the DDP-PPC user. The only noticeable result of
transport-expedited data is a higher probability of receiving a
NO-INDICATION message on a receive function call. In this
case, another receive should be issued.
$ 2 Prohibits the use of 16-bit checksum in Class 4.
Checksum processing validates the data being transferred
across the communication line but reduces throughput. You
must determine when to use checksum based on your
knowledge of the reliability of the communication line and your
requirement for faster throughput. Most networks do not
require checksum because they are very reliable, therefore
eliminating the need for extra integrity checking at the
transport layer.
$ 16 Prohibits the use of flow control in Class 2.
This service is normally not selected (that is, use explicit flow
control in Class 2).
$ 32 Use of extended formats in Classes 2 and 4. If you do not
select this service, the transport service providers use the
normal formats service in all classes.
This service is normally selected (that is, use extended
formats in Classes 2 and 4).
Values typically set for transport facilities are:
$ 32 Extended formats and 16-bit checksum.
$ 33 Extended formats, 16-bit checksum, and expedited data.
$ 34 Extended formats only.
$ 35 Extended formats and expedited data.

continued

3-86 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-SERVICE-ENTRY Sets the interface level for the OSI connection. Valid values are:
$ 5 The session level.
If you select the session level, it is assumed that application
and presentation protocols are not required or will be supplied
by your program in the OSI-MSG-BUFFER area.
$ 7 The application level.

OSI-SESSION-VERSION Indicates the versions of the session layer protocol you propose
for this connection. Move a 1 into the specific version(s) you want
OSI-SESSION-VERSION-1
to propose. If you propose more than one version, the version
selected is the highest both you and the peer program proposed.
OSI-SESSION-VERSION-2
If you do not propose a version, DDP-PPC proposes version 1.

Note: If version 1 is one of the proposed versions, then a


maximum of 512 bytes can be sent on the open request.
If only version 2 is proposed, then a maximum of 10240
bytes of data can be sent on the open request.

OSI-FUNC-UNITS-SELECTED The OSI functionality this program proposes to use. Each


functional unit provides a specific subset of the entire OSI
functionality (for example, the half-duplex functional unit provides
the ability to perform two-way alternate communication).
$ 0 The specific functional unit data names you do not want the
program to propose.
$ 1 The specific functional data names you want the program
to propose.
Both this program and the peer program must propose a functional
unit in order to use the functionality that the unit provides.

continued

3787 3296-200 3-87


Opening a Conversation (OSI$OPEN)

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED
(cont.)

v FUNC-UNIT-TYPED-DATA Allows for the transfer of data in a manner that is not subject to the
control imposed by the availability of the data token.

v FUNC-UNIT-EXCEPTIONS Allows for the reporting of detected errors without aborting the
connection.

v FUNC-UNIT-CAP-DATA Allows for the confirmed transfer of data when the activity
(capability data) management functional unit has been selected but no activity is in
progress.

v FUNC-UNIT-ACT-MGT (activity Allows for the management of synchronized logical pieces of work.
management)
v FUNC-UNIT-RESYNC Allows for modification of synchronization point serial numbers and
(resynchronize) reassignment of tokens.

v FUNC-UNIT-MINOR-SYNC Allows for the placement of minor synchronization points, identified


by serial numbers, in the normal data flow.

v FUNC-UNIT-DUPLEX Allows for the uncontrolled right to send data.

v FUNC-UNIT-HALF-DUPLEX Allows for the controlled right to send data.

continued

3-88 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED
(cont.)

v FUNC-UNIT-DATA-SEP (data Allows for the protection of data in the event of resynchronization.
separation)

The following rules apply when proposing functional units for the
OSI$OPEN function:
$ You can only propose FUNC-UNIT-CAP-DATA if you also
propose FUNC-UNIT-ACT-MGT.
$ You can only propose FUNC-UNIT-EXCEPTIONS if you also
propose FUNC-UNIT-HALF-DUPLEX.
$ You can only propose FUNC-UNIT-DATA-SEP if you also
propose FUNC-UNIT-MINOR-SYNC.
$ You must propose one or both of the duplex and half-duplex
functional units (FUNC-UNIT-HALF-DUPLEX and
FUNC-UNIT-DUPLEX) on the OSI$OPEN request unless you do
not propose any functional units. If you do not propose any
functional unit, the half-duplex functional unit is the default.
If you do not propose any functional units, DDP-PPC does not
encode this parameter. As a result, the session services provider
(DDP-PPC) on the remote host proposes the OSI-defined default
value for functional units on your behalf. It appears to the peer
program as though you proposed those functional units. The
default includes the following functional units:
$ FUNC-UNIT-HALF-DUPLEX
$ FUNC-UNIT-MINOR-SYNC
$ FUNC-UNIT-ACT-MGT
$ FUNC-UNIT-CAP-DATA
$ FUNC-UNIT-EXCEPTIONS

SCI-CALLING-REFERENCE- LEN The length, in bytes, of data entered in the


SCI-CALLING-REFERENCE parameter. It can be in the range 0 to
64. Since the SCI-CALLING-REFERENCE parameter is optional, a
value of 0 indicates that DDP-PPC should not encode and pass that
parameter.

SCI-COMMON-REFERENCE- LEN The length, in bytes, of data entered in the


SCI-COMMON-REFERENCE parameter. It can be in the range 0 to
64. Since the SCI-COMMON-REFERENCE parameter is optional, a
value of 0 indicates that DDP-PPC should not encode and pass that
parameter.

continued

3787 3296-200 3-89


Opening a Conversation (OSI$OPEN)

Table 3-24. OSI-CONNECT-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

SCI-ADDITIONAL- The length, in bytes, of data entered in the


REFERENCE-LEN SCI-ADDITIONAL-REFERENCE parameter. It can be in the range 0
to 4. Since the SCI-ADDITIONAL-REFERENCE parameter is optional,
a value of 0 indicates that DDP-PPC should not encode and pass
that parameter.

OSI-CN-SESSION- The three fields for this parameter are user-defined. DDP-PPC
CONNECTION-ID passes the contents of each of these fields to the peer program
unless you set the respective reference length field to 0.
v SCI-CALLING- REFERENCE
v SCI-COMMON- REFERENCE
v SCI-ADDITIONAL-
REFERENCE

Values Returned by DDP

DDP-PPC returns the following parameters if the OSI-CALLED-AE-TITLE-ALIAS parameter in the


ADDRESS packet is not set to spaces. DDP-PPC uses that field to obtain the information from an
APPLICATION ENTITY record in the Configuration Services database with the same name.

OSI-TRANSPORT- CLASS The value of the transport-class keyword as set in the


Configuration Services database.

OSI-TRANSPORT- CLASS-ALT The value of the alt-transport-class keyword as set in the


Configuration Services database.

OSI-TRANSPORT- FACILITIES The value for the transport facilities as set in the Configuration
Services database.

Note: If you use the OSI-CALLED-AE-TITLE-ALIAS form in the OSI-ADDRESS-PKT,


the OSI-TRANSPORT-CLASS, OSI-TRANSPORT-CLASS-ALT, and
OSI-TRANSPORT-FACILITIES parameters have no effect here. They default to
the values specified in the Configuration Services database.

3-90 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-25. Alternate Class Transports

Preferred Alternate Class


Class

0 2 4 20

0 Class 0 Not Valid Not Valid Not Valid

2 Class 2 or 0 Class 2 Not Valid Not Valid

4 Class 4, 2, or 0 Class 4 Class 4 Not Valid

20 Not Valid Not Valid Not Valid Class 20

3787 3296-200 3-91


Opening a Conversation (OSI$OPEN)

3.11.6. OSI-APPL-PRES-PKT

Table 3-26. OSI-APPL-PRES-PKT Parameters for OSI$OPEN

Parameter Description

Values Set by User

OSI-APPL-CONTEXT-NAME-ALIAS The user-defined name for an APPLICATION CONTEXT


record in the Configuration Services database. DDP-PPC
uses the record contents to obtain the actual Application
Context Identifier from the Configuration Services database
and pass it to the peer program. If you set this parameter to
spaces, DDP-PPC does not attempt to use the Configuration
Services database. Instead, it uses the contents of the
OSI-APPL-CONTEXT-NAME parameter.

OSI-APPL-CONTEXT-NAME The actual Application Context Identifier. This field identifies


a set of services being used by an application entity. This
parameter is negotiated during connection establishment.
The peer program can override the value proposed on the
open request. The value the peer program selects is used
for the connection.
Only the user program uses the actual contents of this
parameter. DDP-PPC does not validate or use the contents.
The format of this parameter should be the contents octets
of an ASN.1 object identifier encoded according to ASN.1
Basic Encoding Rules.
DDP-PPC encodes the identifier and length octets for this
parameter. Either OSI-APPL-CONTEXT-NAME-ALIAS or this
parameter must give an application context value to
DDP-PPC.

OSI-APPL-CONTEXT-NAME-LEN The length of the OSI-APPL-CONTEXT-NAME parameter. If


you set OSI-APPL-CONTEXT-NAME-ALIAS to all spaces, this
value must be greater than 0.

OSI-PRES-MODE Must be set to 0 (OSI-PRES-NORMAL-MODE).

OSI-CALLED-P-INVOCATION-ID The invocation (copy) of the Application Process that is the


intended acceptor of the open request. The content of this
parameter must be numeric but its value is user-defined and
has no meaning to DDP-PPC.

OSI-CALLING-P-INVOCATION-ID The invocation (copy) of the Application Process that is the


requestor of the open request. The content of this
parameter must be numeric but its value is user-defined and
has no meaning to DDP-PPC.

continued

3-92 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-26. OSI-APPL-PRES-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLED-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


intended acceptor of the open request. The content of this
parameter must be numeric but its value is user-defined and
has no meaning to DDP-PPC.

OSI-CALLING-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


requestor of the open request. The content of this
parameter must be numeric but its value is user-defined and
has no meaning to DDP-PPC.

OSI-CALLED-P-INVOC-ID-LEN The length of the OSI-CALLED-P-INVOCATION-ID parameter. If


you set this parameter to 0, DDP-PPC will not pass a Called
Application Process Invocation Id parameter to the peer
program.

OSI-CALLING-P-INVOC-ID-LEN The length of the OSI-CALLING-P-INVOCATION-ID parameter.


If you set this parameter to 0, DDP-PPC will not pass a
Calling Application Process Invocation Id parameter to the
peer program.

OSI-CALLED-E-INVOC-ID-LEN The length of the OSI-CALLED-E-INVOCATION-ID parameter. If


you set this parameter to 0, DDP-PPC will not pass a Called
Application Entity Invocation Id parameter to the peer
program.

OSI-CALLING-E-INVOC-ID-LEN The length of the OSI-CALLING-E-INVOCATION-ID parameter.


If you set this parameter to 0, DDP-PPC will not pass a
Calling Application Entity Invocation Id parameter to the peer
program.

OSI-PRES-CONTEXT-TABLE- ENTRIES The number of OSI-PRESENTATION-CONTEXT-TABLE entries


you have entered for this OSI$OPEN function call. Valid
values are 1 through 15. You must make at least one entry
for ACSE protocol. See "Additional Information for the
Application Presentation Packet" later in this section for
more details.

continued

3787 3296-200 3-93


Opening a Conversation (OSI$OPEN)

Table 3-26. OSI-APPL-PRES-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-PRES-CONTEXT-TABLE

v OSI-PRES-CONTEXT-IDENT The presentation context identifier for this abstract and


transfer syntax combination. This value must be used when
this transfer syntax is used to encode a PDU defined by this
abstract syntax. It must be set to an odd integer within the
range -32767 to 32767.

v OSI-ABSTRACT-SYNTAX-ALIAS An alias name for an abstract syntax. DDP-PPC uses this


value to obtain the actual abstract syntax identifier from the
Configuration Services database. This field should be
left-justified and blank-filled.

v OSI-TRANSFER-SYNTAX-ALIAS An alias name for a transfer syntax. DDP-PPC uses this value
to obtain the actual transfer syntax identifier from the
Configuration Services database. This field should be
left-justified and blank-filled.

Values Returned by DDP

DDP-PPC returns the following parameters if the OSI-APPL-CONTEXT-NAME-ALIAS parameter is not set
to spaces. DDP-PPC uses that field to obtain the information from an APPLICATION CONTEXT record
in the Configuration Services database with the same name.

OSI-APPL-CONTEXT-NAME The value of the application context id keyword, as set in the


Configuration Services database. Its format is the contents
octets of an ASN.1 object identifier encoded according to
ASN.1 Basic Encoding Rules.

OSI-APPL-CONTEXT-NAME-LEN The length of the value returned in the


OSI-APPL-CONTEXT-NAME parameter.

3-94 3787 3296-200


Opening a Conversation (OSI$OPEN)

3.11.7. Additional Information for the Application Presentation


Packet
When setting packet fields for the OSI$OPEN function call, consider the following:

$ DDP-PPC uses this packet only when the application layer interface is selected
(CONNECT packet, OSI-SERVICE-ENTRY = 7).
$ You must enter the ALIAS names used in this packet into the DDP-PPC Configuration
Services database before executing this program. See the DDP-PPC Implementation
and Administration Guide for information about using DDP-PPC Configuration
Services.
$ You can only associate a presentation context identifier with a single abstract syntax.
You can perform this association by entering the OSI-PRES-CONTEXT-IDENT and
OSI-ABSTRACT-SYNTAX-ALIAS values in an OSI-PRES-CONTEXT-TABLE entry.
$ To propose more than one transfer syntax for the same abstract syntax, use the same
OSI-ABSTRACT-SYNTAX-ALIAS and OSI-PRES-CONTEXT-IDENT values in multiple
OSI-PRES-CONTEXT-TABLE entries. Vary the OSI-TRANSFER-SYNTAX-ALIAS
parameter for each of those entries.
$ DDP-PPC requires the following entries in the OSI-PRES-CONTEXT-TABLE so that it
can encode and pass ACSE protocol using ASN.1 Basic Encoding Rules as the transfer
syntax:
v OSI-ABSTRACT-SYNTAX-ALIAS must be set to ’ACSE-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS must be set to ’ASN1-TS’.
v OSI-PRES-CONTEXT-IDENT must be set to any user-defined value.
You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.
v OSI-PRES-CONTEXT-TABLE-ENTRIES must be set to at least 1.
$ If either this program or the peer program will use data type 135 when sending any
message across this connection, you must make the following entries in the
OSI-PRES-CONTEXT-TABLE so DDP-PPC can encode or decode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS must be set to ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS must be set to ’DDP-COMPRESS-TS’.
v OSI-PRES-CONTEXT-IDENT must be set to any valid user-defined value.
You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.
$ If either this program or the peer program will use data type 138 when sending any
message across this connection, you must make the following entries in the
OSI-PRES-CONTEXT-TABLE so DDP-PPC can encode or decode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS must be set to ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS must be set to ’DDP-PADDED-TS’.
v OSI-PRES-CONTEXT-IDENT must be set to any valid user-defined value.

3787 3296-200 3-95


Opening a Conversation (OSI$OPEN)

You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.
$ If either this program or the peer program will use data type 139 when sending any
message across this connection, you must make the following entries in the
OSI-PRES-CONTEXT-TABLE so DDP-PPC can encode or decode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS must be set to ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS must be set to ’DDP-COMP-PAD-TS’.
v OSI-PRES-CONTEXT-IDENT must be set to any valid user-defined value.
You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.
$ The 140 data type allows you to send messages consisting of strings of eight-bit bytes.
When you use the 140 data type, DDP-PPC uses the NIST-OIW-ULSIG-AS octet string
for the abstract syntax and encodes the data using ASN.1 Basic Encoding Rules. This
assumes, for encoding purposes, that the user data is one large eight-bit byte octet
string. Since these are ISO-registered abstract and transfer syntaxes, non-OS 2200
systems that support these syntaxes can encode and decode the data, thus allowing
transfer of these messages between OS 2200 and non-OS 2200 systems.
When you use this data type, DDP-PPC encodes all the user data. The program is not
required to encode any of the data in ASN.1 format.
If either this program or the peer program uses data type 140 when sending any
message across this connection, you must make the following entries in the
OSI-PRES-CONTEXT-TABLE so DDP-PPC can encode or decode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OIW-OCTET-AS’
v OSI-TRANSFER-SYNTAX-ALIAS = ’ASN1-TS’
v OSI-PRES-CONTEXT-IDENT must be set to any valid user-defined value.
You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.
$ The 141 data type attempts to compress a message consisting of a string of eight-bit
bytes. When you use this data type, DDP-PPC encodes all the user data. The program is
not required to encode any of the data in ASN.1 format.
If either this program or the peer program uses data type 141 when sending any
message across this connection, you must make the following entries in the
OSI-PRES-CONTEXT-TABLE so DDP-PPC can encode or decode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OIW-OCTET-AS’
v OSI-TRANSFER-SYNTAX-ALIAS = ’DDP-COMPRESS-TS’
v OSI-PRES-CONTEXT-IDENT must be set to any valid user-defined value.
You cannot use this value for any other OSI-PRES-CONTEXT-IDENT value in the
OSI-PRES-CONTEXT-TABLE.

3-96 3787 3296-200


Opening a Conversation (OSI$OPEN)

Notes:

1. When setting presentation context on an OSI$OPEN, be sure to code all contexts to


be used in the connection. For example, code, at a minimum, one context for ACSE
protocol and one for user data.
2. When proposing compressed data types (135, 139, 141), also propose the contexts
for the corresponding non-compressed data types (134, 138, 140). This allows for
the case where DDP-PPC cannot perform compression and must encode the data in
the non-compressed form.
3. If either or both of the octet data types (140, 141) are proposed and accepted,
DDP-PPC restricts the entries in the presentation context table to:

$ The ACSE-required context


$ Any of the DDP-PPC data type contexts (135, 138, 139)
$ The octet data type contexts (140, 141)
These are the only presentation contexts that can be present along with the octet
data contexts.

3787 3296-200 3-97


Opening a Conversation (OSI$OPEN)

3.11.8. OSI-ADDRESS-PKT

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN

Parameter Description

Values Set by User

OSI-CALLING-AE-TITLE

v OSI-CALLING-AE-TITLE-ALIAS The user-defined title of this application program. DDP-PPC


Configuration Services uses its contents as a key to obtain
addressing information about this application from the
Configuration Services database. The contents of this
parameter should be left-justified and blank-filled.
If you set the parameter to spaces, DDP-PPC does not attempt
to use the Configuration Services database. Instead, it uses the
information supplied in the respective calling address
parameters.

v OSI-CALLING-AP-TITLE The Application Process Title of this application. Its contents


must be either a directory name as defined by ISO 9594-2 or
the contents octets of an ASN.1 object identifier.
This field is ignored if the session layer entry is used.

v OSI-CALLING-AE-QUAL The value of the Application Entity Qualifier for this application.
Its contents must be a directory RelativeDistinguishedName
type as defined in ISO 9594-2 or the contents octets of an
ASN.1 integer. It must be encoded according to ASN.1 Basic
Encoding Rules.
This field is ignored if the session layer is used.

v OSI-CALLING-AE-TITLE-FORM Indicates the encoding of the OSI-CALLING-AP-TITLE and


OSI-CALLING-AE-QUAL parameters.
$ u
D The form of OSI-CALLING-AP-TITLE is a directory name
and the form of OSI-CALLING-AE-QUAL is a
RelativeDistinguishedName.
$ u
O The form of OSI-CALLING-AP-TITLE is an ASN.1 object
identifier and the form of OSI-CALLING-AE-QUAL is an
ASN.1 integer.
This field is ignored if the session layer entry is used.

continued

3-98 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLING-P-ADDRESS

v OSI-CALLING-P-SELECTOR The value of the Presentation Selector (P-SEL) for this


application. This parameter is normally not set for OS 2200
applications.
This field is ignored if the session layer entry is used.

v OSI-CALLING-S-SELECTOR The value of the Session Selector (S-SEL) for this application. It
should be set to the name the program set in the
OSI-INT-AP-NAME parameter of the REGISTER packet when it
issued the OSI$BIND function.

v OSI-CALLING-T-SELECTOR The value of the Transport Selector for this application. It must
match a T-SEL parameter on the DDP-PPC process statement in
the CMS configuration on the local host.

v OSI-CALLING-NSAP DDP-PPC ignores this parameter.

OSI-CALLING-AE-TITLE-LEN This parameter is ignored if the session layer entry is used.

v OSI-CALLING-AP-TITLE-LEN The length, in bytes, of the data in the OSI-CALLING-AP-TITLE


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Calling Application Process Title.

v OSI-CALLING-AE-QUAL-LEN The length, in bytes, of the data in the OSI-CALLING-AE-QUAL


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Calling Application Entity Qualifier.

continued

3787 3296-200 3-99


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLING-P-ADDRESS-LEN

v OSI-CALLING-P-SELECTOR- LEN The length, in bytes, of the data in the


OSI-CALLING-P-SELECTOR parameter. If this parameter is 0,
DDP-PPC does not encode a value for the Calling Presention
Selector.
This field is ignored if the session layer entry is used.

v OSI-CALLING-S-SELECTOR- LEN The length, in bytes, of the data in the


OSI-CALLING-S-SELECTOR parameter. If this parameter is 0,
DDP-PPC does not encode a value for the Calling Session
Selector.

v OSI-CALLING-T-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLING-T-SELECTOR parameter. If this parameter is 0,
DDP-PPC does not pass a value for the Calling Transport
Selector to the lower layer service routines.

v OSI-CALLING-NSAP-LEN This parameter must be set to 0.

OSI-CALLED-AE-TITLE

v OSI-CALLED-AE-TITLE- ALIAS The user-defined title of the peer program. DDP-PPC


Configuration Services uses its contents as a key to obtain
addressing information about the peer program from the
Configuration Services database.
The contents of this parameter should be left-justified and
blank-filled.
If the parameter is all spaces, DDP-PPC does not attempt to
use the Configuration Services database. Instead, it uses the
information supplied in the respective called address
parameters. These parameters provide DDP-PPC with enough
information to open a connection with a specific remote
application.

v OSI-CALLED-AP-TITLE The Application Process title of the peer program. Its contents
must be either a directory name as defined by ISO 9594-2 or
the contents octets of an ASN.1 object identifier. It must be
encoded according to ASN.1 Basic Encoding Rules.
This field is ignored if the session layer entry is used.

continued

3-100 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLED-AE-TITLE (cont.)

v OSI-CALLED-AE-QUAL The value of the Application Entity Qualifier for the peer
program. Its contents must be a directory
RelativeDistinguishedName type as defined in ISO 9594-2 or
the contents octets of an ASN.1 integer. It must be encoded
according to ASN.1 Basic Encoding Rules.
This field is ignored if the session layer entry is used.

v OSI-CALLED-AP-TITLE-FORM Indicates the encoding of the OSI-CALLED-AP-TITLE and


OSI-CALLED-AE-QUAL parameters.
$ u
D The form of OSI-CALLED-AP-TITLE is a directory name
and the form of OSI-CALLED-AE-QUAL is a
RelativeDistinguishedName.
$ u
O The form of OSI-CALLED-AP-TITLE is an ASN.1 object
identifier and the form of OSI-CALLED-AE-QUAL is an ASN.1
integer.
This field is ignored if the session layer entry is used.

continued

3787 3296-200 3-101


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLED-P-ADDRESS

v OSI-CALLED-P-SELECTOR The Presentation Selector (P-SEL) for the peer program. This
parameter is normally not set for OS 2200 applications.
This field is ignored if the session layer entry is used.

v OSI-CALLED-S-SELECTOR The Session Selector (S-SEL) for the peer program.


If the peer program is an OS 2200 application, this field should
contain the name the peer program set in its OSI-INT-AP-NAME
parameter when it issued the OSI$BIND.

v OSI-OPEN-TIP If the peer program is an OS 2200 TIP transaction, you can


optionally use the following format (see 4.2 for more
information):
OSI-OPEN-TIP-IND
Must be set to TIP$.

OSI-OPEN-APPL-NO
The number of the Message Control Bank (MCB)
application group that the peer TIP program
will execute.

OSI-OPEN-TPX-CODE
The TIP transaction code, which is six
alphanumeric characters.

v OSI-CALLED-T-SELECTOR The value of the Transport Selector (T-SEL) for the peer
program.
If the peer host is an OS 2200 system using OSI Transport
Services (OSITS), this parameter should match the T-SEL
parameter, which the peer host’s Telcon configuration uses to
route incoming open requests to the proper OS 2200 system.
If the peer host is an OS 2200 system using CMS Transport
Services, this parameter must match the T-SEL parameter on
the DDP-PPC process statement in the CMS configuration on
that host

continued

3-102 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLED-P-ADDRESS (cont.)

v OSI-CALLED-NSAP The NSAP for the peer program. It should be left-justified and
expressed in octet format, with each octet containing two hex
digits. If the number of hex digits is uneven, pad the octet
containing the odd hex digit on the right with an x’F. For
example, encode an NSAP of hex
47 04 00 00 18 00 00 08 00 0B DC 00 09 00
as octal
107 00 04 00 00 30 00 00 10 00 13 334 00 11 00
If you are using an X.121 address, instead of an NSAP, encode
it as follows:
$ Combine two digits from the X.121 into each octet.
If the X.121 address is an odd number of digits, encode
the second digit of the last byte as an x’F’. If it starts with a
0, pad the X.121 address to seven bytes by preceding it
with one or more bytes of x’11’; otherwise, pad it to seven
bytes by preceding it with one or more bytes of x’0’.
$ Precede the resulting seven bytes with x’36’ when the
X.121 address (prior to padding) starts with a non-zero
digit or x’52’ when it starts with a zero digit.

continued

3787 3296-200 3-103


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

v OSI-CALLED-NSAP (cont.) For example:


$ Encode an X.121 address of 2156904900 as

hex 36 00 00 21 56 90 49 00
octal 66 00 00 41 126 220 111 00
$ Encode an X.121 address of 31342156904900 as

hex 36 31 34 21 56 90 49 00
octal 66 61 64 41 126 220 111 00
$ Encode an X.121 address of 035678 as

hex 52 11 11 11 11 03 56 78
octal 122 21 21 21 21 03 126 170
If you are using an internet address instead of an NSAP
(OSI-TRANSPORT-CLASS = 32), this field should be left-justified
and expressed in octet format, with each octet representing
one of the four parts of the internet address. For example,
encode an internet address of
192:63:246:011
as
300077366013

v OSI-CALLED-TRANSPORT This field specifies the name of a TRANSPORT NDS in the local
CMS configuration file. Use this field when there is more than
one possible path to the peer host, and the application has a
preference as to which path is taken.
This field is only used for CMS connections that use BRIDGE
protocol. It applies to packet version 1539.
Specifying called_transport overrides the normal CMS process
of matching the OSI-CALLED_NSAP value against a
corresponding value on an OSI-NSAP NDS in the local CMS
configuration to determine the transport path.
If there is only one path to the peer, or if there are multiple
paths but the application has no preference, the application
may use packet version 1539 with OSI-CALLED_TRANSPORT
set to blanks, or use packet version 1538. If there are multiple
paths, CMS will select one.

v OSI-CALLED-HOST-NAME This field occupies the same position as


OSI-CALLED_TRANSPORT. In packet versions lower than 1539,
any value specified for OSI-CALLED_HOST NAME is ignored,
and CMS performs any necessary transport selection.

continued

3-104 3787 3296-200


Opening a Conversation (OSI$OPEN)

Table 3-27. OSI-ADDRESS-PKT Parameters for OSI$OPEN (cont.)

Parameter Description

OSI-CALLED-AE-TITLE-LEN This parameter is ignored if the session layer entry is used.

v OSI-CALLED-AP-TITLE-LEN The length, in bytes, of the data in the OSI-CALLED-AP-TITLE


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Called Application Process Title.

v OSI-CALLED-AE-QUAL-LEN The length, in bytes, of the data in the OSI-CALLED-AE-QUAL


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Called Application Entity Qualifier.

OSI-CALLED-P-ADDRESS-LEN

v OSI-CALLED-P-SELECTOR-LEN The length, in bytes, of the data in the OSI-CALLED-P-SELECTOR


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Called Presentation Selector.
This field is ignored if the session layer entry is used.

v OSI-CALLED-S-SELECTOR-LEN The length, in bytes, of the data in the OSI-CALLED-S-SELECTOR


parameter. If this parameter is 0, DDP-PPC does not encode a
value for the Called Session Selector.

v OSI-CALLED-T-SELECTOR-LEN The length, in bytes, of the data in the OSI-CALLED-T-SELECTOR


parameter. If this parameter is 0, DDP-PPC does not pass a
value for the Called Transport Selector to the lower layer
service routines.

v OSI-CALLED-NSAP-LEN The length, in bytes, of the data in the OSI-CALLED-NSAP


parameter. If this parameter is 0, DDP-PPC does not pass a
value for the Called NSAP to the lower layer service routine.
The maximum value is 20.

Values Returned by DDP-PPC

Calling parameters If the OSI-CALLING-AE-TITLE-ALIAS was not set to spaces,


DDP-PPC returns the respective CALLING parameters with the
information obtained from the Configuration Services database.

Called parameters If the OSI-CALLED-AE-TITLE-ALIAS parameter was not set to


spaces, DDP-PPC returns the respective CALLED parameters
with the information obtained from the Configuration Services
database.

3787 3296-200 3-105


Opening a Conversation (OSI$OPEN)

3.11.9. OSI$OPEN Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

3. Set unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

4. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

5. Set sync minor token to PASS. MOVE 1 TO OSI-SYNC-MINOR-TOKEN.

6. Set act major token to CHOICE. MOVE 2 TO OSI-ACT-MAJOR-TOKEN.

7. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-


NUMBER.

Set Connect Packet parameters.

8. Set the service entry to application level. MOVE 7 TO OSI-SERVICE-ENTRY.

9. Set the session version. MOVE 1 TO SESSION-VERSION-1.


MOVE 1 TO SESSION-VERSION-2.

10. Select the functional units. MOVE 0 TO FUNC-UNIT-TYPED-DATA.


MOVE 0 TO FUNC-UNIT-EXCEPTION.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 1 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.

11. Set the calling reference length. MOVE CALLING-REFERENCE-DATA-LEN TO


SCI-CALLING-REFERENCE-DATA.

12. Set the common reference length. MOVE COMMON-REFERENCE-DATA-LEN TO


SCI-COMMON-REFERENCE-DATA.

13. Set the additional reference length. MOVE ADDITIONAL-REFERENCE-DATA-LEN TO


SCI-ADDITIONAL-REFERENCE-DATA.

14. Set the calling reference. MOVE CALLING-REFERENCE-DATA TO


SCI-CALLING-REFERENCE-DATA.

15. Set the common reference MOVE COMMON-REFERENCE-DATA TO


SCI-COMMON-REFERENCE-DATA.

16. Set the additional reference. MOVE ADDITIONAL-REFERENCE-DATA TO


SCI-ADDITIONAL-REFERENCE-DATA.

continued

3-106 3787 3296-200


Opening a Conversation (OSI$OPEN)

continued

Procedure Typical COBOL Procedure Division Statements

Set Application Presentation Packet


parameters.

17. Set the context name alias. MOVE ’PRGA-CONTEXT’ TO


OSI-APPL-CONTEXT-NAME-ALIAS.

18. Set the presentation mode. MOVE 0 TO OSI-PRES-MODE.

19. Set invocation-id lengths. MOVE 0 TO OSI-CALLED-P-INVOC-ID-LEN.


MOVE 0 TO OSI-CALLING-P-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLED-E-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLING-E-INVOC-ID-LEN.

20. Set the number of context table entries. MOVE 2 TO OSI-CONTEXT-TABLE-ENTRIES.

21. Set the presentation context identifier. MOVE 1 TO OSI-PRES-CONTEXT-IDENT (1).

22. Set the abstract syntax. MOVE ’OIW-OCTET-STRING’ TO


OSI-ABSTRACT-SYNTAX-ALIAS (1).

23. Set the transfer syntax. MOVE ’ASN1-TS’ TO OSI-TRANSFER-


SYNTAX-ALIAS (1).

24. Set the presentation context identifier. MOVE 3 TO OSI-PRES-CONTEXT-IDENT (2).

25. Set the abstract syntax. MOVE ’ACSE-AS’ TO OSI-ABSTRACT-


SYNTAX-ALIAS (2).

26. Set the transfer syntax. MOVE ’ASN1-TS’ TO OSI-TRANSFER-


SYNTAX-ALIAS (2).

Set Address Packet parameters.

27. Set the calling application entity title MOVE ’PROGA-AE-ALIAS’ TO


alias. OSI-CALLING-AE-TITLE-ALIAS.

28. Set the called application entity title MOVE ’PROGB-AE-ALIAS’ TO


alias. OSI-CALLED-AE-TITLE-ALIAS.

Call DDP-PPC.

29. Issue the function call. COPY OSI-OPEN.

30. Save the connection-id. MOVE OSI-CONNECTION TO CONNECTION-SAVE.

3787 3296-200 3-107


Opening a Conversation (OSI$OPEN)

3.11.10. OSI$OPEN Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set data type. MOVE 140 TO OSI-DATA-TYPE.

3. Set unit indicator. MOVE 0 TO OSI-BUFFER-OFFSET.

4. Set output text length. MOVE OPEN-MSG-LENGTH TO


OSI-TEXT-LENGTH.

5. Set unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

6. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

7. Set sync minor token to PASS. MOVE 1 TO OSI-SYNC-MINOR-TOKEN.

8. Set act major token to CHOICE. MOVE 2 TO OSI-ACT-MAJOR-TOKEN.

9. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-


NUMBER.

Set Connect Packet parameters.

10. Set the service entry to application level. MOVE 7 TO OSI-SERVICE-ENTRY.

11. Set the session version. MOVE 1 TO SESSION-VERSION-1.


MOVE 1 TO SESSION-VERSION-2.

12. Select the functional units. MOVE 0 TO FUNC-UNIT-TYPED-DATA.


MOVE 0 TO FUNC-UNIT-EXCEPTION.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 1 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.

13. Set the calling reference length. MOVE CALLING-REFERENCE-DATA-LEN TO


SCI-CALLING-REFERENCE-DATA.

14. Set the common reference length. MOVE COMMON-REFERENCE-DATA-LEN TO


SCI-COMMON-REFERENCE-DATA.

15. Set the additional reference length. MOVE ADDITIONAL-REFERENCE-DATA-LEN TO


SCI-ADDITIONAL-REFERENCE-DATA.

16. Set the calling reference data. MOVE CALLING-REFERENCE-DATA TO


SCI-CALLING-REFERENCE-DATA.

continued

3-108 3787 3296-200


Opening a Conversation (OSI$OPEN)

continued

Procedure Typical COBOL Procedure Division Statements

17. Set the common reference data. MOVE COMMON-REFERENCE-DATA TO


SCI-COMMON-REFERENCE-DATA.

18. Set the additional reference data. MOVE ADDITIONAL-REFERENCE-DATA TO


SCI-ADDITIONAL-REFERENCE-DATA.

Set Application Presentation Packet


parameters.

19. Set the application context name alias. MOVE ’PRGA-CONTEXT’ TO


OSI-APPL-CONTEXT-NAME-ALIAS.

20. Set the presentation mode. MOVE 0 TO OSI-PRES-MODE.

21. Set invocation-id lengths. MOVE 0 TO OSI-CALLED-P-INVOC-ID-LEN.


MOVE 0 TO OSI-CALLING-P-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLED-E-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLING-E-INVOC-ID-LEN.

22. Set the number of context table entries. MOVE 2 TO OSI-CONTEXT-TABLE-ENTRIES.

23. Set the presentation context identifier. MOVE 1 TO OSI-PRES-CONTEXT-IDENT (1).

24. Set the abstract syntax identifier. MOVE ’OIW-OCTET-STRING’ TO


OSI-ABSTRACT-SYNTAX-ALIAS (1).

25. Set the transfer syntax identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-


SYNTAX-ALIAS (1).

26. Set the presentation context id. MOVE 3 TO OSI-PRES-CONTEXT-IDENT (2).

27. Set the abstract syntax identifier. MOVE ’ACSE-AS’ TO OSI-ABSTRACT-


SYNTAX-ALIAS (2).

28. Set the transfer syntax identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-


SYNTAX-ALIAS (2).

Set Address Packet parameters.

29. Set the calling application entity alias. MOVE ’PROGA-AE-ALIAS’ TO


OSI-CALLING-AE-TITLE-ALIAS.

30. Set the called application entity title MOVE ’PROGB-AE-ALIAS’ TO


alias. OSI-CALLED-AE-TITLE-ALIAS.

Set output message buffer area.

31. Put message in output buffer. MOVE OPEN-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

32. Issue the function call. COPY OSI-OPEN.

33. Save the connection-id. MOVE OSI-CONNECTION TO CONNECTION-SAVE.

3787 3296-200 3-109


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12. Accepting or Rejecting an Open Request


(OSI$OPRESP)
Use the OSI$OPRESP function to respond to the receipt of an open request. It should be
issued as the next function after a successful OSI$RECEIVE of a new conversation (receive
new format). The response can be either acceptance or rejection of the open request,
depending on the setting of the OSI-APPL-PRES-RESULT field of the OSI-APPL-PRES-PKT
for the application layer interface or the OSI-SESSION-RESULT field of the
OSI-CONNECT-PKT for the session layer interface. See the subsection "DDP-PPC and the
OSI Interface" in Section 1.1 for a discussion of application and session level entry points.

3.12.1. OSI$OPRESP Format


COPY OSI-OPRESP.

or
CALL 'OSI$OPRESP' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-CONNECT-PKT OSI-APPL-PRES-PKT
OSI-ADDRESS-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$OPRESP request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on an open response permits you to send a message along
with the open response request. OSI-MSG-BUFFER is the default name. You can specify
your own name in the working-storage section for this area, but because the USING clause
contains positional parameters, the name you specify must be the second parameter in the
clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

The OSI-CONNECT-PKT parameter references the connect packet statements for all
information necessary to establish a connection with a peer program.

The OSI-APPL-PRES-PKT parameter references the application presentation packet. It is


only used when the application layer is selected. It contains information necessary for
opening connections between application layers and information for presentation context
identifiers.

The OSI-ADDRESS-PKT parameter references the data packet statements for addressing
information necessary to establish a connection with a peer program.

3-110 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$OPRESP function call uses the following
status packet parameters:

Table 3-28. OSI-STATUS-PKT Parameters for OSI$OPRESP

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-111


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$OPRESP function call. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the user-information
parameter of the AARE-apdu in ISO 8650 Protocol specification for the Association
Control Service Element. It should be encoded according to ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1)

The following diagram shows what part of the user-information parameter DDP-PPC
encodes and what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-
DDP-PPC information [30] length

encoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
encoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3-112 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.4. OSI-DATA-PKT

Table 3-29. OSI-DATA-PKT Parameters for OSI$OPRESP

Parameter Description

Values Set by User

OSI-CONNECTION The value DDP-PPC returns on the OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether


DDP-PPC should encode, compress, or pad the entire user data
buffer. If you do not want encoding, compression, or padding,
set this parameter to 134 (OSI-TRANSPARENT-TYPE). Also set
to 134 or 140 for connections to non-OS 2200 hosts because
any other value requires the use of DDP-PPC proprietary
abstract and transfer syntaxes that those hosts will probably
not recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract
and transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11)
for details about syntax selection. See the OSI-APPL-PRES-PKT
in this subsection for information about negotiating syntaxes on
the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the ASN.1 EXTERNAL type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user
must encode the ASN.1 EXTERNAL type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes.
This is called padding the data and is necessary to send nine-bit
bytes over communication networks that only support eight-bit
bytes. The user must encode the ASN.1 EXTERNAL type as
part of user data.

continued

3787 3296-200 3-113


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-29. OSI-DATA-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes,
and also compresses the data. If it cannot perform
compression, it treats the data type as a 138 type. The user
must encode the ASN.1 EXTERNAL type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using


ASN.1 Basic Encoding Rules. This data type does not require
any additional protocol to be encoded as part of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using


ASN.1 Basic Encoding Rules, and also compresses the data. If
it cannot perform compression, it treats the data type as a 140
type. This data type does not require any additional protocol to
be encoded as part of user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the first
byte of the buffer is to be used. DDP-PPC ignores this
parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced
by OSI session protocol. If you selected session version 2,
there is a limit of 10240 bytes of session data enforced by OSI
session protocol. In either case, all user data and additional
protocol header information generated by DDP-PPC cannot
exceed the respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

continued

3-114 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-29. OSI-DATA-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-DATA-TOKEN Determines whether to pass, hold, or request the available


tokens.
If an available token parameter was set to CHOICE on the
OSI$RECEIVE (receive new format) function for this
conversation, you must determine which program will initially
possess the token. Set the respective token parameter to one
of the following:
$ 0 OSI-DATA-HOLD v To retain possession of the token.
$ 1 OSI-DATA-PASS v To pass the token back to the
originator of the open request.
If the open request did not pass an available request, you can
request that it be passed by setting the respective token
parameter to 3:
3 OSI-DATA-RQST v This request is passed to the peer
program but does not force that program to pass the token.

OSI-SYNC-MINOR-TOKEN Determines whether to pass, hold, or request the available


token. See OSI-DATA-TOKEN.

OSI-ACT-MAJOR-TOKEN Determines whether to pass, hold, or request the available


token. See OSI-DATA-TOKEN.

OSI-SYNC-POINT-SERIAL- NUMBER The proposed initial minor synchronization point serial number.
It identifies a value for the initial synchronization point
(checkpoint) in a connection. This value must be set if you
select the minor synchronize (FUNC-UNIT-MINOR-SYNC) or
resynchronize (FUNC-UNIT-RESYNC) functional unit but do not
select the activity management functional unit
(FUNC-UNIT-ACT-MGT).
DDP-PPC sets this value on the OSI$RECEIVE of the new
connection. You can alter it but the new value becomes the
accepted value for the connection.
The value of this parameter can be in the range 0 to 999999.
You must set it to 0 if you select FUNC-UNIT-ACT-MGT or if you
do not select either FUNC-UNIT-MINOR-SYNC or
FUNC-UNIT-RESYNC.
Note: Certain functions increment this value throughout the
connection or activity. If it exceeds 999999, you
receive an error. Therefore, start with an initial value
low enough to prevent this error from occurring.

3787 3296-200 3-115


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.5. OSI-CONNECT-PKT

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP

Parameter Description

Values Set by User

OSI-SESSION-RESULT This field is only used when the session layer entry is used. It
indicates whether this program, acting as a session service
user, accepted or rejected the connection. Set this parameter
to one of the following values:

v OSI-CN-ACCEPT 0 Accepted the connection.

v OSI-CN-REJ-USR-NO-REASON 1 Rejected the connection with an unspecified reason.

v OSI-CN-REJ-USR-CONGESTION 2 Rejected the connection due to temporary congestion.

v OSI-CN-REJ-USR-SEE-DATA 3 Rejected the connection due to a reason provided in the


message buffer. The functional units this program proposes
(see OSI-FUNC-UNITS-SELECTED parameter) are sent to the
program that issued the open request when this value is set.

OSI-SESSION-VERSION Indicates the versions of the session layer protocol your


application can support for this connection. Move a 1 into the
specific version(s) you want to select. Move a 0 into the other
version fields.

v OSI-SESSION-VERSION-1 If you are using the session layer entry and set the
OSI-SESSION-RESULT parameter to 0 (OSI-CN-ACCEPT), or are
v OSI-SESSION-VERSION-2 using the application layer entry and set the
OSI-APPL-PRES-RESULT parameter to 0
(OSI-AU-ASSOC-ACCEPTED), you must specify the version(s)
your implementation supports. You can specify more versions
on the response to the open than were proposed on the open
request. At least one version proposed on the response must
be proposed on the open request.

continued

3-116 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION-1


If only OSI-SESSION-VERSION-1 was set to 1 on the receive of
the open request for this connection, on the response you can
specify:
$ Version 1 by setting OSI-SESSION-VERSION-1 to 1 and
SESSION-VERSION-2 to 0. Up to 512 bytes of data can be
sent on the response. Version 1 will be in effect for the
duration of the connection.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 512 bytes of user data can be sent on the
response. Version 1 will be in effect for the duration of the
connection. OSI-SESSION-VERSION-1 will be set to 1 and
OSI-SESSION-VERSION-2 will be set to 0 upon return from
the response function.

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION-2


If only OSI-SESSION-VERSION-2 was set to 1 on the receive of
the open request for this connection, on the response you can
specify:
$ Version 2 by setting OSI-SESSION-VERSION-2 to 1 and
OSI-SESSION-VERSION-1 to 0. Up to 10240 bytes of data
can be sent on the response. Version 2 will be in effect for
the duration of the connection.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 10240 bytes of user data can be sent on the
response. Version 2 will be in effect for the duration of the
connection. OSI-SESSION-VERSION-2 will be set to 1 and
OSI-SESSION-VERSION-1 will be set to 0 upon return from
the response function.

continued

3787 3296-200 3-117


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION (both)


If both OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2
were set to 1 on the receive for this connection, on the
response you can specify:
$ Version 1 by setting OSI-SESSION-VERSION-1 to 1 and
OSI-SESSION-VERSION-2 to 0. Up to 512 bytes of data can
be sent on the response. Version 1 will be in effect for the
duration of the connection.
$ Version 2 by setting OSI-SESSION-VERSION-2 to 1 and
OSI-SESSION-VERSION-1 to 0. Up to 10240 bytes of data
can be sent on the response. Version 2 will be in effect for
the duration of the connection.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 10240 bytes of user data can be sent on the
response. Version 2 will be in effect for the duration of the
connection. OSI-SESSION-VERSION-2 will be set to 1 and
OSI-SESSION-VERSION-1 will be set to 0 upon return from
the response function.

OSI-SESSION-VERSION (cont.) If you are using the session layer entry and set the
OSI-SESSION-RESULT parameter to other than 0
(OSI-CN-ACCEPT), or are using the application layer entry and
set the OSI-APPL-PRES-RESULT parameter to other than 0
(OSI-AU-ASSOC-ACCEPTED), you can optionally specify
version(s) your implementation supports. You can specify more
or different versions on the response to the open than were
proposed on the open request.

continued

3-118 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION-1


If only OSI-SESSION-VERSION-1 was set to 1 on the receive of
this connection, on the response you can specify:
$ Version 1 by setting OSI-SESSION-VERSION-1 to 1 and
OSI-SESSION-VERSION-2 to 0. Up to 512 bytes of data can
be sent on the response.
$ Version 2 by setting OSI-SESSION-VERSION-2 to 1 and
OSI-SESSION-VERSION-1 to 0. Up to 512 bytes of data can
be sent on the response.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 512 bytes of user data can be sent on the
response.

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION-2


If only OSI-SESSION-VERSION-2 was set to 1 on the receive of
the open request for this connection, on the response you can
specify:
$ Version 1 by setting OSI-SESSION-VERSION-1 to 1 and
OSI-SESSION-VERSION-2 to 0. Up to 512 bytes of data can
be sent on the response.
$ Version 2 by setting OSI-SESSION-VERSION-2 to 1 and
OSI-SESSION-VERSION-1 to 0. Up to 512 bytes of data can
be sent on the response.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 10240 bytes of user data can be sent on the
response.

continued

3787 3296-200 3-119


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-SESSION-VERSION (cont.) OSI-SESSION-VERSION (both)


If both OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2
were set to 1 on the receive for this connection, on the
response you can specify:
$ Version 1 by setting OSI-SESSION-VERSION-1 to 1 and
OSI-SESSION-VERSION-2 to 0. Up to 512 bytes of data can
be sent on the response.
$ Version 2 by setting OSI-SESSION-VERSION-2 to 1 and
OSI-SESSION-VERSION-1 to 0. Up to 10240 bytes of data
can be sent on the response.
$ Both version 1 and version 2 by setting
OSI-SESSION-VERSION-1 and OSI-SESSION-VERSION-2 to
1. Up to 10240 bytes of user data can be sent on the
response.

continued

3-120 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED The OSI functionality the program proposes to use. Each


functional unit provides a specific subset of the entire OSI
functionality (for example, the half-duplex functional unit
provides the ability to perform two-way alternate
communication). DDP-PPC sets the functionality on the
OSI$RECEIVE of the new connection.
$ u
0 The functional units you do not want the peer program
to support.
$ 1uThe functional units the peer program is proposing to
use.
Both sending and receiving programs must propose a
functional unit in order for that unit to be selected for the
connection. Thus, any parameter you change from 0 to 1 is not
selected because the peer program did not propose it
previously. However, the peer program is notified that you
proposed that functional unit.

v FUNC-UNIT-TYPED-DATA Allows for the transfer of data in a manner that is not subject to
the control imposed by the availability of the data token.

v FUNC-UNIT-EXCEPTIONS Allows for the reporting of detected errors without aborting the
connection.

vdata)FUNC-UNIT-CAP-DATA (capability Allows for the confirmed transfer of data when the activity
management functional unit has been selected but no activity is
in progress.

v FUNC-UNIT-ACT-MGT (activity Allows for the management of synchronized logical pieces of


management) work.

continued

3787 3296-200 3-121


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED (cont.)

v FUNC-UNIT-RESYNC Allows for the modification of synchronization point serial


(resynchronize) numbers and reassignment of tokens.

v FUNC-UNIT-MINOR-SYNC (minor Allows for the placement of minor synchronization points,


synchronize) identified by serial numbers, in the normal data flow.

v FUNC-UNIT-DUPLEX Allows for the uncontrolled right to send data.

v FUNC-UNIT-HALF-DUPLEX Allows for the controlled right to send data.


v FUNC-UNIT-DATA-SEP (data Allows for the protection of data in the event of
separation) resynchronization.
The following rules apply when proposing functional units for
the OSI$OPRESP function:
$ You can only propose FUNC-UNIT-CAP-DATA if you also
propose FUNC-UNIT-ACT-MGT.
$ You can only propose FUNC-UNIT-EXCEPTIONS if you also
propose FUNC-UNIT-HALF-DUPLEX.
$ You can only propose FUNC-UNIT-DATA-SEP if you also
propose FUNC-UNIT-MINOR-SYNC.
$ You cannot propose FUNC-UNIT-DATA-SEP if you propose
FUNC-UNIT-ACT-MGT.
$ You cannot propose both FUNC-UNIT-HALF-DUPLEX and
FUNC-UNIT-DUPLEX. You must propose one of these
functional units on the OSI$OPRESP function call unless
you do not propose any functional units. When you do not
propose any functional units, FUNC-UNIT-HALF-DUPLEX is
the default.
If you do not propose any functional units, the session services
provider (DDP-PPC) proposes the OSI protocol default value for
functional units on your behalf. The default includes the
following functional units:
$ FUNC-UNIT-HALF-DUPLEX
$ FUNC-UNIT-MINOR-SYNC
$ FUNC-UNIT-ACT-MGT
$ FUNC-UNIT-CAP-DATA
$ FUNC-UNIT-EXCEPTIONS

continued

3-122 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-30. OSI-CONNECT-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

SCI-CALLED-REFERENCE-LEN The length, in bytes, of data entered in the


SCI-CALLED-REFERENCE parameter. It can be in the range 0 to
64. Since the SCI-CALLED-REFERENCE parameter is optional, a
value of 0 indicates that DDP-PPC should not encode and pass
that parameter.

SCI-COMMON-REFERENCE-LEN The length, in bytes, of data entered in the


SCI-COMMON-REFERENCE parameter. It can be in the range 0
to 64. Since the SCI-COMMON-REFERENCE parameter is
optional, a value of 0 indicates that DDPvPPC should not
encode and pass that parameter.

SCI-ADDITIONAL-REFERENCE-LEN The length, in bytes, of data entered in the


SCI-ADDITIONAL-REFERENCE parameter. It can be in the range
0 to 4. Since the SCI-ADDITIONAL-REFERENCE parameter is
optional, a value of 0 indicates that DDP-PPC should not encode
and pass that parameter.

OSI-CN-SESSION-CONNECTION-ID User-defined. DDP-PPC passes the contents of each of these


fields to the peer program unless you set the field’s
corresponding reference length field to 0.

v SCI-CALLED-REFERENCE

v SCI-COMMON-REFERENCE

v SCI-ADDITIONAL-REFERENCE

3787 3296-200 3-123


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.6. OSI-APPL-PRES-PKT

Table 3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP

Parameter Description

Values Set by User

OSI-APPL-CONTEXT-NAME-ALIAS The user-defined name for an APPLICATION CONTEXT


record in the Configuration Services database. DDP-PPC
uses its contents to obtain the actual application context
identifier from the Configuration Services database and
passes it to the peer program. If you set this parameter
to spaces, DDP-PPC does not attempt to use the
Configuration Services database; instead, it uses the
contents of the OSI-APPL-CONTEXT-NAME parameter.

OSI-APPL-CONTEXT-NAME The actual application context identifier, which identifies a


set of services being used by an application entity.
Only the user program uses the actual contents of this
parameter. DDP-PPC does not validate or use the
contents. The format of this parameter should be the
contents octets of an ASN.1 object identifier encoded
according to ASN.1 Basic Encoding Rules.
DDP-PPC encodes the identifier and length octets for this
parameter. Either the OSI-APPL-CONTEXT-NAME-ALIAS or
OSI-APPL-CONTEXT-NAME parameter must provide an
application context value to DDP-PPC.

OSI-APPL-CONTEXT-NAME-LEN The length of the OSI-APPL-CONTEXT-NAME parameter. If


you set the OSI-APPL-CONTEXT-NAME-ALIAS parameter
to spaces, this value must be greater than 0.

OSI-RESPONDING-P-INVOCATION-ID The invocation (copy) of the Application Process that is


the actual acceptor of the open request. The content of
this parameter must be numeric but its value is
user-defined and has no meaning to DDP-PPC. If you set
this parameter to 0, DDP-PPC does not pass a
Responding Application Process Invocation Id parameter
to the peer program.

OSI-RESPONDING-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


actual acceptor of the open request. The content of this
parameter must be numeric but its value is user-defined
and has no meaning to DDP-PPC. If you set this
parameter to 0, DDP-PPC does not pass a Responding
Application Entity Invocation Id parameter to the peer
program.

continued

3-124 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-APPL-PRES-RESULT Indicates whether this program accepts or rejects the


connection. Since your program is performing services
at both presentation and application layers, it must
decide which layer is reporting the error and set the
appropriate error code.
The presentation layer services this program performs
involve decoding the user data. If any errors occur during
that process, they should be reported as presentation
provider errors. DDP-PPC does not validate this field.
However, selecting an incorrect error code may cause
confusion for the remote application.
You can set the following values:

v OSI-AU-ASSOC-ACCEPTED 0 The program accepts the connection.

v OSI-AU-NO-REASON 1 The program, as an application services user, rejects


the connection with no reason specified.

v OSI-AU-APPL-CNTXT-UNSUPPORTED 2 The program, as an application user, rejects the


connection because it does not support the Application
Context proposed.

v OSI-AU-CALLG-AP-TITLE-UNRECOG 3 The program, as an application user, rejects the


connection because it does not recognize the Calling
Application Process Title proposed.

v OSI-AU-CALLG-AP-INVID-UNRECOG 4 The program, as an application user, rejects the


connection because it does not recognize the Calling
Application Process Invocation Id proposed.

v OSI-AU-CALLG-AE-QUAL-UNRECOG 5 The program, as an application user, rejects the


connection because it does not recognize the Calling
Application Entity Qualifier proposed.

v OSI-AU-CALLG-AE-INVID-UNRECOG 6 The program, as an application user, rejects the


connection because it does not recognize the Calling
Application Entity Invocation Id proposed.

continued

3787 3296-200 3-125


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-APPL-PRES-RESULT (cont.)

v OSI-AU-CALLD-AP-TITLE-UNRECOG 7 The program, as an application user, rejects the


connection because it does not recognize the Called
Application Process Title proposed.

v OSI-AU-CALLD-AP-INVID-UNRECOG 8 The program, as an application user, rejects the


connection because it does not recognize the Called
Application Process Invocation Id proposed.

v OSI-AU-CALLD-AE-QUAL-UNRECOG 9 The program, as an application user, rejects the


connection because it does not recognize the Called
Application Entity Qualifier proposed.

v OSI-AU-CALLD-AE-INVID-UNRECOG 10 The program, as an application user, rejects the


connection because it does not recognize the Called
Application Entity Invocation Id proposed.

v OSI-PP-NO-REASON 13 The program, as a presentation services provider,


rejects the connection for no reason.

v OSI-PP-CONGESTION 14 The program, as a presentation services provider,


rejects the connection due to congestion.

v OSI-PP-USER-DATA-UNREADABLE 19 The program, as a presentation services provider,


rejects the connection because it cannot decode the
user data.

Note: If this field is set to a value other than 0


(OSI-AU-ASSOC-ACCEPTED), the functional units
proposed by this program or the default
functional units (see OSI-FUNC-UNITS-SELECTED
parameter) are sent to the program that issued
the open request. The default functional units
are sent for error codes greater than 10.

continued

3-126 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-APPL-PRES-RESULT-TYPE The type of reject. Only set this parameter if you set the
OSI-APPL-PRES-RESULT parameter to a value other than
0. Do not set it to 0 (NULL). The following values are
valid:
$ 1 OSI-PERMANENT
The error is permanent and will probably reoccur if
the open request is retried.
$ 2 OSI-TRANSIENT
The error is temporary and a subsequent open
request may be successful.

Note: The current OSI standards documentation does


not indicate which errors are permanent or
transient. However, the descriptions indicate
that the only errors you should set as transient
are OSI-AU-NO-REASON, OSI-PP-NO-REASON,
and OSI-PP-CONGESTION.

OSI-PRES-CONTEXT-TABLE-ENTRIES The number of OSI-PRES-CONTEXT-TABLE entries


entered for this OSI$OPRESP function call. The value
must be the same as that DDP-PPC returned when it
received the open request.

OSI-PRES-CONTEXT-TABLE The values in these fields must be the same as those


DDP-PPC returned when it received the open request.

v OSI-PRES-CONTEXT-IDENT The presentation context for this abstract and transfer


syntax combination.

v OSI-ABSTRACT-SYNTAX-ALIAS An alias for a specific abstract syntax. DDP-PPC uses


this value to obtain the actual abstract syntax identifier
from the DDP-PPC Configuration Services database.
v OSI-TRANSFER-SYNTAX-ALIAS An alias for a specific transfer syntax. DDP-PPC uses this
value to obtain the actual transfer syntax identifier from
the DDP-PPC Configuration Services database.

continued

3787 3296-200 3-127


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-31. OSI-APPL-PRES-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-CONTEXT-INDICATOR Indicates whether you accept or reject the abstract and


transfer syntax combination (presentation context) as a
valid way to encode data. Only those presentation
contexts that you accept can be used as ways to encode
data for the connection.
DDP-PPC may have rejected certain presentation
contexts. These are not be marked as accepted when
you issue an OSI$RECEIVE (receive new format) function.
You can only accept or reject those that were marked
accepted after the OSI$RECEIVE function was issued.
You can set this parameter to one of the following values:
v OSI-PU-CONTEXT-ACCEPTED 0 You accept the presentation context, which means it
can be used during the connection as a way to encode
data.

v OSI-PU-CONTEXT-REJECTED 1 As a presentation services user, you reject the


context, which means your application does not support
the abstract syntax.

v OSI-PP-REJ-NO-REASON 2 As a presentation services provider, you reject the


context for no reason.

v OSI-PP-REJ-AS-UNSUPPORTED 3 As a presentation services provider, you reject the


context because you do not support the abstract syntax
and thus cannot decode the data.

v OSI-PP-REJ-TS-UNSUPPORTED 4 As a presentation services provider, you reject the


context because you do not support the transfer syntax
and thus cannot decode the data.

Values Returned by DDP-PPC

DDP-PPC returns the following parameters if the OSI-APPL-CONTEXT-NAME-ALIAS parameter was not
set to all spaces. DDP-PPC uses that field to obtain the information from an APPLICATION CONTEXT
record in the Configuration Services database.

OSI-APPL-CONTEXT-NAME The value of the Application Context Identifier keyword


that was set in the Configuration Services database. Its
format is the contents octets of an ASN.1 object identifier
encoded according to ASN.1 Basic Encoding Rules.

OSI-APPL-CONTEXT-NAME-LEN The length of the value returned in the


OSI-APPL-CONTEXT-NAME parameter.

3-128 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.7. Additional Information for the Application Presentation


Packet
Presentation Context Information
When setting packet fields for the OSI$OPRESP function call, consider the following:

$ DDP-PPC uses the OSI-APPL-PRES-PKT parameters on an OSI$OPRESP function only


if the application layer interface was selected (CONNECT packet,
OSI-SERVICE-ENTRY = 7 when the OSI$RECEIVE (receive new format) function was
issued).
$ If more than one transfer syntax was proposed for the same abstract syntax, there are
multiple OSI-PRES-CONTEXT-TABLE entries with the same value for the
OSI-PRES-CONTEXT-IDENT parameter. You can accept only one of these and must
reject the others.
$ DDP-PPC requires ACSE abstract syntax and ASN.1 transfer syntax to send ACSE
protocol. You must accept the OSI-PRES-CONTEXT-TABLE entry that contains an
OSI-ABSTRACT-SYNTAX-ALIAS parameter set to ’ACSE-AS’ and an
OSI-TRANSFER-SYNTAX-ALIAS parameter set to ’ASN1-TS’.
$ If this connection is between OS 2200 systems and uses data type 135 for any message,
DDP-PPC requires you to accept the OSI-PRES-CONTEXT-TABLE entry that contains
the following so that it can encode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS = ’DDP-COMPRESS-TS’.
$ If this connection is between OS 2200 systems and uses data type 138 for any message,
DDP-PPC requires you to accept the OSI-PRES-CONTEXT-TABLE entry that contains
the following so that it can encode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS = ’DDP-PADDED-TS’.
$ If this connection is between OS 2200 systems and uses data type 139 for any message,
DDP-PPC requires you to accept the OSI-PRES-CONTEXT-TABLE entry that contains
the following so that it can encode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OS1100-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS = ’DDP-COMP-PAD-TS’.
$ If this connection is between OS 2200 systems and uses data type 140 for any message,
DDP-PPC requires you to accept the OSI-PRES-CONTEXT-TABLE entry that contains
the following so that it can encode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OIW-OCTET-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS = ’ASN1-TS’.

3787 3296-200 3-129


Accepting or Rejecting an Open Request (OSI$OPRESP)

$ If this connection is between OS 2200 systems and uses data type 141 for any message,
DDP-PPC requires you to accept the OSI-PRES-CONTEXT-TABLE entry that contains
the following so that it can encode the data properly:
v OSI-ABSTRACT-SYNTAX-ALIAS = ’OIW-OCTET-AS’.
v OSI-TRANSFER-SYNTAX-ALIAS = ’DDP-COMPRESS-TS’.

Notes:

1. When setting the presentation context list on an OSI$OPRESP, accept all contexts
that will be used during the life of the connection. For example, at a minimum,
accept at least one context for ACSE protocol and one for user data.
2. When accepting contexts for compressed data types (135, 139, 141), also accept the
contexts for the corresponding non-compressed data types (134, 138, 140). This
allows for the case where DDP-PPC cannot perform compression and must encode
the data in the non-compressed form.
3. If either or both of the octet data types (140, 141) are accepted, DDP-PPC restricts
the entries in the presentation context table to:

$ The ACSE-required context


$ Any of the DDP-PPC data type contexts (135, 138, 139)
$ The octet data type contexts (140, 141)
These are the only presentation contexts that can be present along with the octet
data contexts.

Application Context Information

DDP-PPC returns the application context proposed by the peer program in the
APPL-CONTEXT-NAME parameter on the OSI$RECEIVE function (receive new format).
DDP-PPC also returns the corresponding APPL-CONTEXT-NAME-ALIAS parameter if it
finds an Application Context Id in the Configuration Services database that matches the
value of the Application Context Id received on the open request. This program can return
that value or select a new value. In either case, the value this program selects is used for
the connection.

3-130 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.8. OSI-ADDRESS-PKT

Table 3-32. OSI-ADDRESS-PKT Parameters for OSI$OPRESP

Parameter Description

Values Set by User

OSI-RESPONDING-AE-TITLE-ALIAS The user-defined title of this application program.


DDP-PPC Configuration Services uses its contents as a
key to obtain addressing information about this
application from the Configuration Services database.
The contents of this parameter should be left-justified and
blank-filled.
If you set the parameter to all spaces, then DDP-PPC
does not attempt to use the Configuration Services
database. Instead, it uses the information supplied in the
respective responding address parameters.

OSI-RESPONDING-AP-TITLE The Application Process Title of this application. Its


contents must be a directory name as defined by ISO
9594-2 or the contents octets of an ASN.1 object
identifier. It must be encoded according to ASN.1 Basic
Encoding Rules.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-AE-QUAL The value of the Application Entity Qualifier for this


application. Its contents must be a Relative Distinguished
Name type as defined in ISO 9594-2 or the contents
octets of an ASN.1 integer. It must be encoded
according to ASN.1 Basic Encoding Rules.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-AE-TITLE-FORM Indicates the encoding of the OSI-RESPONDING-AP-TITLE


and OSI-RESPONDING-AE-QUAL parameters.
$ u
D The form of OSI-RESPONDING-AP-TITLE is a
directory name and the form of
OSI-RESPONDING-AE-QUAL is a directory
RelativeDistinguished Name.
$ u
O The form of OSI-RESPONDING-AP-TITLE is an
ASN.1 object identifier and the form of
OSI-RESPONDING-AE-QUAL is an ASN.1 integer.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-P-SELECTOR The value of the Presentation Selector (P-SEL) for this


application. This parameter is normally not set by OS
2200 applications.
This field is ignored if the session layer entry is used.

continued

3787 3296-200 3-131


Accepting or Rejecting an Open Request (OSI$OPRESP)

Table 3-32. OSI-ADDRESS-PKT Parameters for OSI$OPRESP (cont.)

Parameter Description

OSI-RESPONDING-S-SELECTOR The value of the Session Selector (S-SEL) for this


application. It should be set to the name used in the
OSI-INT-AP-NAME parameter of the OSI-REGISTER packet
when you issued the OSI$BIND function call.

OSI-RESPONDING-AP-TITLE-LEN The length, in bytes, of the data in the


OSI-RESPONDING-AP-TITLE parameter. If you set this
parameter to 0, DDP-PPC does not encode a value for
the Responding Application Process Title.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-AE-QUAL-LEN The length, in bytes, of the data in the


OSI-RESPONDING-AE-QUAL parameter. If you set this
parameter to 0, DDP-PPC does not encode a value for
the Responding Application Entity Qualifier.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-P-SELECTOR-LEN The length, in bytes, of the data in the


OSI-RESPONDING-P-SELECTOR parameter. If you set this
parameter to 0, DDP-PPC does not encode a value for
the Responding Presentation Services Access Point.
This field is ignored if the session layer entry is used.

OSI-RESPONDING-S-SELECTOR-LEN The length, in bytes, of the data in the


OSI-RESPONDING-S-SELECTOR parameter. If you set this
parameter to 0, DDP-PPC does not encode a value for
the Responding Session Services Access Point.

OSI-RESPONDING-T-SELECTOR-LEN Set this parameter to 0.

OSI-RESPONDING-NSAP-LEN Set this parameter to 0.

Values Set by DDP-PPC

Responding parameters If you do not set OSI-RESPONDING-AE-TITLE-ALIAS to


spaces, DDP-PPC returns the respective ’responding’
parameters with information obtained from the
Configuration Services database.

3-132 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.9. OSI$OPRESP Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token for REQUEST. MOVE 3 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to PASS. MOVE 1 TO OSI-ACT-MAJOR-TOKEN.

Set Connect Packet parameters.

8. Set the session version. MOVE 1 TO SESSION-VERSION-1.


MOVE 1 TO SESSION-VERSION-2.

9. Select the functional units. MOVE 0 TO FUNC-UNIT-TYPED-DATA.


MOVE 0 TO FUNC-UNIT-EXCEPTION.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 1 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.

10. Set the called reference length. MOVE CALLED-REFERENCE-DATA-LEN TO


SCI-CALLED-REFERENCE-DATA.

11. Set the common reference length. MOVE COMMON-REFERENCE-DATA-LEN TO


SCI-COMMON-REFERENCE-DATA.

12. Set the additional reference length. MOVE ADDITIONAL-REFERENCE-DATA-LEN TO


SCI-ADDITIONAL-REFERENCE-DATA.

13. Set the called reference data. MOVE CALLED-REFERENCE-DATA TO


SCI-CALLED-REFERENCE-DATA.

14. Set the common reference data. MOVE COMMON-REFERENCE-DATA TO


SCI-COMMON-REFERENCE-DATA.

15. Set the additional reference data. MOVE ADDITIONAL-REFERENCE-DATA TO


SCI-ADDITIONAL-REFERENCE-DATA.

Set Application Presentation Packet


parameters.

continued

3787 3296-200 3-133


Accepting or Rejecting an Open Request (OSI$OPRESP)

continued

Procedure Typical COBOL Procedure Division Statements

16. Set to accept connection. MOVE O TO OSI-APPL-PRES-RESULT.

17. Set the application context name alias. MOVE ’PRGA-CONTEXT’ TO


OSI-APPL-CONTEXT-NAME-ALIAS.

18. Set invocation-id lengths. MOVE 0 TO OSI-RESPONDING-P-INVOC-ID-LEN.


MOVE 0 TO OSI-RESPONDING-E-INVOC-ID-LEN.

19. Set the number of context table entries. MOVE 2 TO OSI-CONTEXT-TABLE-ENTRIES.

20. Set the presentation context identifier. MOVE 1 TO OSI-PRES-CONTEXT-IDENT (1).

21. Set the abstract syntax alias identifier. MOVE ’OIW-OCTET-STRING’ TO


OSI-ABSTRACT-SYNTAX-ALIAS (1).

22. Set the transfer syntax alias identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-
SYNTAX-ALIAS (1).

23. Set to accept presentation context. MOVE 0 TO OSI-CONTEXT-INDICATOR (1).

24. Set the presentation context identifier. MOVE 3 TO OSI-PRES-CONTEXT-IDENT (2).

25. Set the abstract syntax alias identifier. MOVE ’ACSE-AS’ TO OSI-ABSTRACT-
SYNTAX-ALIAS (2).

26. Set the transfer syntax alias identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-
SYNTAX-ALIAS (2).

27. Set to accept presentation context. MOVE 0 TO OSI-CONTEXT-INDICATOR (2).

Set Address Packet parameters.

28. Set the responding application entity MOVE ’PROGA-AE-ALIAS’ TO


title alias. OSI-RESPONDING-AE-TITLE-ALIAS.

Call DDP-PPC.

29. Issue the function call. COPY OSI-OPRESP.

3-134 3787 3296-200


Accepting or Rejecting an Open Request (OSI$OPRESP)

3.12.10. OSI$OPRESP Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE OPRESP-MSG-LENGTH TO


OSI-TEXT-LENGTH.

6. Set unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token for REQUEST. MOVE 3 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to PASS. MOVE 1 TO OSI-ACT-MAJOR-TOKEN.

Set Connect Packet parameters.

10. Set the session version. MOVE 1 TO SESSION-VERSION-1.


MOVE 1 TO SESSION-VERSION-2.

11. Select the functional units. MOVE 0 TO FUNC-UNIT-TYPED-DATA.


MOVE 0 TO FUNC-UNIT-EXCEPTION.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 1 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.

12. Set the called reference length. MOVE CALLED-REFERENCE-DATA-LEN TO


SCI-CALLED-REFERENCE-DATA.

13. Set the common reference length. MOVE COMMON-REFERENCE-DATA-LEN TO


SCI-COMMON-REFERENCE-DATA.

14. Set the additional reference length. MOVE ADDITIONAL-REFERENCE-DATA-LEN TO


SCI-ADDITIONAL-REFERENCE-DATA.

15. Set the called reference data. MOVE CALLED-REFERENCE-DATA TO


SCI-CALLED-REFERENCE-DATA.

16. Set the common reference data. MOVE COMMON-REFERENCE-DATA TO


SCI-COMMON-REFERENCE-DATA.

continued

3787 3296-200 3-135


Accepting or Rejecting an Open Request (OSI$OPRESP)

continued

Procedure Typical COBOL Procedure Division Statements

17. Set the additional reference data. MOVE ADDITIONAL-REFERENCE-DATA TO


SCI-ADDITIONAL-REFERENCE-DATA.

Set Application Presentation Packet


parameters.

18. Set to accept connection. MOVE O TO OSI-APPL-PRES-RESULT.

19. Set the application context name alias. MOVE ’PRGA-CONTEXT’ TO


OSI-APPL-CONTEXT-NAME-ALIAS.

20. Set invocation-id lengths. MOVE 0 TO OSI-RESPONDING-P-INVOC-ID-LEN.


MOVE 0 TO OSI-RESPONDING-E-INVOC-ID-LEN.

21. Set the number of context table entries. MOVE 2 TO OSI-CONTEXT-TABLE-ENTRIES.

22. Set the presentation context identifier. MOVE 1 TO OSI-PRES-CONTEXT-IDENT (1).

23. Set the abstract syntax alias identifier. MOVE ’OIW-OCTET-STRING’ TO


OSI-ABSTRACT-SYNTAX-ALIAS (1).

24. Set the transfer syntax alias identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-
SYNTAX-ALIAS (1).

25. Set to accept presentation context. MOVE 0 TO OSI-CONTEXT-INDICATOR (1).

26. Set the presentation context id. MOVE 3 TO OSI-PRES-CONTEXT-IDENT (2).

27. Set the abstract syntax alias identifier. MOVE ’ACSE-AS’ TO OSI-ABSTRACT-
SYNTAX-ALIAS (2).

28. Set the transfer syntax alias identifier. MOVE ’ASN1-TS’ TO OSI-TRANSFER-
SYNTAX-ALIAS (2).

29. Set to accept presentation context. MOVE 0 TO OSI-CONTEXT-INDICATOR (2).

Set Address Packet parameters.

30. Set the responding application entity MOVE ’PROGA-AE-ALIAS’ TO


alias. OSI-RESPONDING-AE-TITLE-ALIAS.

Set output message buffer area.

31. Put message in output buffer. MOVE OPRESP-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

32. Issue the function call. COPY OSI-OPRESP.

3-136 3787 3296-200


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13. Requesting Tokens from a Peer Host


(OSI$PLTOKEN)
Use the OSI$PLTOKEN function to request tokens available for this connection but owned
by the peer program. The following chart indicates the relationship of token availability
and the functional units selected during conversation establishment.

Token Available Functional Unit Selected

OSI-DATA-TOKEN FUNC-UNIT-HALF-DUPLEX

OSI-SYNC-MINOR-TOKEN FUNC-UNIT-MINOR-SYNC

OSI-ACT-MAJOR-TOKEN FUNC-UNIT-ACT-MGT

3.13.1. OSI$PLTOKEN Format


COPY OSI-PLTOKEN.

or
CALL 'OSI$PLTOKEN' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$PLTOKEN request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a token request permits you to send a message along
with the request. OSI-MSG-BUFFER is the default name. You can specify your own name
in the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3787 3296-200 3-137


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$PLTOKEN function call uses the following
status packet parameters:

Table 3-33. OSI-STATUS-PKT Parameters for OSI$PLTOKEN

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI protocol you
are using
This value must be 1538 for this release. This value is set
automatically if you use the COPY verb format. If you use the
function call format, you must set this value using a standard
COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that identifies this


application program
This value must remain unchanged as long as this application
program is signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0, no


additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3-138 3787 3296-200


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$PLTOKEN function call. It is
specified in the working storage of this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer please tokens service request. It should be encoded according to the rules
specified in ISO 8823 Connection-oriented presentation protocol specification for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by
user-data [APPLICATION 1] length
user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3787 3296-200 3-139


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13.4. OSI-DATA-PKT

Table 3-34. OSI-DATA-PKT Parameters for OSI$PLTOKEN

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot


perform compression, it treats the data type as a 134
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3-140 3787 3296-200


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

Table 3-34. OSI-DATA-PKT Parameters for OSI$PLTOKEN (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP u
139 DDP-PPC reformats the data from nine to eight-bit
bytes, and also compresses the data. If it cannot
perform compression, it treats the data type as a 138
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer must be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected


session version 1, there is a limit of 512 bytes of session
data enforced by OSI session protocol. If you selected
session version 2, there is a limit of 10240 bytes of
session data enforced by OSI session protocol. In either
case, all user data and additional protocol header
information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no


message segmentation.

OSI-DATA-TOKEN This token is available for request only if the half-duplex


functional unit was selected for this connection. Set this
parameter to 3 (OSI-DATA-RQST) if you do not possess
the token and want the peer program to pass it to you.

OSI-SYNC-MINOR-TOKEN This token is available for request only if the minor


synchronize functional unit was selected for this
connection. Set this parameter to 3
(OSI-SYNC-MINOR-RQST) if you do not possess the token
and want the peer program to pass it to you.

continued

3787 3296-200 3-141


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

Table 3-34. OSI-DATA-PKT Parameters for OSI$PLTOKEN (cont.)

Parameter Description

OSI-ACT-MAJOR-TOKEN This token is available for request only if the activity


management functional unit was selected for this
connection. Set this parameter to 3
(OSI-ACT-MAJOR-RQST) if you do not possess the token
and want the peer program to pass it to you.

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


this conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
This parameter can be used for programs executing in
full duplex to determine when an OSI$RECEIVE function
should be issued.

3-142 3787 3296-200


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13.5. OSI$PLTOKEN Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to REQUEST. MOVE 3 TO OSI-ACT-MAJOR-TOKEN.

Call DDP-PPC

8. Issue the function. COPY OSI-PLTOKEN.

3787 3296-200 3-143


Requesting Tokens from a Peer Host (OSI$PLTOKEN)

3.13.6. OSI$PLTOKEN Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set output text length. MOVE PLTOKEN-MSG-LENGTH TO


OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to REQUEST. MOVE 3 TO OSI-ACT-MAJOR-TOKEN.

Set the output message buffer area.

10. Put the message in the output MOVE PLTOKEN-MSG TO OSI-MSG-BUFFER.


buffer.

Call DDP-PPC

11. Issue the function. COPY OSI-PLTOKEN.

3-144 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14. Receiving a Message from a Peer Program


(OSI$RECEIVE)
Use the OSI$RECEIVE function to receive messages from the peer program. Use the
OSI-MSG-TYPE parameter of the OSI-RCV-PKT to determine the type of message received
and which packets and parameters DDP-PPC returned on the function call.

Since many of the parameters returned for an open message (OSI-MSG-TYPE = 0,


OSI-MSG-OPEN) and an open response message (OSI-MSG-TYPE = 4, OSI-MSG-OPRESP)
differ from those returned for other message types, the OSI$RECEIVE function can be
thought of as having three formats. They are:

$ Receive new
This format receives an open message (new connection) from a peer program. It is
also referred to as the receive new mode because the mode parameter (OSI-MODE in
the RECEIVE packet) must be set to OSI-NEW-CONV.
$ Receive open response
This format receives an open response message format from the peer program.
$ Receive existing
This format is used to receive messages once the connection has been established
between the two applications.

Each of the formats is described in separate subsections following the descriptions of the
general format and the OSI-STATUS-PKT below, which are the same for all three formats.

3.14.1. OSI$RECEIVE General Format


The syntax of the OSI$RECEIVE function call is the same for all three formats. Only the
packet settings and returned values vary. Since the arguments are positional within the
function call, all must be passed on each function call.

If the message received is not a type that uses a specific packet, then DDP-PPC does not
return any information in that packet.
COPY OSI-RECEIVE.

or
CALL 'OSI$RECEIVE' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-CONNECT-PKT OSI-APPL-PRES-PKT
OSI-ADDRESS-PKT OSI-RCV-PKT OSI-SYNC-PKT
OSI-ACTIVITY-PKT OSI-RESYNC-PKT.

The OSI-STATUS-PKT argument references the data structures defined in your program
for the user-id and the status codes. On completion of this function call, DDP-PPC returns
the status codes for you to test. Parameters in this packet are set and returned the same
way for all formats of the OSI$RECEIVE function.

3787 3296-200 3-145


Receiving a Message from a Peer Program (OSI$RECEIVE)

The OSI-MSG-BUFFER argument references the input buffer storage area. This is where
DDP-PPC stores the user data it returns on the OSI$RECEIVE function. All OSI$RECEIVE
function formats use this area.

The OSI-DATA-PKT argument references the data packet statements for the connection-id
and all information concerning the data received. The parameters in this packet are set and
returned for all formats of the OSI$RECEIVE function.

The OSI-CONNECT-PKT argument references the connect packet statements for all
information necessary to establish a connection with a peer program. The receive existing
format does not use the parameters in this packet.

The OSI-APPL-PRES-PKT argument references the application presentation packet. It is


used only when the application layer is selected. It contains information necessary for
opening connections between application layers and information for presentation context
identifiers. The parameters in this packet are set and returned for all formats of the
OSI$RECEIVE function.

The OSI-ADDRESS-PKT argument references the data packet statements for addressing
information necessary to establish a connection with a peer program. The receive existing
format does not use the parameters in this packet.

The OSI-RCV-PKT argument references the receive packet to determine the mode (receive
new or receive existing) and the type of message received. The parameters in this packet
are set and returned for all formats of the OSI$RECEIVE function.

The OSI-SYNC-PKT argument references the synchronization packet for synchronization


information returned by DDP-PPC. Only the receive existing format uses the parameters in
this packet.

The OSI-ACTIVITY-PKT argument references the activity packet for activity management
information that DDP-PPC has received. Only the receive existing format uses the
parameters in this packet.

The OSI-RESYNC-PKT argument references the resynchronization packet for


resynchronization information returned by DDP-PPC. Only the receive existing format
uses the parameters in this packet.

3-146 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.2. OSI-STATUS-PKT
The status packet is shown in Appendix A. All OSI$RECEIVE function call formats use the
following status packet parameters:

Table 3-35. OSI-STATUS-PKT Parameters for OSI$RECEIVE

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-147


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.3. Receive New Format


The receive new format is used only to receive incoming open requests queued for this
program. It is indicated by setting the OSI-MODE parameter in the RECEIVE packet to
OSI-NEW-CONV and returns a no-message status if no messages are queued for this
program. DDP-PPC always sets OSI-MSG-TYPE to 0, OSI-MSG-OPEN, when an OSI-OK
status is returned.

The OSI$RECEIVE function for the receive new format uses the packets and settings
shown in the following subsections.

OSI-STATUS-PKT (Receive New Format)

The description of the OSI-STATUS-PKT at the beginning of this OSI$RECEIVE section is


the same for all three formats.

OSI-MSG-BUFFER Area (Receive New Format)

This is a storage area where DDP-PPC moves the data received on the OSI$RECEIVE
function. It is specified as a data structure in this application program.

If the session layer entry is being used, then the data DDP-PPC returns to the user program
consists of eight-bit bytes of information. The two communicating programs determine the
form of the data.

If the application layer entry is being used, this field maps to the user-information
parameter of the AARQ-apdu in ISO 8650 Information Processing Systems - Open
Systems Interconnection - Protocol Specification for the Association Control Service
Element. It should be decoded according to ISO 8825 Basic Encoding Rules for Abstract
Syntax Notation One (ASN.1).

Because the user program must decode the user data from the transfer syntax for any data
type except 140 or 141, it is performing a function of the OSI presentation layer. If it
encounters errors during this decoding process and must reject the open request, it should
use the presentation provider reasons of the OSI-APPL-PRES-RESULT parameter, values
13 through 20.

The following diagram shows what part of the user-information parameter DDP-PPC
decodes and what part the user program must decode for data types 134, 135, 138, and 139:

3-148 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

decoded by user-
DDP-PPC information [30] length

decoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
decoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3787 3296-200 3-149


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-DATA-PKT (Receive New Format)

Table 3-36. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive New Format)

Parameter Description

Values Set by User

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer from the


DDP-PPC buffers to the user data buffer. The maximum is
10240. If you specify a size smaller than the actual
message, the data is truncated and lost.

OSI-TEXT-START The byte index into the message at which the transfer
between DDP’s buffers and OSI-MSG-BUFFER begins. You
must set this value to a multiple of 4.

OSI-DATA-RELEASE Must be set to 1 (OSI-REL) to indicate the message is to


be released after it is received.

Values Returned by DDP-PPC

OSI-CONNECTION The value returned on successful completion of an


OSI$RECEIVE (receive new format) function call. This
value identifies this connection and must be used on all
subsequent function calls for this connection.

OSI-DATA-TYPE Used on the application level entry only; indicates the


way the peer program encoded that data and whether
the user program must encode the data returned by
DDP-PPC according to ASN.1 Basic Encoding Rules. See
the section on the OSI-MSG-BUFFER area for decoding
information.

v OSI-TRANSPARENT-TYPE 134 The remote application encoded the data in ASN.1


format and the user program must decode the
EXTERNAL type and the user data.

continued

3-150 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-36. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive New Format) (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMPRESSED-TRANSP 135 DDP-PPC on the peer host compressed the user


data before sending it. DDP-PPC on this host
decompresses it before giving it to the user program.
The peer program encoded the data in ASN.1 format and
this program must decode the EXTERNAL type and the
user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC on the peer host reformatted the data


from nine to eight-bit bytes. DDP-PPC on this host
reformats the data before giving it to the user program.
The peer program encoded the data in ASN.1 format and
this program must decode the EXTERNAL type and the
user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC on the peer host compressed and


reformatted the data from nine to eight-bit bytes.
DDP-PPC decompresses and reformats the data before
giving it to the user program. The peer program encoded
the data in ASN.1 format and this program must encode
the EXTERNAL type and the user data.

v OSI-OCTET-STRING 140 The peer program encoded the data received as


an octet string in ASN.1 format. DDP-PPC decodes the
ASN.1 octet string and return the contents octets to the
user program.

v OSI-COMP-OCTET-STRING 141 DDP-PPC on the peer host compressed the data


and encoded it as an ASN.1 octet string. DDP-PPC
decompresss and decodes the ASN.1 octet string and
returns the contents octets to the user program.

OSI-UNIT-INDICATOR Set to 1 (OSI-MSG-COMPL) for the receive new format to


indicate a complete message has been received.

continued

3787 3296-200 3-151


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-36. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive New Format) (cont.)

Parameter Description

OSI-DATA-TOKEN Indicates whether the peer program has initially


positioned the data token or has given the choice of
positioning it to this program.
$ 0 OSI-DATA-HOLD
The peer program has retained the token.
$ 1 OSI-DATA-PASS
The peer program has passed the token.
$ 2 OSI-DATA-CHOICE - This program can choose the
initial setting of this token.

OSI-SYNC-MINOR-TOKEN Indicates whether the peer program has initially


positioned the sync minor token or has given the choice
of positioning it to this program.
See OSI-DATA-TOKEN for a description of the values that
can be returned.

OSI-ACT-MAJOR-TOKEN Indicates whether the peer program has initially


positioned the activity major token or has given the
choice of positioning it to this program.
See OSI-DATA-TOKEN for a description of the values that
can be returned.

OSI-SYNC-POINT-SERIAL-NUMBER The initial synchronization point serial number the peer


program proposed. It identifies a value for the minor
synchronization point (checkpoint) that the programs will
use. This number is returned only if the peer program
proposed the minor synchronize
(FUNC-UNIT-MINOR-SYNC) or resynchronize
(FUNC-UNIT-RESYNC) functional unit.

3-152 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-CONNECT-PKT (Receive New Format)

Table 3-37. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive New Format)

Parameter Description

Values Set by User

OSI-SERVICE-ENTRY Sets the interface level for the OSI connection. Valid
values are:
$ 5 uThe session level
If you select the session level, it is assumed that
application and presentation protocols are not
required or will be supplied by your program in the
user data.
$ 7 uThe application level
Values Returned by DDP-PPC

OSI-TRANSPORT-CLASS The transport class of service successfully negotiated


between the transport services. See the description of
this field in 3.11 for the OSI$OPEN function call for the
meanings of the settings.
Note the following:
$ This field is set to 32 if TCP/IP Transport Services
were used.
$ This field is always set to 99
(OSI-TRANSPORT-CLASS-NOT-USED) for local
connections.

OSI-TRANSPORT-FACILITIES The transport services the transport service providers


negotiated for this connection. See the description of this
field in 3.11 for the OSI$OPEN function call for the
meanings of the settings.
This field is always set to 18 for local connections.

OSI-SESSION-VERSION The versions of the session layer protocol the peer


program proposed for this connection. If the peer
program chose multiple versions, your program must
select the level it wants to use.

continued

3787 3296-200 3-153


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-37. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED The OSI functionality this application program proposes


to use. Each functional unit provides a specific subset of
the entire OSI functionality (for example, the half-duplex
functional unit provides the ability to perform two-way
alternate communication).
$ u
0 The specific functional unit data names the
program does not want to propose.
$ 1uThe specific functional unit data names the
program wants to propose.
Both this program and the peer program must propose a
functional unit in order to use its functionality.

v FUNC-UNIT-TYPED-DATA Allows for the transfer of data in a manner that is not


subject to the control imposed by the availability of the
data token.

v FUNC-UNIT-EXCEPTIONS Allows for the reporting of detected errors without


aborting the connection.

v FUNC-UNIT-CAP-DATA (capability data) Allows for the confirmed transfer of data when the
activity management functional unit has been selected
but no activity is in progress.

v FUNC-UNIT-ACT-MGT (activity Allows for the management of synchronized logical


management) pieces of work.

OSI-FUNC-UNITS-SELECTED (cont.)

v FUNC-UNIT-RESYNC (resynchronize) Allows for the modification of synchronization point serial

v FUNC-UNIT-MINOR-SYNC numbers and reassignment of tokens.


Allows for the placement of minor synchronization points,
identified by serial numbers, in the normal data flow.

v FUNC-UNIT-DUPLEX Allows for the uncontrolled right to send data.

v FUNC-UNIT-HALF-DUPLEX Allows for the controlled right to send data.

v FUNC-UNIT-DATA-SEP (data Allows for the protection of data in the event of


separation) resynchronization.

continued

3-154 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-37. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

SCI-CALLING-REFERENCE-LEN The length, in bytes, of data returned in the


SCI-CALLING-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-CALLING-REFERENCE parameter
because the peer program did not pass anything.

SCI-COMMON-REFERENCE-LEN The length, in bytes, of data returned in the


SCI-COMMON-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-COMMON-REFERENCE parameter
because the peer program did not pass anything.

SCI-ADDITIONAL-REFERENCE-LEN The length, in bytes, of data returned in the


SCI-ADDITIONAL-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-ADDITIONAL-REFERENCE parameter
because the peer program did not pass anything.

OSI-CN-SESSION-CONNECTION-ID

v SCI-CALLING-REFERENCE User-defined. DDP-PPC passes the contents of this


fieldfrom the peer program unless you set the
SCI-CALLING-REFERENCE-LEN field to 0.

v SCI-COMMON-REFERENCE User-defined. DDP-PPC passes the contents of this field


from the peer program unless you set the
SCI-COMMON-REFERENCE-LEN field to 0.

v SCI-ADDITIONAL-REFERENCE User-defined. DDP-PPC passes the contents of this field


from the peer program unless you set the
SCI-ADDITIONAL-REFERENCE-LEN field to 0.

3787 3296-200 3-155


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-APPL-PRES-PKT (Receive New Format)

Table 3-38. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive New Format)

Parameter Description

Values Returned by DDP-PPC

OSI-APPL-CONTEXT-NAME-ALIAS The user-defined name for an APPLICATION CONTEXT


record in the Configuration Services database. If
DDP-PPC cannot find an APPLICATION CONTEXT record
with an application context id that matches the
application context parameter received on the open
request, DDP-PPC sets this field to all spaces.

OSI-APPL-CONTEXT-NAME The actual application context identifier the peer program


proposed. This value identifies a set of services that the
peer program proposes for this connection. It may be
overridden on the open response.
DDP-PPC does not use or validate the actual contents of
this parameter. The format of this parameter is the
contents octets of an ASN.1 object identifier encoded
according to ASN.1 Basic Encoding Rules.

OSI-APPL-CONTEXT-NAME-LEN The length of the OSI-APPL-CONTEXT-NAME parameter.

OSI-PRES-MODE Set to 0 (OSI-PRES-NORMAL-MODE) to indicate that ACSE


normal mode is used for this connection.

OSI-CALLED-P-INVOCATION-ID The invocation (copy) of the Application Process that is


the intended acceptor of the open request. DDP-PPC
does not use the contents of this parameter to route the
connect request.

OSI-CALLED-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


intended acceptor of the open request. DDP-PPC does
not use the contents of this parameter to route the
connect request.

OSI-CALLING-P-INVOCATION-ID The invocation (copy) of the Application Process that is


the requestor of the open request. DDP-PPC does not
use the contents of this parameter to route the connect
request.

OSI-CALLING-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


requestor of the open request. DDP-PPC does not use the
contents of this parameter to route the connect request.

OSI-CALLED-P-INVOC-ID-LEN The length of the OSI-CALLED-P-INVOCATION-ID


parameter. If it is 0, DDP-PPC did not receive a Called
Application Process Invocation Id parameter from the
peer program.

continued

3-156 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-38. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-CALLED-E-INVOC-ID-LEN The length of the OSI-CALLED-E-INVOCATION-ID


parameter. If it is 0, DDP-PPC did not receive a Called
Application Entity Invocation Id parameter from the peer
program.

OSI-CALLING-P-INVOC-ID-LEN The length of the OSI-CALLING-P-INVOCATION-ID


parameter. If it is 0, DDP-PPC did not receive a Calling
Application Process Invocation Id parameter from the
peer program.

OSI-CALLING-E-INVOC-ID-LEN The length of the OSI-CALLING-E-INVOCATION-ID


parameter. If it is 0, DDP-PPC did not receive a Calling
Application Entity Invocation Id parameter from the peer
program.

OSI-PRES-CONTEXT-TABLE-ENTRIES The number of OSI-CONTEXT-TABLE entries DDP-PPC


returned.

continued

3787 3296-200 3-157


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-38. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-PRES-CONTEXT-TABLE

v OSI-PRES-CONTEXT-IDENT The presentation context for this abstract and transfer


syntax combination. This value is the same as the one
supplied by the program that issued the open request.

v OSI-ABSTRACT-SYNTAX-ALIAS The user-defined name for an ABSTRACT SYNTAX record


in the Configuration Services database. DDP-PPC obtains
the name by matching the Abstract Syntax Id value for an
ABSTRACT SYNTAX record in the Configuration Services
database with the abstract syntax identifier received on
the open request.

v OSI-TRANSFER-SYNTAX-ALIAS The user-defined name for a TRANSFER SYNTAX record


in the Configuration Services database. DDP-PPC obtains
this name by matching the Transfer Syntax Id value for a
TRANSFER SYNTAX record in the Configuration Services
database with the transfer syntax identifier received on
the open request.

v OSI-CONTEXT-INDICATOR Indicates whether DDP-PPC accepted the abstract and


transfer syntax combination (presentation context). Your
program must then decide whether it can encode or
decode the user data using the syntaxes indicated in this
presentation context table entry.
A 0 indicates DDP-PPC accepted the context and the
program can use it during the connection as a way to
encode and decode data.
Any other value indicates DDP-PPC rejected the context
and the program cannot use it during this connection.

3-158 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-ADDRESS-PKT (Receive New Format)

Table 3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format)

Parameter Description

Values Returned by DDP-PPC

OSI-CALLING-AE-TITLE DDP-PPC does not return these fields if the session layer
entry is used.

v OSI-CALLING-AE-TITLE-ALIAS DDP-PPC sets this field to spaces.

v OSI-CALLING-AP-TITLE The Application Process Title of the peer program. Its


contents are either a directory name as defined by IS0
9594-2 or the contents octets of an ASN.1 object
identifier. It is encoded according to ASN.1 Basic
Encoding Rules.

v OSI-CALLING-AE-QUAL The value of the Application Entity Qualifier for the peer
program. Its contents are a directory
RelativeDistinquishedName type as defined in ISO 9594-2
or the contents octets of an ASN.1 integer. It is encoded
according to ASN.1 Basic Encoding Rules.

v OSI-CALLING-AE-TITLE-FORM Indicates the encoding of the OSI-CALLING-AP-TITLE and


OSI-CALLING-AE-QUAL parameters.
$ u
D The form of OSI-CALLING-AP-TITLE is a directory
name and the form of OSI-CALLING-AE-QUAL is a
directory RelativeDistinguishedName.
$ u
O The form of OSI-CALLING-AP-TITLE is an ASN.1
object identifier and the form of
OSI-CALLING-AE-QUAL is an ASN.1 integer.

continued

3787 3296-200 3-159


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-CALLING-P-ADDRESS

v OSI-CALLING-P-SELECTOR The value of the Presentation Selector (P-SEL) for the


peer program. This parameter is normally not set by
OS 2200 applications.
DDP-PPC does not return this field if the session layer
entry is used.

v OSI-CALLING-S-SELECTOR The value of the Session Selector (S-SEL) for the peer
program.

v OSI-CALLING-T-SELECTOR The value of the Transport Selector (T-SEL) for the peer
program.

v OSI-CALLING-NSAP The value of the NSAP for the peer program.

OSI-CALLING-AE-TITLE-LEN DDP-PPC does not return these fields if the session layer
entry is used.

v OSI-CALLING-AP-TITLE-LEN The length, in bytes, of the data in the


OSI-CALLING-AP-TITLE parameter. If it is 0, DDP-PPC did
not receive a value for the Calling Application Process
Title on the open request.

v OSI-CALLING-AE-QUAL-LEN The length, in bytes, of the data in the


OSI-CALLING-AE-QUAL parameter. If it is 0, DDP-PPC did
not receive a value for the Calling Application Entity
Qualifier on the open request.

continued

3-160 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-CALLING-P-ADDRESS-LEN

v OSI-CALLING-P-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLING-P-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Calling Presention Services
Access Point on the open request.
DDP-PPC does not return this field if the session layer
entry is used.

v OSI-CALLING-S-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLING-S-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Calling Session Selector
on the open request.

v OSI-CALLING-T-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLING-T-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Calling Transport Selector
on the open request.

v OSI-CALLING-NSAP-LEN The length, in bytes, of the data in the


OSI-CALLING-NSAP-SELECTOR parameter. If it is 0,
DDP-PPC did not receive a value for the Calling NSAP on
the open request.

continued

3787 3296-200 3-161


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-CALLED-AE-TITLE

v OSI-CALLED-AE-TITLE-ALIAS DDP-PPC sets this parameter to spaces.


DDP-PPC does not return this field if the session layer
entry is used.

v OSI-CALLED-AP-TITLE The Application Process Title of this application. Its


contents are either a directory name as defined by ISO
9594-2 or the contents octets of an ASN.1 object
identifier. It is encoded according to ASN.1 Basic
Encoding Rules.

v OSI-CALLED-AE-QUAL The value of the Application Entity Qualifier for this


application. Its contents are a directory
RelativeDistinguishedName type as defined in ISO 9594-2
or the contents octets of an ASN.1 integer. It is encoded
according to ASN.1 Basic Encoding Rules.

v OSI-CALLED-AP-TITLE-FORM Indicates the encoding of the OSI-CALLED-AP-TITLE and


OSI-CALLED-AE-QUAL parameters.
$ u
D The form of OSI-CALLED-AP-TITLE is a directory
name and the form of OSI-CALLED-AE-QUAL is a
directory RelativeDistinguishedName.
$ u
O The form of OSI-CALLED-AP-TITLE is an ASN.1
object identifier and the form of
OSI-CALLED-AE-QUAL is an ASN.1 integer.

OSI-CALLED-P-ADDRESS

v OSI-CALLED-P-SELECTOR The Presentation Selector (P-SEL) for this application.


This parameter is normally not set for OS 2200
applications.
DDP-PPC does not return this field if the session layer
entry is used.

v OSI-CALLED-S-SELECTOR The value of the Session Selector (S-SEL) for this


application.

v OSI-CALLED-T-SELECTOR The value of the Transport Selector (T-SEL) for this


application.

continued

3-162 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-39. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive New Format)


(cont.)

Parameter Description

OSI-CALLED-AE-TITLE-LEN DDP-PPC does not return these fields if the session layer
entry is used.

v OSI-CALLED-AP-TITLE-LEN The length, in bytes, of the data in the


OSI-CALLED-AP-TITLE parameter. If it is 0, DDP-PPC did
not receive a value for the Called Application Process
Title on the open request.

v OSI-CALLED-AE-QUAL-LEN The length, in bytes, of the data in the


OSI-CALLED-AE-QUAL parameter. If it is 0, DDP-PPC did
not receive a value for the Called Application Entity
Qualifier on the open request.

OSI-CALLED-P-ADDRESS-LEN

v OSI-CALLED-P-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLED-P-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Called Presentation
Selector on the open request.
DDP-PPC does not return this field if the session layer
entry is used.

v OSI-CALLED-S-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLED-S-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Called Session Selector on
the open request.

v OSI-CALLED-T-SELECTOR-LEN The length, in bytes, of the data in the


OSI-CALLED-T-SELECTOR parameter. If it is 0, DDP-PPC
did not receive a value for the Called Transport Selector
on the open request.

v OSI-CALLED-NSAP-LEN This field is set to 0.

3787 3296-200 3-163


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-RCV-PKT (Receive New Format)

Table 3-40. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive New Format)

Parameter Description

Values Set by User

OSI-RCV-WAIT-TIME The number of seconds DDP-PPC should wait for an


incoming message before returning a no-message status.
A value of 0 indicates DDP-PPC should not wait.
A negative value indicates an infinite wait.

OSI-MODE Set to 1 (OSI-NEW-CONV) to indicate that the


OSI$RECEIVE is to receive any open requests on the
queue.

Values Returned by DDP-PPC

OSI-MSG-TYPE The type of message received. A 0 (OSI-MSG-OPEN)


indicates that an open request was received.

OSI-TOTAL-MSG-LEN The length, in bytes, of the message received.

3-164 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.4. Receive Open Response Format


Use the receive open response format to receive the response to the open request the
program sent. This format of the OSI$RECEIVE function should be issued after an
OSI$OPEN function has been successfully issued. The OSI-MSG-TYPE that DDP-PPC
returns for this format is 4, OSI-MSG-OPRESP.

he response may be either acceptance or rejection of the open request, depending on the
setting of the OSI-APPL-PRES-RESULT field if the application layer entry is used or the
OSI-SESSION-RESULT field if the session layer entry is used.

The OSI$RECEIVE function for the receive open response format uses the packets and
settings described in the following subsections.

OSI-STATUS-PKT (Receive Open Response Format)


The description of the OSI-STATUS-PKT at the beginning of this OSI$RECEIVE subsection
is the same for all three formats.

OSI-MSG-BUFFER Area (Receive Open Response Format)


This is a storage area where DDP-PPC moves the data received on the OSI$RECEIVE
function. It is specified as a data structure in this application program.

If the session layer entry is being used, then the data DDP-PPC returns to the user program
consists of eight-bit bytes of information. The two communicating programs determine the
form of the data.

If the application layer entry is being used, this field maps to the user-information
parameter of the AARE-apdu in ISO 8650 Information Processing Systems - Open
Systems Interconnection - Protocol Specification for the Association Control Service
Element. It should be decoded according to ISO 8825 Basic Encoding Rules for Abstract
Syntax Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
decodes and what part the user program must decode for data types 134, 135, 138, and 139:

3787 3296-200 3-165


Receiving a Message from a Peer Program (OSI$RECEIVE)

decoded by user-
DDP-PPC information [30] length
decoded by
EXTERNAL EXTERNAL length
user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
decoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

3-166 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-DATA-PKT (Receive Open Response Format)

Table 3-41. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Open Response


Format)

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN function call.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer from the


DDP-PPC buffers to the user buffer area. The maximum is
10240 bytes. If you specify a smaller size, the extra data
is truncated and lost.

OSI-TEXT-START The byte index into the message at which the transfer
between the DDP-PPC buffers and the OSI-MSG-BUFFER
begins. It must be a multiple of 4.

OSI-DATA-RELEASE Must be set to 1 (OSI-REL) to indicate the message is to


be released after it is received.

Values Returned by DDP-PPC

OSI-DATA-TYPE Returned only when the application level entry is used. It


indicates the way the peer program encoded the data
and whether the user program must decode the data
returned by DDP-PPC according to ASN.1 Basic Encoding
Rules. See the OSI-MSG-BUFFER Area subsection.

v OSI-TRANSPARENT-TYPE 134 The remote application encoded the data in ASN.1


format and the user program must decode the
EXTERNAL type and the user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC on the peer host compressed the user


data before sending it. DDP-PPC on this host
decompresses it before giving it to the user program.
Also, the peer program encoded the data in ASN.1
format and this program must decode the EXTERNAL
type and the user data.

continued

3787 3296-200 3-167


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-41. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Open Response


Format) (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-PAD-TRANSPARENT 138 DDP-PPC on the peer host reformatted the data


from nine to eight-bit bytes. DDP-PPC on this host
reformats the data before giving it to the user program.
Also, the peer program encoded the data in ASN.1
format and this program must decode the EXTERNAL
type and the user data.

v OSI-COMP-PAD-TRANSP 139 DDP-PPC on the peer host compressed and


reformatted the data from nine to eight-bit bytes.
DDP-PPC decompresses and reformats the data before
giving it to the user program. Also, the peer program
encoded the data in ASN.1 format and this program must
decode the EXTERNAL type and the user data.

v OSI-OCTET-STRING 140 The peer program encoded the data received as


an octet string in ASN.1 format. DDP-PPC encodes the
ASN.1 octet string and return the contents octets to the
user program.

v OSI-COMP-OCTET-STRING 141 DDP-PPC on the peer host compressed the data


and encoded it as an ASN.1 octet string. DDP-PPC
decompresses and decodes the ASN.1 octet string and
returns the contents octets to the user program.

OSI-UNIT-INDICATOR Set to 1 (OSI-MSG-COMPL) for the receive open response


format to indicate a complete message has been
received.

OSI-DATA-TOKEN Indicates whether the peer program held, passed, or


requested the token.
$ If 0 (OSI-DATA-HOLD), and the peer program
received a token choice on the open request, the
peer program held the token.
If no token choice was received, no change in
possession occurs.
$ If 1 (OSI-DATA-PASS), the peer program received a
token choice and passed the token back to this
program.
$ If 3 (OSI-DATA-RQST), the peer program is
requesting that the token be passed. This is
informational only and does not require that the peer
program pass the token.

continued

3-168 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-41. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Open Response


Format) (cont.)

Parameter Description

OSI-SYNC-MINOR-TOKEN Indicates whether the peer program held, passed, or


requested the token; this parameter is returned only if
the connection is accepted.
See OSI-DATA-TOKEN for a description of the values that
can be returned.

OSI-ACT-MAJOR-TOKEN Indicates whether the peer program held, passed, or


requested the token; this parameter is returned only if
the connection is accepted.
See OSI-DATA-TOKEN for a description of the values that
can be returned.

OSI-SYNC-POINT-SERIAL-NUMBER The negotiated value for the initial synchronization point


serial number. This parameter is returned only if the peer
program has accepted the connection.

3787 3296-200 3-169


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-CONNECT-PKT (Receive Open Response Format)

The user does not set any values in the CONNECT packet for the receive open response
function.

Table 3-42. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format)

Parameter Description

Values Returned by DDP-PPC

OSI-TRANSPORT-CLASS The transport class of service successfully negotiated


between the transport services. See the description of
this field for the OSI$OPEN function call in 3.11 for the
meaning of the settings.
Note the following:
$ This field is set to 32 if TCP/IP Transport Services
are used.
$ This field is set to 99
(OSI-TRANSPORT-CLASS-NOT-USED) for local
connections.

OSI-TRANSPORT-FACILITIES The transport services the transport service providers


negotiated for this connection. See the description of this
field for the OSI$OPEN function call in Section 3.11 for
the meaning of the settings.
This field is always 18 for local connections.

continued

3-170 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-42. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

Parameter Description

OSI-SESSION-RESULT This field is only used when the session layer entry is
used. It indicates whether the program or session
service provider accepted or rejected the open request.
DDP-PPC returns one of the following values:

v OSI-CN-ACCEPT 0 An accepted connection.

v OSI-CN-REJ-USR-NO-REASON 1 A connection rejected with an unspecified reason.

v OSI-CN-REJ-USR-CONGESTION 2 A connection rejected due to temporary congestion.

v OSI-CN-REJ-USR-SEE-DATA 3 A connection rejected due to a reason provided in the


text.

v OSI-CN-REJ-PRO-SEL-UNKNOWN 4 The remote session service selector is unknown.

v OSI-CN-REJ-PRO-NOT-ATTACH 5 The remote session service user is not attached to


the session services access point (SSAP).
If the remote host is an OS 2200 host, this could mean
that DDP-PPC encountered an error starting the batch run
or TIP transaction.

v OSI-CN-REJ-PRO-CONGESTION 6 The remote session service provider rejected the


connection due to temporary congestion.

v OSI-CN-REJ-PRO-VER-UNSUPPORTED 7 The session service provider does not support the


proposed version of session protocols.

v OSI-CN-REJ-PRO-NO-REASON 8 The remote session service provider rejected the


connection for an unspecified reason.

OSI-SESSION-VERSION All versions of the session layer protocol the peer


program supports that are suitable for this connection.
The highest version number indicated on both the open
request and open response is used for this connection.

continued

3787 3296-200 3-171


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-42. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

Parameter Description

OSI-FUNC-UNITS-SELECTED The OSI functional units selected for this connection. The
contents depend on whether the connection was
accepted or how it was rejected:
$ If the session layer interface was used and
OSI-SESSION-RESULT was set to 0 (OSI-CN-ACCEPT)
or
If the application layer interface was used and
OSI-APPL-PRES-RESULT was set to 0
(OSI-AU-ASSOC-ACCEPTED),
then the condition was accepted. DDP-PPC sets
those functional units that the peer program
proposes and supports to 1. It resets the other
functional units to 0. The functional units selected
for use on this connection are the ones that were
proposed on both the open request and open
response.
$ If the session layer interface was used and
OSI-SESSION-RESULT was set to 3
(OSI-CN-REJ-USR-SEE-DATA), DDP-PPC sets those
functional units the peer program proposes to 1.
$ If the application layer interface was used and
OSI-APPL-PRES-RESULT was set to 1 through 10
(indicating the ACSE service user rejected the
connection), DDP-PPC sets those functional units the
peer program proposes to 1.
$ If the application layer interface was used and
OSI-APPL-PRES-RESULT was set to 11 through 20
(indicating the ACSE service provider or the
presentation service provider rejected the
connection), DDP-PPC sets the functional units to the
OSI default value. For details, see
OSI-FUNC-UNITS-SELECTED in the description of the
OSI$OPRESP function call in 3.12.
$ If the connection is rejected for any other reason,
DDP-PPC does not return the functional unit
parameters.

SCI-CALLED-REFERENCE-LEN The length, in bytes, of data returned in the


SCI-CALLED-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-CALLED-REFERENCE parameter
because the peer program did not pass anything.

continued

3-172 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-42. OSI-CONNECT-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

Parameter Description

SCI-COMMON-REFERENCE-LEN The length, in bytes, of data returned in the


SCI-COMMON-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-COMMON-REFERENCE parameter
because the peer program did not pass anything.

SCI-ADDITIONAL-REFERENCE-LEN The length, in bytes, of data returned in the SCI-


ADDITIONAL-REFERENCE parameter. It can be in the
range 0 to 64. A value of 0 indicates that DDP-PPC did
not return the SCI-ADDITIONAL-REFERENCE parameter
because the peer program did not pass anything.

OSI-CN-SESSION-CONNECTION-ID These fields are user-defined. DDP-PPC passes the


contents of each of these fields from the peer program
unless the field’s respective reference length field is 0.

v SCI-CALLED-REFERENCE
v SCI-COMMON-REFERENCE
v SCI-ADDITIONAL-REFERENCE

3787 3296-200 3-173


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-APPL-PRES-PKT (Receive Open Response Format)

For the receive open response, this packet contains the results of the presentation context
negotiations. Only those contexts that were accepted can be used to encode the data
during this connection.

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format)

Values Returned by DDP-PPC

OSI-APPL-CONTEXT-NAME-ALIAS The user-defined name for an APPLICATION CONTEXT


record in the Configuration Services database. If
DDP-PPC cannot find an APPLICATION CONTEXT record
with an application context id that matches the
application context parameter received on the open
request, DDP-PPC sets this field to all spaces.

OSI-APPL-CONTEXT-NAME The actual application context identifier, which identifies a


set of services that the peer program proposes for this
connection.
DDP-PPC does not use or validate the actual contents of
this parameter. The format of this parameter is the
contents octets of an ASN.1 object identifier encoded
according to ASN.1 Basic Encoding Rules.

OSI-APPL-CONTEXT-NAME-LEN The length of the OSI-APPL-CONTEXT-NAME parameter.

OSI-RESPONDING-P-INVOCATION-ID The invocation (copy) of the Application Process that is


the actual acceptor of the open request. DDP-PPC does
not use the contents of this parameter to route the
connect request.

OSI-RESPONDING-E-INVOCATION-ID The invocation (copy) of the Application Entity that is the


actual acceptor of the open request. DDP-PPC does not
use the contents of this parameter to route the connect
request.

OSI-RESPONDING-P-INVOC-ID-LEN The length of the OSI-RESPONDING-P-INVOCATION-ID


parameter. If this value is 0, DDP-PPC did not receive a
Responding Application Process Invocation Id parameter
in the protocol.

OSI-RESPONDING-E-INVOC-ID-LEN The length of the OSI-RESPONDING-E-INVOCATION-ID


parameter. If this value is 0, DDP-PPC did not receive a
Responding Application Entity Invocation Id parameter.

continued

3-174 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

OSI-APPL-PRES-RESULT Indicates whether the connection was accepted or


rejected. DDP-PPC can return the following values for this
parameter:

v OSI-AU-ASSOC-ACCEPTED 0 uThe peer program accepted the connection.


v OSI-AU-NO-REASON 1 The peer program rejected the connection with an
unspecified reason.

v OSI-AU-APPL-CNTXT-UNSUPPORTED 2 The peer program rejected the connection because it


does not support the proposed application context.

v OSI-AU-CALLG-AP-TITLE-UNRECOG 3 The peer program rejected the connection because it


did not recognize the Calling Application Process Title.

v OSI-AU-CALLG-AP-INVID-UNRECOG 4 The peer program rejected the connection because it


did not recognize the Calling Application Invocation Id.

v OSI-AU-CALLG-AE-QUAL-UNRECOG 5 The peer program rejected the connection because it


did not recognize the Calling Application Entity Qualifier.

v OSI-AU-CALLG-AE-INVID-UNRECOG 6 The peer program rejected the connection because it


did not recognize the Calling Application Invocation Id.

v OSI-AU-CALLD-AP-TITLE-UNRECOG 7 The peer program rejected the connection because it


did not recognize the Called Application Process Title.

v OSI-AU-CALLD-AP-INVID-UNRECOG 8 The peer program rejected the connection because it


did not recognize the Called Application Process
Invocation Id.

continued

3787 3296-200 3-175


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

OSI-APPL-PRES-RESULT (cont.)

v OSI-AU-CALLD-AE-QUAL-UNRECOG 9 The peer program rejected the connection because it


did not recognize the Called Application Entity Qualifier.

v OSI-AU-CALLD-AE-INVID-UNRECOG 10 The peer program rejected the connection because


it did not recognize the Called Application Entity
Invocation Id.

v OSI-AP-NO-REASON 11 The remote ACSE service provider rejected the


connection for an unspecified reason.

v OSI-NO-COMMON-ACSE-VERSION 12 The ACSE remote service provider rejected the


connection because it could not support the version of
ACSE DDP-PPC proposed.

v OSI-PP-NO-REASON 13 The remote presentation service provider rejected


the connection for an unspecified reason.

v OSI-PP-CONGESTION 14 The remote presentation service provider rejected


the connection due to congestion.

v OSI-PP-LOCAL-LIMIT-EXCEEDED 15 The remote presentation service provider rejected


the connection because too many context sets were
proposed.

v OSI-PP-PRES-ADDR-UNKNOWN 16 The remote presentation service provider rejected


the connection because it could not locate the called
Presentation Services Access Point.

v OSI-PP-PROT-VER-UNSUPPORTED 17 The remote presentation service provider rejected


the connection because it could not support the version
of the presentation protocol DDP-PPC proposed.

v OSI-PP-DEF-CONTEXT-UNSUPPORTED 18 The remote presentation service provider rejected


the connection because it could not support the default
context DDP-PPC proposed.

continued

3-176 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

OSI-APPL-PRES-RESULT (cont.)

v OSI-PP-USER-DATA-UNREADABLE 19 The remote presentation service provider rejected


the connection because it could not decode the
presentation user data DDP-PPC and your program
encoded.

v OSI-PP-NO-PSAP-AVAILABLE 20 The remote presentation service provider rejected


the connection because no presentation server was
available at the time of the open request.

v OSI-SP-SSAP-ID-UNKNOWN 21 The called session selector or session service


access point (SSAP) on the open request is unknown on
the remote host.

v OSI-SP-USER-NOT-ATTACHED 22 The remote session service user is not attached to


the SSAP. If that host is an OS 2200 host, DDP-PPC may
have encountered an error starting the run from the
DDP*RUN-STREAMS file starting the TIP transaction.

v OSI-SP-SPM-CONGESTION 23 /The remote session service provider rejected the


connection due to congestion.

v OSI-SP-PROT-VER-UNSUPPORTED 24 The remote session service provider does not


support the protocol version proposed on the open
request.

v OSI-SP-SPM-NO-REASON 25 The remote session service provider rejected the


connection for an unspecified reason.

v OSI-SU-NO-REASON 26 The connection was rejected with an unspecified


reason.

v OSI-SU-CONGESTION 27 The connection was rejected due to temporary


congestion.

v OSI-SU-SEE-DDTP 28 The rejection was due to a reason provided in the


text.

continued

3787 3296-200 3-177


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

OSI-APPL-PRES-RESULT-TYPE The severity of the reason for the rejection of the


conversation. DDP-PPC does not return this parameter if
the connection is accepted.
$ 1 OSI-PERMANENT
The error is permanent and the connection should
not be retried.
$ 2 OSI-TRANSIENT - The error is temporary and the
connection may be successful if retried.

OSI-PRES-CONTEXT-TABLE-ENTRIES The number of OSI-PRES-CONTEXT-TABLE entries


DDP-PPC returned.

OSI-PRES-CONTEXT-TABLE
v OSI-PRES-CONTEXT-IDENT The presentation context for this abstract and transfer
syntax combination. This value is the same as the one
supplied on the open request.

v OSI-ABSTRACT-SYNTAX-ALIAS The user-defined name for an ABSTRACT SYNTAX record


in the Configuration Services database. DDP-PPC obtains
the name by matching the Abstract Syntax Id value for an
ABSTRACT SYNTAX record in the Configuration Services
database with the abstract syntax identifier received on
the open request.

v OSI-TRANSFER-SYNTAX-ALIAS The user-defined name for a TRANSFER SYNTAX record


in the Configuration Services database. DDP-PPC obtains
this name by matching the Transfer Syntax Id value for a
TRANSFER SYNTAX record in the Configuration Services
database with the transfer syntax identifier received on
the open request.

v OSI-CONTEXT-INDICATOR Indicates whether the program that received the open


request accepted the abstract and transfer syntax
combination (presentation context). Any unaccepted
presentation contexts cannot be used to encode data
during the connection.

continued

3-178 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-43. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

OSI-APPL-CONTEXT-TABLE (cont.)

v OSI-PU-CONTEXT-ACCEPTED u
0 The remote host accepted the presentation context
and it can be used during the connection as a way to
encode data.

v OSI-PU-CONTEXT-REJECTED 1 The peer program rejected the context, which


probably means the program does not support the
abstract syntax.

v OSI-PP-REJ-NO-REASON 2 The remote presentation service provider rejected the


context for no reason.

v OSI-PP-REJ-AS-UNSUPPORTED 3 The remote presentation service provider rejected the


context because it does not support the abstract syntax
and thus cannot decode the data.

v OSI-PP-REJ-TS-UNSUPPORTED 4 The remote presentation service provider rejected the


context because it does not support the transfer syntax
and thus cannot decode the data, or it accepted a
different transfer syntax and cannot decode the data.

v OSI-PP-REJ-DCS-LIM-EXCEEDED 5 The remote presentation service provider cannot


support the number of presentation context entries
proposed.

3787 3296-200 3-179


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-ADDRESS-PKT (Receive Open Response Format)

Table 3-44. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format)

Parameter Description

Values Returned by DDP-PPC

OSI-RESPONDING-AE-TITLE-ALIAS DDP-PPC sets this field to spaces.


DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-AP-TITLE The Application Process Title of the peer program. Its


contents are either a directory name as defined by ISO
9594-2 or the contents octets of an ASN.1 object
identifier. It is encoded according to ASN.1 Basic
Encoding Rules.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-AE-QUAL The value of the Application Entity Qualifier for the peer
program. Its contents are a directory
RelativeDistinguishedName type as defined in ISO 9594-2
or the contents octets of an ASN.1 integer. It is encoded
according to ASN.1 Basic Encoding Rules.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-AE-TITLE-FORM Indicates the encoding of the OSI-RESPONDING-AP-TITLE


and OSI-RESPONDING-AE-QUAL parameters.
$ u
D The form of OSI-RESPONDING-AP-TITLE is a
directory name and the form of
OSI-RESPONDING-AE-QUAL is a directory relative
distinguished name.
$ u
O The form of OSI-RESPONDING-AP-TITLE is an
ASN.1 object identifier and the form of
OSI-RESPONDING-AE-QUAL is an ASN.1 integer.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-P-SELECTOR The value of the Presentation Selector (P-SEL) for the


peer program. This field is normally not set by OS 2200
applications.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-S-SELECTOR The value of the Session Selector (S-SEL) for the peer
program.

continued

3-180 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-44. OSI-ADDRESS-PKT Parameters for OSI$RECEIVE (Receive Open


Response Format) (cont.)

Parameter Description

OSI-RESPONDING-T-SELECTOR The value of the Transport Selector (T-SEL) for the peer
program.

OSI-RESPONDING-NSAP DDP-PPC does not use this field.

OSI-RESPONDING-HOST-NAME DDP-PPC does not use this field.

OSI-RESPONDING-AP-TITLE-LEN The length, in bytes, of the data returned in the


OSI-RESPONDING-AP-TITLE parameter. If it is 0, DDP-PPC
did not receive a value for the responding Application
Process Title on the open request.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-AE-QUAL-LEN The length, in bytes, of the data returned in the


OSI-RESPONDING-AE-QUAL parameter. If it is 0, DDP-PPC
did not receive a value for the Responding Application
Entity Qualifier on the open request.
DDP-PPC does not return this field if the session layer
entry is used.

OSI-RESPONDING-S-SELECTOR-LEN The length, in bytes, of the data in the


OSI-RESPONDING-S-SELECTOR parameter. If it is 0,
DDP-PPC did not receive a value for the Responding
Session Services Access Point on the open request.

OSI-RESPONDING-T-SELECTOR-LEN The length, in bytes, of the data in the


OSI-RESPONDING-T-SELECTOR parameter. If it is 0,
DDP-PPC did not receive a value for the Responding
Transport Selector on the open request.

OSI-RESPONDING-NSAP-LEN This parameter is 0.

OSI-RESPONDING-P-SELECTOR-LEN The length, in bytes, of the data returned in the


OSI-RESPONDING-P-SELECTOR parameter. If it is 0,
DDP-PPC did not receive a value for the Responding
Presentation Selector on the open request.
DDP-PPC does not return this field if the session layer
entry is used.

3787 3296-200 3-181


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-RCV-PKT (Receive Open Response Format)

Table 3-45. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Open Response


Format)

Parameter Description

Values Set by User

OSI-RCV-WAIT-TIME The number of seconds DDP-PPC should wait for an


incoming message before returning a no-message status.
A value of 0 indicates DDP-PPC should not wait.
A negative value indicates an infinite wait.

OSI-MODE Set to 0 (OSI-CONT-MODE) for an OSI$RECEIVE function


call to indicate that this is a receive existing connection.

Values Returned by DDP-PPC

OSI-MSG-TYPE The type of message received. A 4 (OSI-MSG-OPRESP)


indicates that an open response message was received.

OSI-TOTAL-MSG-LEN The length, in bytes, of the message received.

3-182 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.5. Receive Existing Format


The receive existing format is used to receive messages once the connection has been
established between the two applications.

The OSI$RECEIVE function for the receive existing format uses the packets and settings
shown in the following subsections.

OSI-STATUS-PKT (Receive Existing Format)


The description of the OSI-STATUS-PKT given at the beginning of this OSI$RECEIVE
section is the same for all three formats.

OSI-MSG-BUFFER Area (Receive Existing Format)


This is a storage area where DDP-PPC moves the data received on the OSI$RECEIVE
function. It is specified as a data structure in this application program.

If the session layer entry is being used, then the data DDP-PPC returns to the user program
consists of eight-bit bytes of information. The two communicating programs determine the
form of the data.

If the application layer entry is being used, the program must decode the data that
DDP-PPC moves into the OSI-MSG-BUFFER. How to decode it depends upon the transfer
and abstract syntax the peer program used to encode it.

Another consideration for decoding is the type of message received. If the message type
(OSI-MSG-TYPE) is one of the following:

Open request 0 (OSI-MSG-OPEN)


Normal release 2 (OSI-MSG-CLOSE)
Open response 4 (OSI-MSG-OPRESP)
Release response 6 (OSI-MSG-CLRESP)
Abort request 7 (OSI-MSG-ABORT)

then the data is part of an ACSE protocol data unit (pdu). In this case, this parameter maps
to the user-information parameter of an ACSE pdu in ISO 8650 Information Processing
Systems - Open Systems Interconnection - Protocol Specification for the Association
Control Service Element. It should be decoded according to ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the user-information parameter DDP-PPC
decodes and what part the user program must decode for data types 134, 135, 138, and 139:

3787 3296-200 3-183


Receiving a Message from a Peer Program (OSI$RECEIVE)

decoded by user-
DDP-PPC information [30] length

decoded by EXTERNAL EXTERNAL length


user
direct-reference OBJECT-IDENTIFIER length value

indirect-reference INTEGER length value

data-value-descriptor OBJECT-DESCRIPTOR length value EXTERNAL


.
decoding [0] or length value .
[1] or .
[2]

EXTERNAL length

OBJECT-IDENTIFIER length value

INTEGER length value

OBJECT-DESCRIPTOR length value EXTERNAL


.
[0] or length value .
[1] or .
[2]

Legend
[] Context-specific class tags
EXTERNAL
OBJECT-IDENTIFIER
Universal class tags
INTEGER
OBJECT-DESCRIPTOR

The remaining message types are mapped to either the SS-user data parameter of a session
layer service request or to the User-data parameter of a presentation layer pdu. In either
case, this parameter should be decoded according to the rules for decoding the
presentation layer User-data parameter specified in ISO 8823 Information Processing
Systems - Open Systems Interconnection - Connection-Oriented Presentation Protocol
Specification using ISO 8825 Basic Encoding Rules for Abstract Syntax Notation One
(ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC decodes and
what part the user program must decode for data types 134, 135, 138, and 139:

3-184 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

decoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .

Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3787 3296-200 3-185


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-DATA-PKT (Receive Existing Format)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)

Parameter Description

Values Set by User

OSI-CONNECTION The value returned by either an OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the first
byte of the buffer is to be used. DDP-PPC ignores this
parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer from the DDP-PPC


buffers to the message buffer area. The maximum is 13000
bytes. If you specify a size smaller than the actual message,
the extra data is truncated and lost.
If the program expects segmented data, always set this
parameter to 13000 to ensure the complete segment is
received.

OSI-TEXT-START The byte index into the message at which the transfer
between DDP-PPC buffers and the user program message
buffer begins. This value must be 0 or a multiple of 4.

OSI-DATA-RELEASE Must be set to 1 (OSI-REL) to indicate the message is to be


released after it is received.

Values Returned by DDP-PPC

OSI-DATA-TYPE Used on the application level entry only; indicates the way
the peer program encoded that data and whether the user
program must decode the data returned by DDP-PPC
according to ASN.1 Basic Encoding Rules. See the section
on the OSI-MSG-BUFFER area for more information.

v OSI-TRANSPARENT-TYPE 134 The remote application encoded the data in ASN.1


format and the user program must decode the EXTERNAL
type and the user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC on the peer host compressed the user data
before sending it. DDP-PPC on this host decompresses it
before giving it to the user program. The peer program
encoded the data in ASN.1 format and this program must
decode the EXTERNAL type and the user data.

continued

3-186 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-PAD-TRANSPARENT 138 DDP-PPC on the peer host reformatted the data from
nine to eight-bit bytes. DDP-PPC on this host reformats the
data before giving it to the user program. The peer program
encoded the data in ASN.1 format and this program must
decode the EXTERNAL type and the user data.
v OSI-COMP-PAD-TRANSP 139 DDP-PPC on the peer host compressed and
reformatted the data from nine to eight-bit bytes. DDP-PPC
decompresses and reformats the data before giving it to the
user program. The peer program encoded the data in ASN.1
format and this program must decode the EXTERNAL type
and the user data.

v OSI-OCTET-STRING 140 The peer program encoded the data received as an


octet string in ASN.1 format. DDP-PPC decodes the ASN.1
octet string and returns the contents octets to the user
program.

v OSI-COMP-OCTET-STRING 141 DDP-PPC on the peer host compressed the data and
encoded it as an ASN.1 octet string. DDP-PPC
decompresses and decodes the ASN.1 octet string and
return the contents octets to the user program.

OSI-UNIT-INDICATOR Indicates whether the data returned to the message buffer is


a complete message or a segment of a larger message.
$ 0 OSI-MSG-INCOMPL
The data returned to the message buffer is a segment
of a message. This parameter is set to 0 for each
subsequent receive until the last message segment, for
which it is set to 1 (OSI-MSG-COMPL).
$ 1 OSI-MSG-COMPL
Set to this value for all message types except normal
send (OSI-MSG-SEND) and typed data
(OSI-MSG-TPDATA).

continued

3787 3296-200 3-187


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-INPUT-MSGS-PENDING Indicates whether there is another input message queued for


the conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an OSI$RECEIVE
function.

OSI-DATA-TOKEN The disposition of the token.

CASE 1

If a resynchronization message (OSI-MSG-TYPE = 14,


OSI-MSG-RESYNC) with a resync subfunction
(OSI-RESYNC-FUNC) of restart (0, OSI-RESYNC-RESTART),
abandon (1, OSI-RESYNC-ABANDON), or set (2,
OSI-RESYNC-SET) is received, the following values indicate
the peer program’s proposed token position for this token:
$ 0 OSI-DATA-HOLD
The peer program has held the token.
$ 1 OSI-DATA-PASS
The peer program has passed the token.
$ 2 OSI-DATA-CHOICE
This program can choose the initial setting of this token.

continued

3-188 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-DATA-TOKEN (cont.) CASE 2

If a resynchronization message with a resync subfunction of


confirm (3, OSI-RESYNC-CONFIRM) is received, the following
values indicate the token position the peer program selected
for this token:
$ If a value of 0 (hold) is returned and a token choice was
given to the peer program on the open request, the
peer program has held the token. If no choice was
given, no change in possession occurs.
$ If a value of 1 (pass) is returned, the peer program
passed the token back to this program.

CASE 3

If a token indication message (OSI-MSG-TYPE = 11,


OSI-TOKENS-INDICATION) is received, the following values
can be returned:
$ 0 OSI-DATA-HOLD
No change in possession has occurred.
$ 1 OSI-DATA-PASS
The peer program has passed the token.
$ 3 OSI-DATA-REQUEST
The peer program is requesting that the token be
passed. This value is informational only and does not
require that the token be passed.

OSI-SYNC-MINOR-TOKEN The disposition of the token. See OSI-DATA-TOKEN for a


description of the values that can be returned.

OSI-ACT-MAJOR-TOKEN The disposition of the token. See OSI-DATA-TOKEN for a


description of the values that can be returned.

continued

3787 3296-200 3-189


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-SYNC-POINT-SERIAL-NUMBER The synchronization point serial number. It can have several


meanings, depending on the type of message received:

CASE 1

When a minor synchronization message is received


(OSI-MSG-TYPE = 8, OSI-MSG-SYNC), it has one of the
following meanings:
$ If the minor synchronize subfunction (OSI-SYNC-FUNC)
received was a request for an explicit confirmation of a
synchronization point (0,
OSI-SYNC-SET-CNFRM-EXPLICIT)
or
was a request for an optional confirmation of a
synchronization point (1,
OSI-SYNC-SET-CNFRM-OPTIONAL),
then DDP-PPC sets this parameter to the minor
synchronization point that is to be confirmed.
$ If the minor synchronize subfunction received was a
confirmation of a synchronization point (2,
OSI-SYNC-CONFIRM), DDP-PPC sets this parameter to
the synchronization serial number the peer program is
confirming.

continued

3-190 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-SYNC-POINT-SERIAL-NUMBER CASE 2
(cont.)

When an activity management message is received


(OSI-MSG-TYPE = 9, OSI-MSG-ACTMGT), if the activity
management subfunction (OSI-ACT-MGT-FUNC) received
was:
$ Activity resume (1, OSI-ACT-RES), DDP-PPC sets this
parameter to the synchronization serial number at
which the peer program wants to resume the activity.
$ Activity end (6, OSI-ACT-END), DDP-PPC sets this field
to the next synchronization serial number.
$ Activity start (0, OSI-ACT-START), DDP-PPC sets this
field to 1.
$ Activity end acknowledge (7, OSI-ACT-END-ACK),
DDP-PPC sets this field to the serial number that was
sent on the previous activity end subfunction.

CASE 3

When a resynchronization message is received


(OSI-MSG-TYPE = 14, OSI-MSG-RESYNC), if the
resynchronization subfunction (OSI-RESYNC-FUNC) received
was:
$ Restart (0, OSI-RESYNC-RESTART), abandon (1,
OSI-RESYNC-ABANDON), or set (2, OSI-RESYNC-SET),
DDP-PPC sets this field to the synchronization point
serial number to which resynchronization is being
requested.
$ Confirm (3, OSI-RESYNC-CONFIRM), DDP-PPC sets this
field to the first synchronization point serial number to
be used in the resynchronized flow.

continued

3787 3296-200 3-191


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-46. OSI-DATA-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-EXCEPTION-REASON This field is valid only if OSI-MSG-TYPE is 10 (OSI-MSG-XRPT),


indicating that an OSI-EXCEPTION-REPORT has been
received. This occurs when the peer program issues an
OSI$XRPT function.
DDP-PPC sets this field to one of the following values:

v OSI-XCP-NO-REASON 0 No specific reason stated.

v OSI-XCP-RCV-ABILITY-JEOP 1 User receiving ability jeopardized.

v OSI-XCP-SEQUENCE-ERR 3 User sequence error.

v OSI-XCP-LOCAL-USR-ERR 5 Local session services user error.

v OSI-XCP-UNRECOV-PROC-ERR 6 Unrecoverable procedural error.

v OSI-XCP-DEMAND-DATA-TOKEN 128 Demand data token.

3-192 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-APPL-PRES-PKT (Receive Existing Format)

This packet provides information about the presentation contexts the peer program used
to encode the data in the abort message.

The parameters in this packet are returned only if the application layer is used and an
abort message is received (OSI-MSG-TYPE = 7, OSI-MSG-ABORT).

Table 3-47. OSI-APPL-PRES-PKT Parameters for OSI$RECEIVE (Receive Existing


Format)

Parameter Description

Values Returned by DDP-PPC

OSI-PRES-CONTEXT-TABLE-ENTRIES The number of OSI-CONTEXT-TABLE entries in this table.

OSI-PRES-CONTEXT-TABLE

v OSI-PRES-CONTEXT-IDENT The presentation context that was successfully proposed


and/or negotiated during open processing and that
appears in the user data of the abort that was received.

v OSI-ABSTRACT-SYNTAX-ALIAS The user-defined name for an ABSTRACT SYNTAX record


in the Configuration Services database. DDP-PPC obtains
the name by matching the Abstract Syntax Id value for an
ABSTRACT SYNTAX record in the Configuration Services
database with the abstract syntax identifier received on
the abort message.

v OSI-TRANSFER-SYNTAX-ALIAS The user-defined name for a TRANSFER SYNTAX record


in the Configuration Services database. DDP-PPC obtains
this name by matching the Transfer Syntax Id value for a
TRANSFER SYNTAX record in the Configuration Services
database with the transfer syntax identifier received on
the abort message.

3787 3296-200 3-193


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-RCV-PKT (Receive Existing Format)

Table 3-48. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Existing Format)

Parameter Description

Values Set by User

OSI-RCV-WAIT-TIME The number of seconds DDP-PPC should wait for an


incoming message before returning a no-message status.
A value of 0 indicates DDP-PPC should not wait.
A negative value indicates an infinite wait.

OSI-MODE Set to 0 (OSI-CONT-MODE) to indicate this is a receive for


an existing connection.

Values Returned by DDP-PPC

OSI-MSG-TYPE The type of message received.

v OSI-MSG-OPEN 0 An open request was received. Receipt of this


message type requires that you send an OSI$OPRESP
function as a response. Data may be present with this
message type.

v OSI-MSG-SEND 1 A normal data message was received. This data may


be a complete message or a message segment.
If the OSI-UNIT-INDICATOR in the DATA packet is 0
(OSI-MSG-INCOMPL), indicating a segmented message,
you should continue to issue the OSI$RECEIVE function
until you receive the last segment (1, OSI-MSG-COMPL).
The receipt of a segmented message can only be
interrupted by issuing an OSI$ABORT function or
receiving an OSI-MSG-ABORT message type.

v OSI-MSG-CLOSE 2 A close request was received. Receipt of this


message requires that you send an OSI$CLRESP function
as a response. Data may be present with this message
type.

continued

3-194 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-48. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-MSG-TYPE (cont.)

v OSI-MSG-OPRESP 4 A response to an open request, which indicates


whether the peer program accepted or rejected the
request, was received. Data may be present with this
message type.

v OSI-MSG-TPDATA 5 A data message was received, regardless of normal


token restrictions. This data may be a complete
message or a message segment. If OSI-UNIT-INDICATOR
in OSI-DATA-PKT is 0 (OSI-MSG-INCOMPL), indicating a
segmented message, then you should continue to issue
the OSI$RECEIVE function until you receive the last
segment (1, OSI-MSG-COMPL).
The receipt of a segmented message can only be
interrupted by issuing an OSI$ABORT function or
receiving an OSI-MSG-ABORT message.

v OSI-MSG-CLRESP 6 A response to a close request, which indicates the


peer program accepted the close request, was received.
Data may be present with this message type.

v OSI-MSG-ABORT 7 An abort request was received. Data may be present


with this message type.

v OSI-MSG-SYNC 8 A minor synchronization request or confirmation was


received. Data may be present with this message type.

continued

3787 3296-200 3-195


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-48. OSI-RCV-PKT Parameters for OSI$RECEIVE (Receive Existing Format)


(cont.)

Parameter Description

OSI-MSG-TYPE (cont.)

v OSI-MSG-ACTMGT 9 An activity management request or acknowledgement


was received. You should send a response if the
subfunction is an activity interrupt, activity discard, or
activity end. Data may be present if the subfunction is an
activity start, activity resume, activity end, or activity end
acknowledge.

v OSI-MSG-XRPT 10 A user-issued exception report was received, which


indicates the peer program issued a non-fatal error. Data
may be present with this message type.

v OSI-TOKENS-INDICATION 11 The peer program is passing or requesting tokens.


Data may be present with this message type.

v OSI-NO-INDICATION 12 A message was received, which may alter an


internal parameter in DDP-PPC but does not change the
current state of the connection. Check the
OSI-SYNC-POINT-SERIAL-NUMBER in the DATA packet to
see if it was altered, then reissue the OSI$RECEIVE
function.

v OSI-MSG-CPRESP 13 A response to a capability data request was


received. Data may be present with this message type.

v OSI-MSG-RESYNC 14 A resynchronization request or confirmation was


received. This message type may also indicate a
repositioning of the tokens. Issue an OSI$RESYNC
function with an OSI-RESYNC-CONFIRM subfunction as a
response. Data may be present with this message.

v OSI-MSG-CP-DATA 15 A Capability Data message was received, which


indicates that data was transferred outside of activities
when an activity management functional unit
(OSI-ACT-MGT-FUNC) was selected. Issue an
OSI$CPRESP function as a response.

OSI-TOTAL-MSG-LEN The length, in bytes, of the message received.

3-196 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-SYNC-PKT (Receive Existing Format)

This packet indicates the type of minor synchronization subfunction received. DDP-PPC
returns the parameters in this packet only if a minor synchronization message was
received (OSI-MSG-TYPE = 8, OSI-MSG-SYNC).

Table 3-49. OSI-SYNC-PKT Parameters for OSI$RECEIVE (Receive Existing Format)

Parameter Description

Values Returned by DDP-PPC

OSI-SYNC-FUNC The minor synchronization subfunction received. It is set


to one of the following values:

v OSI-SYNC-SET-CNFRM-EXPLICIT 0 A minor synchronization point was received and the


peer program requested confirmation.
When DDP-PPC receives this type of subfunction, it does
not force the program to send a minor synchronization
point confirmation.

v OSI-SYNC-SET-CNFRM-OPTIONAL 1 A minor synchronization point was received and the


peer program did not request confirmation.

v OSI-SYNC-CONFIRM 2 The peer program has confirmed a minor


synchronization point.

OSI-SYNC-DATA-SEP The data separation function received. It is set to one of


the following values:
$ 0uData separation is not requested.
$ 1uData separation is requested.

3787 3296-200 3-197


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-ACTIVITY-PKT (Receive Existing Format)

This packet provides information about the activity management message received.
DDP-PPC returns the parameters in this packet only if an activity management message
was received (OSI-MSG-TYPE = 9, OSI-MSG-ACTMGT).

Table 3-50. OSI-ACTIVITY-PKT Parameters for OSI$RECEIVE (Receive Existing


Format)

Parameter Description

Values Returned by DDP-PPC

OSI-ACT-MGT-FUNC This parameter is set to one of the following values:

v OSI-ACT-START 0 Activity start

v OSI-ACT-RES 1 Activity resume

v OSI-ACT-INT 2 Activity interrupt

v OSI-ACT-INT-ACK 3 Activity interrupt acknowledge

vOSI-ACT-DISC 4 Activity discard

v OSI-ACT-DISC-ACK 5 Activity discard acknowledge

v OSI-ACT-END 6 Activity end

v OSI-ACT-END-ACK 7 Activity end acknowledge

OSI-ACT-REASON Returned only on activity interrupt and activity discard


subfunctions. It is set to one of the following values:

v OSI-ACT-NO-REASON 0 No specific reason stated.

v OSI-ACT-RCV-ABILITY-JEOP 1 User receiving ability jeopardized.

v OSI-ACT-SEQUENCE-ERR 3 User sequence error.

v OSI-ACT-LOCAL-USR-ERR 5 Local ss-user error.

v OSI-ACT-UNRECOV-PROC-ERR 6 Unrecoverable procedure error.

v OSI-ACT-DEMAND-DATA-TOKEN 128 Demand data token.

continued

3-198 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-50. OSI-ACTIVITY-PKT Parameters for OSI$RECEIVE (Receive Existing


Format) (cont.)

Parameter Description

OSI-ACT-ID-LEN The number of bytes in the OSI-ACT-ID parameter. It is


returned only if OSI-ACT-MGT-FUNC is set to start (0,
OSI-ACT-START) or resume (1, OSI-ACT-RES).

OSI-ACT-ID The activity id to be used for a new activity being started


or a new id for an activity being resumed. It is returned
only if OSI-ACT-MGT-FUNC is set to start (0,
OSI-ACT-START) or resume (1, OSI-ACT-RES).

OSI-OLD-ACT-ID-LEN The number of bytes in the OSI-OLD-ACT-ID parameter. It


is returned only if OSI-ACT-MGT-FUNC is set to resume (1,
OSI-ACT-RES).

OSI-OLD-ACT-ID The id of the activity that was previously interrupted. It is


returned only if OSI-ACT-MGT-FUNC is set to resume (1,
OSI-ACT-RES).

OSI-OLD-SCI-CALLED-REF-LEN The length, in bytes, of data returned in the


OSI-OLD-SCI-CALLED-REF parameter. It can be in the
range 0 to 64. It is returned only if OSI-ACT-MGT-FUNC is
set to resume (1, OSI-ACT-RES).
If the length is 0, DDP-PPC did not return the
OSI-OLD-SCI-CALLED-REF parameter because the peer
program did not pass anything.

OSI-OLD-SCI-CALLING-REF-LEN The length, in bytes, of data returned in the


OSI-OLD-SCI-CALLING-REF parameter. It can be in the
range 0 to 64. It is returned only if OSI-ACT-MGT-FUNC is
set to resume (1, OSI-ACT-RES).
If the length is 0, DDP-PPC did not return the
OSI-OLD-SCI-CALLING-REF parameter because the peer
program did not pass anything.

OSI-OLD-SCI-COMMON-REF-LEN The length, in bytes, of data returned in the


OSI-OLD-SCI-COMMON-REF parameter. It can be in the
range 0 to 64. It is returned only if OSI-ACT-MGT-FUNC is
set to resume (1, OSI-ACT-RES).
If the length is 0, DDP-PPC did not return the
OLD-OSI-SCI-COMMON-REF parameter because the peer
program did not pass anything.

continued

3787 3296-200 3-199


Receiving a Message from a Peer Program (OSI$RECEIVE)

Table 3-50. OSI-ACTIVITY-PKT Parameters for OSI$RECEIVE (Receive Existing


Format) (cont.)

Parameter Description

OSI-OLD-SCI-ADD-REF-LEN The length, in bytes, of data returned in the


OSI-OLD-SCI-ADD-REF parameter. It can be in the range 0
to 64. It is returned only if OSI-ACT-MGT-FUNC is set to
resume (1, OSI-ACT-RES).
If it is 0, DDP-PPC did not return the
OLD-OSI-SCI-ADD-REF parameter because the peer
program did not pass anything.

OSI-OLD-SCI-SESSION-CONNECTION-ID Four user-defined parameters that identify the


sessionconnection id in which the resumed activity was
originally started. DDP-PPC does not validate these
values. It returns these parameters only if
OSI-ACT-MGT-FUNC is set to resume (1, OSI-ACT-RES).
If a length field is 0, DDP-PPC does not return its
corresponding parameter because the peer program did
not pass anything.
The parameters are:
OSI-OLD-SCI-CALLING-REF
OSI-OLD-SCI-CALLED-REF
OSI-OLD-SCI-COMMON-REF
OSI-OLD-SCI-ADD-REF

3-200 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

OSI-RESYNC-PKT (Receive Existing Format)

This packet indicates the type of resynchronization subfunction received. DDP-PPC


returns the parameters in this packet only if a resynchronization message was received
(OSI-MSG-TYPE = 14, OSI-MSG-RESYNC).

Table 3-51. OSI-RESYNC-PKT Parameters for OSI$RECEIVE (Receive Existing


Format)

Parameter Description

Values Returned by DDP-PPC

OSI-RESYNC-FUNC The resynchronization subfunction received. It can be


one of the following values:

v OSI-RESYNC-RESTART 0 A request was received to resynchronize the


connection to a past acknowledged or unacknowledged
synchronization point serial number.

v OSI-RESYNC-ABANDON 1 A request was received to resynchronize a connection


to a synchronization point serial number greater than any
previous value used on this connection.

v OSI-RESYNC-SET 2 A request was received to resynchronize the


connection to any valid synchronization point serial
number.

v OSI-RESYNC-CONFIRM 3 A resynchronization confirmation message was


received from the peer program.

3787 3296-200 3-201


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.6. OSI$RECEIVE (Receive New Format) Example


This example illustrates using the OSI$RECEIVE function call (receive new format) to
enter a new conversation mode (OSI-MODE = OSI-NEW-CONV) to accept open requests
from other hosts.

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

3. Set input text length. MOVE OSI-MSG-BUFFER-LEN TO OSI-TEXT-LENGTH.

4. Set text start area. MOVE 0 TO OSI-TEXT-START.

5. Set to release data. MOVE 1 TO OSI-DATA-RELEASE.

Set Connect Packet parameters.

6. Set the service entry to application level MOVE 7 TO OSI-SERVICE-ENTRY.

Set Receive Packet parameters.

7. Set wait time. MOVE 120 TO OSI-RCV-WAIT-TIME.

8. Set mode to new. MOVE 1 TO OSI-MODE.

Call DDP-PPC

9. Issue the function. COPY OSI-RECEIVE.

3-202 3787 3296-200


Receiving a Message from a Peer Program (OSI$RECEIVE)

3.14.7. OSI$RECEIVE (Receive Open Response and Receive


Existing Formats) Example
This example illustrates using the OSI$RECEIVE function call to enter existing or
continuous conversation mode (OSI-MODE = OSI-CONT-MODE) to accept open response
or existing conversation messages.

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

4. Set input text length. MOVE OSI-MSG-BUFFER-LEN TO OSI-TEXT-LENGTH.

5. Set text start area. MOVE 0 TO OSI-TEXT-START.

6. Set to release data. MOVE 1 TO OSI-DATA-RELEASE.

Set Receive Packet parameters.

7. Set wait time. MOVE 120 TO OSI-RCV-WAIT-TIME.

8. Set mode. MOVE 0 TO OSI-MODE.

Call DDP-PPC.

9. Issue the function. COPY OSI-RECEIVE.

3787 3296-200 3-203


Resynchronizing a Connection (OSI$RESYNC)

3.15. Resynchronizing a Connection (OSI$RESYNC)


Use the OSI$RESYNC function to resynchronize a connection to a new synchronization
point and/or to reposition the tokens to an agreed side.

3.15.1. OSI$RESYNC Format


COPY OSI-RESYNC.

or
CALL 'OSI$RESYNC' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-RESYNC-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$RESYNC request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a resynchronization request permits you to send a
message along with the resynchronization request. OSI-MSG-BUFFER is the default name.
You can specify your own name in the working-storage section for this area, but because
the USING clause contains positional parameters, the name you specify must be the
second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

The OSI-RESYNC-PKT references the resynchronization packet for information needed to


resynchronize a connection to a previous synchronization point (checkpoint) or to
reposition the tokens.

3-204 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

3.15.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$RESYNC function call uses the following
status packet parameters:

Table 3-52. OSI-STATUS-PKT Parameters for OSI$RESYNC

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-205


Resynchronizing a Connection (OSI$RESYNC)

3.15.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$RESYNC function call. It is
specified as a data structure in this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the User-data parameter of
the presentation protocol data units RS PPDU and RSA PPDU. It should be encoded
according to the rules specified in ISO 8823, Information Processing Systems - Open
Systems Interconnection - Connection-Oriented Presentation Protocol Specification, for
encoding the presentation layer User-data parameter using ISO 8825 Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-206 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

3.15.4. OSI-DATA-PKT

Table 3-53. OSI-DATA-PKT Parameters for OSI$RESYNC

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot


perform compression, it treats the data type as a 134
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3787 3296-200 3-207


Resynchronizing a Connection (OSI$RESYNC)

Table 3-53. OSI-DATA-PKT Parameters for OSI$RESYNC (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit


bytes, and also compresses the data. If it cannot
perform compression, it treats the data type as a 138
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected


session version 1, there is a limit of 512 bytes of session
data enforced by OSI session protocol. If you selected
session version 2, there is a limit of 10240 bytes of
session data enforced by OSI session protocol. In either
case, all user data and additional protocol header
information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no


message segmentation.

continued

3-208 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

Table 3-53. OSI-DATA-PKT Parameters for OSI$RESYNC (cont.)

Parameter Description

OSI-DATA-TOKEN If the resynchronization subfunction (OSI-RESYNC-FUNC)


is restart (0, OSI-RESYNC-RESTART), abandon (1,
OSI-RESYNC-ABANDON), or set (2, OSI-RESYNC-SET), this
parameter resets the token assignment.
$ 0 OSI-DATA-HOLD
This program keeps the token.
$ 1 OSI-DATA-PASS
This program returns the token to the peer program.
$ 2 OSI-DATA-CHOICE
The peer program can either hold or pass the token.
If the resynchronization subfunction is confirm (3,
OSI-RESYNC-CONFIRM), this parameter is used only if you
set it to 2 (OSI-DATA-CHOICE) when you received the
resynchronization message being confirmed.

OSI-SYNC-MINOR-TOKEN The token’s disposition. See OSI-DATA-TOKEN for the


description.

OSI-ACT-MAJOR-TOKEN The token’s disposition. See OSI-DATA-TOKEN for the


description.

continued

3787 3296-200 3-209


Resynchronizing a Connection (OSI$RESYNC)

Table 3-53. OSI-DATA-PKT Parameters for OSI$RESYNC (cont.)

Parameter Description

OSI-SYNC-POINT-SERIAL-NUMBER A resynchronization point for the connection.


If the resynchronization subfunction (OSI-RESYNC-FUNC)
is:
$ Restart (0, OSI-RESYNC-RESTART), set this
parameter to a value that is:
v greater than or equal to the lowest serial
number to which a resynchronization restart is
permitted, and
v less than or equal to the next serial number to
be used.
If an activity ended previously, resynchronization
restart is only permitted at a point after that activity
ended.
$ Abandon (1, OSI-RESYNC-ABANDON), this parameter
is not used. DDP-PPC sets a new synchronization
point serial number greater than any previous value
used on this connection.
$ Set (2, OSI-RESYNC-SET), set this parameter to a
value in the range 0 to 999999.
$ Confirm (3, OSI-RESYNC-CONFIRM), set this
parameter as follows:
v If the last resynchronization message received
was for a restart or abandon subfunction, set to
the OSI-SYNC-POINT-SERIAL-NUMBER DDP-PPC
returned for that OSI$RECEIVE function.
v If the last resynchronization message was for a
set subfunction, set to any valid value in the
range 0 to 999999.

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


the conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
This parameter can be used for programs executing in
full duplex to determine when an OSI$RECEIVE function
should be issued.

3-210 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

3.15.5. OSI-RESYNC-PKT

Table 3-54. OSI-RESYNC-PKT Parameters for OSI$RESYNC

Parameter Description

Values Set by User

OSI-RESYNC-FUNC The resynchronization subfunction to be performed for


this resynchronization function:

v OSI-RESYNC-RESTART 0 Resynchronizes the connection to a past


acknowledged or unacknowledged synchronization point
serial number.
This subfunction can be set only if the following
conditions are true:
$ The activity management functional unit was
selected (FUNC-UNIT-ACT-MGT = 1) and an activity is
in progress
or
the activity management functional unit was not
selected.
$ The minor synchronize (FUNC-UNIT-MINOR-SYNC)
and resynchronize (FUNC-UNIT-RESYNC) functional
units were selected.

continued

3787 3296-200 3-211


Resynchronizing a Connection (OSI$RESYNC)

Table 3-54. OSI-RESYNC-PKT Parameters for OSI$RESYNC (cont.)

Parameter Description

OSI-RESYNC-FUNC (cont.)

v OSI-RESYNC-ABANDON 1 Resynchronizes the connection to a synchronization


point serial number greater than any previous value used
for this connection.
This subfunction can be used only if the following
conditions are true:
$ The activity management functional unit was
selected (FUNC-UNIT-ACT-MGT = 1) and there is an
activity in progress
or
the activity management functional unit was not
selected.
$ The resynchronize functional unit
(FUNC-UNIT-RESYNC) was selected.
v OSI-RESYNC-SET 2 Resynchronizes the connection to any valid
synchronization point serial number.
This subfunction can be used only if the following
conditions are true:
$ The activity management functional unit
(FUNC-UNIT-ACT-MGT) was selected and an activity
is in progress
or
the activity management functional unit was not
selected.
$ The minor synchronize (FUNC-UNIT-MINOR-SYNC)
and resynchronize (FUNC-UNIT-RESYNC) functional
units were selected.

continued

3-212 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

Table 3-54. OSI-RESYNC-PKT Parameters for OSI$RESYNC (cont.)

Parameter Description

OSI-RESYNC-FUNC (cont.)

v OSI-RESYNC-CONFIRM 3 Confirms resynchronization.


This subfunction can be set only if the following
conditions are true:
$ The program received a resynchronize message
(OSI-MSG-TYPE = 14, OSI-MSG-RESYNC) with a
resynchronization subfunction (OSI-RESYNC-FUNC)
of restart (0, OSI-RESYNC-RESTART), abandon (1,
OSI-RESYNC-ABANDON), or set (2,
OSI-RESYNC-SET).
$ The minor synchronize (FUNC-UNIT-MINOR-SYNC)
and resynchronize (FUNC-UNIT-RESYNC) functional
units were selected.

3787 3296-200 3-213


Resynchronizing a Connection (OSI$RESYNC)

3.15.6. OSI$RESYNC Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set the output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to CHOICE. MOVE 2 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

8. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-NUMBER.

Set Resync Packet parameters.

9. Set subfunction. MOVE 0 TO OSI-RESYNC-FUNC.

Call DDP-PPC.

10. Issue the function. COPY OSI-RESYNC.

3-214 3787 3296-200


Resynchronizing a Connection (OSI$RESYNC)

3.15.7. OSI$RESYNC Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set the output text length. MOVE RESYNC-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to CHOICE. MOVE 2 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

10. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-NUMBER.

Set Resync Packet parameters.

11. Set subfunction. MOVE 0 TO OSI-RESYNC-FUNC.

Set message output buffer area.

12. Put the message in the output buffer. MOVE RESYNC-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

13. Issue the function. COPY OSI-RESYNC.

3787 3296-200 3-215


Sending Normal Data (OSI$SEND)

3.16. Sending Normal Data (OSI$SEND)


Use the OSI$SEND function to send normal user data. To issue this function, the program
must possess the data token (OSI-DATA-TOKEN) or the full duplex functional unit
(FUNC-UNIT-DUPLEX) must have been selected at connection establishment.

3.16.1. OSI$SEND Format


COPY OSI-SEND.

or
CALL 'OSI$SEND' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$SEND request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. OSI-MSG-BUFFER is the default name. You can specify your own name in the
working-storage section for this area, but because the USING clause contains positional
parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-216 3787 3296-200


Sending Normal Data (OSI$SEND)

3.16.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$SEND function call uses the following
status packet parameters:

Table 3-55. OSI-STATUS-PKT Parameters for OSI$SEND

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-217


Sending Normal Data (OSI$SEND)

3.16.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$SEND function call. It is
specified as a data structure in this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the User-data parameter of
the presentation protocol data unit TD PPDU. It should be encoded according to the rules
specified in ISO 8823, Information Processing Systems - Open Systems Interconnection -
Connection-Oriented Presentation Protocol Specification, for encoding the presentation
layer User-data parameter using ISO 8825 Basic Encoding Rules for Abstract Syntax
Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-218 3787 3296-200


Sending Normal Data (OSI$SEND)

3.16.4. OSI-DATA-PKT

Table 3-56. OSI-DATA-PKT Parameters for OSI$SEND

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.
Note: If segmented messages are sent, the data type
must be the same for all segments.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot


perform compression, it treats the data type as a 134
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3787 3296-200 3-219


Sending Normal Data (OSI$SEND)

Table 3-56. OSI-DATA-PKT Parameters for OSI$SEND (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit


bytes, and also compresses the data. If it cannot
perform compression, it treats the data type as a 138
type. The user must encode the presenation layer
User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data in the OSI-MSG-BUFFER area


that DDP-PPC is to send to the peer program. The value
can be in the range 0 to 13000. It can be set to 0 only if
this function is sending the last segment of a segmented
message and there is no more data to send. Then
DDP-PPC sends an end-of-message indication but does
not send any user data.

OSI-FLWCTL-WAIT The amount of time DDP-PPC should attempt to send a


message before returning control to the program.
Sometimes DDP-PPC cannot send a message because
flow control conditions in the network prevent it from
transferring any data for this connection. DDP-PPC
continues to attempt to send the message until the flow
control conditions no longer occur or the time specified
in this field elapses. If the time elapses, DDP-PPC returns
an output flow control timeout status indicating the
message was not sent.

continued

3-220 3787 3296-200


Sending Normal Data (OSI$SEND)

Table 3-56. OSI-DATA-PKT Parameters for OSI$SEND (cont.)

Parameter Description

OSI-UNIT-INDICATOR Set this field to one of the following values:


$ 0 (OSI-MSG-INCOMPL) when this is a segment of a
message and more data is to be sent for that
message on a subsequent OSI$SEND function.
$ 1 (OSI-MSG-COMPL) when this is a complete
message or final segment of a segmented message
(no more data is to be sent for the segmented
message on a subsequent OSI$SEND).
If you set this field to OSI-MSG-INCOMPL, you should
continue to issue the OSI$SEND function until the last
segment is sent (OSI-MSG-COMPL). Sending a
segmented data message can only be interrupted by
issuing an OSI$ABORT function or receiving an
OSI-MSG-ABORT message type

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


this conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
This parameter can be used for programs executing in
full duplex to determine when an OSI$RECEIVE function
should be issued.

3787 3296-200 3-221


Sending Normal Data (OSI$SEND)

3.16.5. OSI$SEND Example

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set the output text length. MOVE SEND-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set flow control wait time. MOVE 100 TO OSI-FLWCTL-WAIT.

7. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

8. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

9. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

10. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set message output buffer area.

11. Put the message in the output buffer. MOVE SEND-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

12. Issue the function. COPY OSI-SEND.

3-222 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

3.17. Setting Synchronization Points (OSI$SYNC)


Use the synchronize function to separate the flow of data units during a connection. The
function uses synchronization points (checkpoints) to structure the exchange of data
within a dialog unit. Each synchronization point may or may not be confirmed explicitly.
Data may be passed with this function.

3.17.1. OSI$SYNC Format


COPY OSI-SYNC.

or
CALL 'OSI$SYNC' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT OSI-SYNC-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$SYNC request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a synchronization request permits you to send a
message along with the synchronization request. OSI-MSG-BUFFER is the default name.
You can specify your own name in the working-storage section for this area, but because
the USING clause contains positional parameters, the name you specify must be the
second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

The OSI-SYNC-PKT references the synchronization packet for information to set


synchronization points.

3787 3296-200 3-223


Setting Synchronization Points (OSI$SYNC)

3.17.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$SYNC function call uses the following status
packet parameters:

Table 3-57. OSI-STATUS-PKT Parameters for OSI$SYNC

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3-224 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

3.17.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$SYNC function call. It is
specified as a data structure in this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer minor synchronize service requests. It should be encoded according to
the rules specified in ISO 8823 Information Processing Systems - Open Systems
Interconnection - Connection-Oriented Presentation Protocol Specification for encoding
the presentation layer User-data parameter using ISO 8825 Basic Encoding Rules for
Abstract Syntax Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3787 3296-200 3-225


Setting Synchronization Points (OSI$SYNC)

3.17.4. OSI-DATA-PKT

Table 3-58. OSI-DATA-PKT Parameters for OSI$SYNC

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot


perform compression, it treats the data type as a 134
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3-226 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

Table 3-58. OSI-DATA-PKT Parameters for OSI$SYNC (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit


bytes, and also compresses the data. If it cannot
perform compression, it treats the data type as a 138
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected


session version 1, there is a limit of 512 bytes of session
data enforced by OSI session protocol. If you selected
session version 2, there is a limit of 10240 bytes of
session data enforced by OSI session protocol. In either
case, all user data and additional protocol header
information generated by DDP-PPC cannot exceed the
respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no


message segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

continued

3787 3296-200 3-227


Setting Synchronization Points (OSI$SYNC)

Table 3-58. OSI-DATA-PKT Parameters for OSI$SYNC (cont.)

Parameter Description

OSI-SYNC-POINT-SERIAL-NUMBER A synchronization point for the connection. This


parameter should be set only if the synchronization
subfunction (OSI-SYNC-FUNC) is confirm (2,
OSI-SYNC-CONFIRM); it must be set to a previously
received synchronization point serial number greater
than the previously confirmed synchronization point serial
number.

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


this conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
This parameter can be used for programs executing in
full duplex to determine when an OSI$RECEIVE function
should be issued.

OSI-SYNC-POINT-SERIAL-NUMBER The new synchronization serial number. DDP-PPC returns


this parameter if the synchronization subfunction
(OSI-SYNC-FUNC) is a set explicit (0,
OSI-SYNC-SET-CNFRM-EXPLICIT) or set optional (1,
OSI-SYNC-SET-CNFRM-OPTIONAL).

3-228 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

3.17.5. OSI-SYNC-PKT

Table 3-59. OSI-SYNC-PKT Parameters for OSI$SYNC

Parameter Description

Values Set by User

OSI-SYNC-FUNC The synchronization subfunction to be performed for this


synchronization function. It can be one of the following
values:

v OSI-SYNC-SET-CNFRM-EXPLICIT (set 0 Sets a minor synchronization point and explicitly


explicit) requests peer program confirmation.
This subfunction can be used only if the following
conditions are true:
$ The activity management functional unit was
selected (FUNC-UNIT-ACT-MGT) and an activity is in
progress
or
the activity management functional unit was not
selected.
$ The minor synchronize functional unit
(FUNC-UNIT-MINOR-SYNC) was selected.
$ The full duplex functional unit (FUNC-UNIT-DUPLEX)
was selected
or
the half-duplex functional unit
(FUNC-UNIT-HALF-DUPLEX) was selected and the
program possesses the data token.
$ The program possesses the sync minor token.

continued

3787 3296-200 3-229


Setting Synchronization Points (OSI$SYNC)

Table 3-59. OSI-SYNC-PKT Parameters for OSI$SYNC (cont.)

Parameter Description

OSI-SYNC-FUNC (cont.)

v OSI-SYNC-SET-CNFRM-OPTIONAL (set 1 Sets a minor synchronization point and does not


optional) explicitly request the peer program to confirm it.
This subfunction can be used only if the following
conditions are true:
$ The activity management functional unit was
selected (FUNC-UNIT-ACT-MGT) and an activity is in
progress
or
the activity management functional unit was not
selected.
$ The minor synchronize functional unit
(FUNC-UNIT-MINOR-SYNC) was selected.
$ The full duplex functional unit (FUNC-UNIT-DUPLEX)
was selected
or
the half-duplex functional unit
(FUNC-UNIT-HALF-DUPLEX) was selected and the
program possesses the data token.
$ The program possesses the sync minor token.

continued

3-230 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

Table 3-59. OSI-SYNC-PKT Parameters for OSI$SYNC (cont.)

Parameter Description

OSI-SYNC-FUNC (cont.)

v OSI-SYNC-CONFIRM 2 Confirms a synchronization point previously received


on an OSI$RECEIVE function.
This subfunction can be used only if the following
conditions are true:
$ The activity management functional unit
(FUNC-UNIT-ACT-MGT) was selected and an activity
is in progress
or
the activity management functional unit was not
selected.
$ The minor synchronize functional unit
(FUNC-UNIT-RESYNC) was selected.
$ The program received an OSI synchronize message
(OSI-MSG-TYPE = 8, OSI-MSG-SYNC) with a
synchronize subfunction (OSI-SYNC-FUNC) of set
explicit (0, OSI-SYNC-SET-CNFRM-EXPLICIT) or set
optional (1, OSI-SYNC-SET-CNFRM-OPTIONAL).

OSI-SYNC-DATA-SEP Indicates whether data separation is requested. The


following values are valid:
$ 0 uData separation is not requested.
Set this field to 0 if FUNC-UNIT-DATA-SEP was not
selected (OSI-FUNC-UNITS-SELECTED parameter,
CONNECT packet). Set this field to 0 is
OSI-SYNC-FUNC is set to 2 (OSI-SYNC-CONFIRM).
$ 1 uData separation is requested.

3787 3296-200 3-231


Setting Synchronization Points (OSI$SYNC)

3.17.6. OSI$SYNC Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set the output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-NUMBER.

Set Sync Packet parameters.

6. Set the subfunction. MOVE 2 TO OSI-SYNC-FUNC.

7. Set data separation to no. MOVE 0 TO OSI-SYNC-DATA-SEP.

Call DDP-PPC.

8. Issue the function. COPY OSI-SYNC.

3-232 3787 3296-200


Setting Synchronization Points (OSI$SYNC)

3.17.7. OSI$SYNC Example - Send with Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set the output text length. MOVE SYNC-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set sync point serial number. MOVE 123 TO OSI-SYNC-POINT-SERIAL-NUMBER.

Set Sync Packet parameters.

8. Set the subfunction. MOVE 2 TO OSI-SYNC-FUNC.

9. Set data separation to no. MOVE 0 TO OSI-SYNC-DATA-SEP.

Set message output buffer area.

10. Put the message in the output buffer. MOVE SYNC-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

11. Issue the function. COPY OSI-SYNC.

3787 3296-200 3-233


Sending Typed Data (OSI$TPDATA)

3.18. Sending Typed Data (OSI$TPDATA)


Use the OSI$TPDATA function to send typed data to the peer program. Use this function to
send data when you do not own the data token. If the half-duplex functional unit
(FUNC-UNIT-HALF-DUPLEX) was selected, either the sending or receiving program can
issue this function because it does not require possession of the data token.

3.18.1. OSI$TPDATA Format


COPY OSI-TPDATA.

or
CALL 'OSI$TPDATA' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$TPDATA request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. OSI-MSG-BUFFER is the default name. You can specify your own name in the
working-storage section for this area, but because the USING clause contains positional
parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3-234 3787 3296-200


Sending Typed Data (OSI$TPDATA)

3.18.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$TPDATA function call uses the following
status packet parameters:

Table 3-60. OSI-STATUS-PKT Parameters for OSI$TPDATA

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3787 3296-200 3-235


Sending Typed Data (OSI$TPDATA)

3.18.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$TPDATA function call. It is
specified as a data structure in this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the User-data parameter of
the presentation protocol data unit TTD PPDU. It should be encoded according to the rules
specified in ISO 8823, Information Processing Systems - Open Systems Interconnection -
Connection-Oriented Presentation Protocol Specification, for encoding the presentation
layer User-data parameter using ISO 8825 Basic Encoding Rules for Abstract Syntax
Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3-236 3787 3296-200


Sending Typed Data (OSI$TPDATA)

3.18.4. OSI-DATA-PKT

Table 3-61. OSI-DATA-PKT Parameters for OSI$TPDATA

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE


(receive new format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates


whether DDP-PPC should encode, compress, or pad the
entire user data buffer. If you do not want encoding,
compression, or padding, set this parameter to 134
(OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other
value requires the use of DDP-PPC proprietary abstract
and transfer syntaxes that those hosts will probably not
recognize. See 3.11 for additional information on
application presentation packet context table syntaxes.
If you want any messages sent during this conversation
to be encoded, padded, or compressed, then the
DDP-PPC abstract and transfer syntaxes for these values
must be selected during connection establishment. See
the OSI-APPL-PRES-PKT (3.11) for details about syntax
selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open
response.
Note: If segmented messages are sent, the data type
must be the same for all segments.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The
user must encode the presentation layer User-data type
as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot


perform compression, it treats the data type as a 134
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit


bytes. This is called padding the data and is necessary to
send nine-bit bytes over communication networks that
only support eight-bit bytes. The user must encode the
presentation layer User-data type as part of user data.

continued

3787 3296-200 3-237


Sending Typed Data (OSI$TPDATA)

Table 3-61. OSI-DATA-PKT Parameters for OSI$TPDATA (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit


bytes, and also compresses the data. If it cannot
perform compression, it treats the data type as a 138
type. The user must encode the presentation layer
User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules. This data type does
not require any additional protocol to be encoded as part
of user data.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string


using ASN.1 Basic Encoding Rules, and also compresses
the data. If it cannot perform compression, it treats the
data type as a 140 type. This data type does not require
any additional protocol to be encoded as part of user
data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this
parameter to a multiple of 4. A value of 0 indicates the
first byte of the buffer is to be used. DDP-PPC ignores
this parameter if the OSI-TEXT-LENGTH parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data in the OSI-MSG-BUFFER area


that DDP-PPC is to send to the peer program. The value
can be in the range 0 to 13000.
It can be set to 0 only if this function is sending the last
segment of a segmented message and this program has
no data to send. DDP-PPC then sends an end-of-message
indicator but does not send any user data.

OSI-FLWCTL-WAIT The amount of time DDP-PPC should attempt to send


messages before returning control to this program.
Sometimes DDP-PPC cannot send a message because
flow control conditions in the network prevent it from
transferring any data for this connection. It continues to
attempt to send this message until the flow control
conditions no longer occur or the time specified in this
field elapses. If the time elapses, DDP-PPC returns an
output flow control timeout status indicating the message
was not sent.

continued

3-238 3787 3296-200


Sending Typed Data (OSI$TPDATA)

Table 3-61. OSI-DATA-PKT Parameters for OSI$TPDATA (cont.)

Parameter Description

OSI-UNIT-INDICATOR This can be one of the following values:


$ 0 (OSI-MSG-INCOMPL) when this is a message
segment and more data is to be sent for that
message on a subsequent OSI$TPDATA function.
$ 1 (OSI-MSG-COMPL) when this is a complete
message or the final segment of a segmented
message (no more data is to be sent for the
segmented message on a subsequent
OSI$TPDATA).
If this field is set to OSI-MSG-INCOMPL, you should
continue to issue the OSI$TPDATA function until the last
segment is sent (OSI-MSG-COMPL). The sending of a
segmented data message can only be interrupted by
issuing an OSI$ABORT function or receiving an
OSI-MSG-ABORT message type.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

Values Returned by DDP-PPC

OSI-INPUT-MSGS-PENDING Indicates whether there is an input message queued for


this conversation. The value can be:
$ 0 OSI-NO-MSGS-TO-RECEIVE
No message is queued.
$ 1 OSI-MSGS-TO-RECEIVE
A message can be received by issuing an
OSI$RECEIVE function.
This parameter can be used for programs executing in
full duplex to determine when an OSI$RECEIVE function
should be issued.

3787 3296-200 3-239


Sending Typed Data (OSI$TPDATA)

3.18.5. OSI$TPDATA Example

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set the output text length. MOVE TPDATA-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

Set message output buffer area.

10. Put the message in the output buffer. MOVE TPDATA-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

11. Issue the function call. COPY OSI-TPDATA.

3-240 3787 3296-200


Deregistering an Application Program from the DDP-PPC Network (OSI$UNBIND)

3.19. Deregistering an Application Program from


the DDP-PPC Network (OSI$UNBIND)
Use the OSI$UNBIND function as the final step in program-to-program communications in
an OSI environment. It deregisters the program from DDP-PPC, frees all DDP-PPC
resources associated with the program, and terminates any open connections.

3.19.1. OSI$UNBIND Format


COPY OSI-UNBIND.

or
CALL 'OSI$UNBIND' USING OSI-STATUS-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$UNBIND request, DDP-PPC returns the status codes for you to test.

3787 3296-200 3-241


Deregistering an Application Program from the DDP-PPC Network (OSI$UNBIND)

3.19.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$UNBIND function call uses the following
status packet parameters:

Table 3-62. OSI-STATUS-PKT Parameters for OSI$UNBIND

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3.19.3. OSI$UNBIND Example

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Call DDP-PPC.

2. Issue the function. COPY OSI-UNBIND.

3-242 3787 3296-200


Reporting Errors without Aborting (OSI$XRPT)

3.20. Reporting Errors without Aborting


(OSI$XRPT)
Use the OSI$XRPT function to report a non-fatal error to the peer program. This function
can only be called if:

$ The half-duplex (FUNC-UNIT-HALF-DUPLEX) and exceptions


(FUNC-UNIT-EXCEPTIONS) functional units are selected.
$ The activity management functional unit (FUNC-UNIT-ACT-MGT) was not selected or
it was selected and an activity is currently in progress.
$ The program does not possess the data token.
$ A close message (OSI-MSG-TYPE = 2, OSI-MSG-CLOSE) or an activity end message
(OSI-MSG-TYPE = 9, OSI-MSG-ACTMGT, and OSI-ACT-MGT-FUNC = 6, OSI-ACT-END)
was the latest message the program received or the program is in data transfer state.

3.20.1. OSI$XRPT Format


COPY OSI-XRPT.

or
CALL 'OSI$XRPT' USING OSI-STATUS-PKT OSI-MSG-BUFFER
OSI-DATA-PKT.

The OSI-STATUS-PKT parameter of the USING clause references the storage areas defined
in your working-storage section for the user-id and the status codes. On completion of this
OSI$XRPT request, DDP-PPC returns the status codes for you to test.

The OSI-MSG-BUFFER parameter references the storage area you specify for the output
message. Referencing this area on a report-errors permits you to send a message along with
the report-errors request. OSI-MSG-BUFFER is the default name. You can specify your own
name in the working-storage section for this area, but because the USING clause contains
positional parameters, the name you specify must be the second parameter in the clause.

The OSI-DATA-PKT parameter references the data packet statements for the connection-id
and all information concerning the data to be sent.

3787 3296-200 3-243


Reporting Errors without Aborting (OSI$XRPT)

3.20.2. OSI-STATUS-PKT
Appendix A shows the status packet. The OSI$XRPT function call uses the following status
packet parameters:

Table 3-63. OSI-STATUS-PKT Parameters for OSI$XRPT

Parameter Description

Values Set by User

OSI-VERSION The version of the DDP-PPC COPY packets and OSI


protocol you are using. This value must be 1538 for this
release. This value is set automatically if you use the
COPY verb format. If you use the function call format, you
must set this value using a standard COBOL statement.

OSI-USER-ID An identifier DDP-PPC provides on the OSI$BIND that


identifies this application program. This value must
remain unchanged as long as this application program is
signed on to DDP-PPC.

Values Returned by DDP-PPC

OSI-CLASS-CODE The error’s general classification code.

OSI-DETAIL-STATUS The error’s detailed status code.

OSI-SPECIFIC-ERROR Additional information about the error. If this value is 0,


no additional information is available.

Note: The DDP-PPC/DDP-FJT Messages Reference Manual describes the error codes.

3-244 3787 3296-200


Reporting Errors without Aborting (OSI$XRPT)

3.20.3. OSI-MSG-BUFFER Area


This is a storage area for user data to be sent with the OSI$XRPT function call. It is
specified as a data structure in this application program.

If the session layer entry is being used, then the user program determines how the user
data is encoded. DDP-PPC does not perform any additional encoding of the user data.

If the application layer entry is being used, this field maps to the SS-user data parameter of
the session layer U-Exception service request. It should be encoded according to the rules
specified in ISO 8823 Information Processing Systems - Open Systems Interconnection -
Connection-Oriented Presentation Protocol Specification for encoding the presentation
layer User-data parameter using ISO 8825 Basic Encoding Rules for Abstract Syntax
Notation One (ASN.1).

The following diagram shows what part of the User-data parameter DDP-PPC encodes and
what part the user program must encode for data types 134, 135, 138, and 139:

encoded by user-data [APPLICATION 1] length


user
PDV-list SEQUENCE length

Transfer-syntax-name OBJECT-IDENTIFIER length value

Presentation-context-identifier INTEGER length value


PDV-list
Presentation-data-values [0] or length value .
[1] or .
[2] .

SEQUENCE length

OBJECT-IDENTIFIER length value

INTEGER length value


PDV-list
[0] or length value .
[1] or .
[2] .
Legend
[ APPLICATION ] Application class tags
[] Context-specific class tags
SEQUENCE
OBJECT-IDENTIFIER Universal class tags
INTEGER

3787 3296-200 3-245


Reporting Errors without Aborting (OSI$XRPT)

3.20.4. OSI-DATA-PKT

Table 3-64. OSI-DATA-PKT Parameters for OSI$XRPT

Parameter Description

Values Set by User

OSI-CONNECTION The value returned on the OSI$OPEN or OSI$RECEIVE (receive new


format) function call.

OSI-DATA-TYPE Used on the application level entry only; indicates whether DDP-PPC
should encode, compress, or pad the entire user data buffer. If you
do not want encoding, compression, or padding, set this parameter to
134 (OSI-TRANSPARENT-TYPE). Also set to 134 or 140 for
connections to non-OS 2200 hosts because any other value requires
the use of DDP-PPC proprietary abstract and transfer syntaxes that
those hosts will probably not recognize. See 3.11 for additional
information on application presentation packet context table syntaxes.
If you want any messages sent during this conversation to be
encoded, padded, or compressed, then the DDP-PPC abstract and
transfer syntaxes for these values must be selected during
connection establishment. See the OSI-APPL-PRES-PKT (3.11) for
details about syntax selection. See the OSI-APPL-PRES-PKT (3.12) for
information about negotiating syntaxes on the open response.

v OSI-TRANSPARENT-TYPE 134 DDP-PPC does not reformat the user data. The user must
encode the presentation layer User-data type as part of user data.

v OSI-COMPRESSED-TRANSP 135 DDP-PPC compresses user data. If it cannot perform


compression, it treats the data type as a 134 type. The user must
encode the presentation layer User-data type as part of user data.

v OSI-PAD-TRANSPARENT 138 DDP-PPC reformats the data from nine to eight-bit bytes. This is
called padding the data and is necessary to send nine-bit bytes over
communication networks that only support eight-bit bytes. The user
must encode the presentation layer User-data type as part of user
data.

continued

3-246 3787 3296-200


Reporting Errors without Aborting (OSI$XRPT)

Table 3-64. OSI-DATA-PKT Parameters for OSI$XRPT (cont.)

Parameter Description

OSI-DATA-TYPE (cont.)

v OSI-COMP-PAD-TRANSP 139 DDP-PPC reformats the data from nine to eight-bit bytes, and
also compresses the data. If it cannot perform compression, it treats
the data type as a 138 type. The user must encode the presentation
layer User-data type as part of user data.

v OSI-OCTET-STRING 140 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules. This data type does not require any additional
protocol to be encoded as part of user data. However, this data type
can only be used with non-OS 2200 hosts if they support session
segmentation.

v OSI-COMP-OCTET-STRING 141 DDP-PPC encodes user data as an octet string using ASN.1
Basic Encoding Rules, and also compresses the data. If it cannot
perform compression, it treats the data type as a 140 type. This data
type does not require any additional protocol to be encoded as part of
user data.

OSI-BUFFER-OFFSET Where the data begins in the user data buffer. Set this parameter to a
multiple of 4. A value of 0 indicates the first byte of the buffer is to be
used. DDP-PPC ignores this parameter if the OSI-TEXT-LENGTH
parameter is 0.

OSI-TEXT-LENGTH The number of bytes of data to transfer. If you selected session


version 1, there is a limit of 512 bytes of session data enforced by
OSI session protocol. If you selected session version 2, there is a limit
of 10240 bytes of session data enforced by OSI session protocol. In
either case, all user data and additional protocol header information
generated by DDP-PPC cannot exceed the respective limit.
Always set the text length to 0 if not sending text.

OSI-UNIT-INDICATOR Must be set to 1 (OSI-MSG-COMPL) to indicate no message


segmentation.

OSI-DATA-TOKEN Must be set to 0 (OSI-DATA-HOLD).

OSI-SYNC-MINOR-TOKEN Must be set to 0 (OSI-SYNC-MINOR-HOLD).

OSI-ACT-MAJOR-TOKEN Must be set to 0 (OSI-ACT-MAJOR-HOLD).

continued

3787 3296-200 3-247


Reporting Errors without Aborting (OSI$XRPT)

Table 3-64. OSI-DATA-PKT Parameters for OSI$XRPT (cont.)

Parameter Description

OSI-EXCEPTION-REASON An integer that indicates what non-fatal error the program is reporting:
0 No specific reason reported
1 User receiving ability jeopardized
2 Reserved
3 User sequence error
4 Reserved
5 Local SS-user error
6 Unrecoverable procedural error
128 Demand data token

3-248 3787 3296-200


Reporting Errors without Aborting (OSI$XRPT)

3.20.5. OSI$XRPT Example - Send with No Message

Procedure Typical COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-SAVE TO OSI-CONNECTION.

3. Set the output text length. MOVE 0 TO OSI-TEXT-LENGTH.

4. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

5. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

6. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

7. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

8. Set exception reason. MOVE 0 TO OSI-EXCEPTION-RSN.

Call DDP-PPC.

9. Issue the function. COPY OSI-XRPT.

3787 3296-200 3-249


Reporting Errors without Aborting (OSI$XRPT)

3.20.6. OSI$XRPT Example - Send with Message

Procedure COBOL Procedure Division Statements

Set Status Packet parameters.

1. Set the user-id. MOVE USER-SAVE TO OSI-USER-ID.

Set Data Packet parameters.

2. Set the connection-id. MOVE CONNECTION-ID TO OSI-CONNECTION.

3. Set data type. MOVE 140 TO OSI-DATA-TYPE.

4. Set buffer offset. MOVE 0 TO OSI-BUFFER-OFFSET.

5. Set the output text length. MOVE XRPT-MSG-LENGTH TO OSI-TEXT-LENGTH.

6. Set the unit indicator. MOVE 1 TO OSI-UNIT-INDICATOR.

7. Set data token to HOLD. MOVE 0 TO OSI-DATA-TOKEN.

8. Set sync minor token to HOLD. MOVE 0 TO OSI-SYNC-MINOR-TOKEN.

9. Set act major token to HOLD. MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

10. Set exception reason. MOVE 0 TO OSI-EXCEPTION-RSN.

Set message output buffer area.

11. Put the message in the output buffer. MOVE XRPT-MSG TO OSI-MSG-BUFFER.

Call DDP-PPC.

12. Issue the function. COPY OSI-XRPT.

3-250 3787 3296-200


Section 4
Writing Application Programs

This section includes:

$ A sample program flow design that illustrates a basic conversation between two
programs in two separate hosts
$ A description of the automatic scheduling feature, which allows you to call runstream
elements to initiate the execution of paired programs or to start TIP applications

4.1. Sample Program Flow Design


The block diagram in Figure 4-1 illustrates a basic conversation between two programs in
two separate hosts. The circled numbers correspond to the description following the
figure.

This example shows OSI protocol and data flow. Appendix B contains the COBOL
language source statements for primary and secondary programs that follow this data
u
flow. There are two sets of programs one that uses the DDP-PPC application layer
interface and one that uses the session layer interface.

For illustration reasons, the examples show both the primary and secondary programs as
DDP-PPC programs. In actuality, either the primary or secondary program can be an
application program on any vendor’s equipment that conforms to the OSI standards.

3787 3296-200 4-1


Sample Program Flow Design

Node A Node B

Primary Program Secondary Program

1A BIND BIND 1B

RECEIVE
2A OPEN 2B
(NEW)

RECEIVE
3A OPRESP 3B
(OPEN RESPONSE)

SYNC
4A RECEIVE 4B
(CONFIRM REQED)

SYNC
5A RECEIVE 5B
(CONFIRM)

6A SEND RECEIVE 6B

7A SYNC 7B
RECEIVE
(CONFIRM REQED)

SYNC
8A RECEIVE 8B
(CONFIRM)

9A CLOSE RECEIVE 9B

RECEIVE
10A CLRESP 10B
(CLRESP)

11A UNBIND UNBIND 11B

Figure 4-1. Typical COBOL DDP-PPC Block Diagram

4-2 3787 3296-200


Sample Program Flow Design

In this example, we want to:

$ Register with DDP-PPC


$ Open a conversation with a peer program
$ Receive the open response
$ Set a minor synchronization point
$ Receive the sync point confirmation
$ Send data
$ Set a new minor synchronization sync point
$ Receive the sync point confirmation
$ Close the connection
$ Accept the response
$ Deregister from DDP-PPC

(1A)(1B) Both programs register with DDP-PPC on their respective hosts by issuing
OSI$BIND functions.

(2A) The primary program issues an OSI$OPEN function to establish the connection with
the secondary program.

(2B)(3B) The secondary program receives the open request by issuing an OSI$RECEIVE
function (receive new format), then accepts the connection by issuing an OSI$OPRESP
function.

(3A) The primary program issues an OSI$RECEIVE function (receive open response
format) to accept the open response.

(4A)(4B) The primary program sets a minor sync point by issuing an OSI$SYNC function
with a subfunction of OSI-SYNC-SET-CNFRM-EXPLICIT. The secondary program accepts
it by issuing an OSI$RECEIVE function (receive existing format).

(5B)(5A) The secondary program confirms the sync point by issuing an OSI$SYNC
function with a subfunction of OSI-SYNC-CONFIRM. The primary program accepts this by
issuing an OSI$RECEIVE function (receive existing format).

(6A)(6B) The primary program issues OSI$SEND functions sending data to the secondary
program, which accepts these by issuing the OSI$RECEIVE function (receive existing
format).

(7A)(7B) The primary program sets a new sync point serial number by issuing the
OSI$SYNC function with a subfunction of OSI-SYNC-SET-CNFRM-EXPLICIT. The
secondary program accepts this by issuing an OSI$RECEIVE function (receive existing
format).

3787 3296-200 4-3


Sample Program Flow Design

(8B)(8A) The secondary program confirms the sync point by issuing an OSI$SYNC
function with a subfunction of OSI-SYNC-CONFIRM. The primary program accepts this by
issuing an OSI$RECEIVE function (receive existing format).

(9A)(9B) The primary program issues an OSI$CLOSE function to release the connection.
The secondary program accepts this by issuing an OSI$RECEIVE function (receive
existing format).

(10B)(10A) The secondary program accepts the close request by responding with an
OSI$CLRESP function. The primary program receives the close confirmation by issuing an
OSI$RECEIVE function (receive existing format).

(11A)(11B) Each program issues an OSI$UNBIND function to deregister from DDP-PPC.

4-4 3787 3296-200


Automatic Scheduling

4.2. Automatic Scheduling


You can use the automatic scheduling feature to call runstream elements that initiate
execution of paired programs or that start TIP applications.

The paired programs do not have to be the same type. TIP transactions can start batch
runs. Demand or batch runs can start TIP transactions.

4.2.1. Automatic Scheduling of Batch Programs


To request automatic scheduling of a batch program:

1. Store an Executive Control Language (ECL) runstream that executes the program in
any program file or system data format (SDF) file on the host where DDP-PPC will
initiate the batch program after receiving an OSI$OPEN request.
2. Define a PROGRAM record with a TYPE = BATCH parameter in the Configuration
Services database on the same host as in Step 1. The PROGRAM record references
the runstream file that executes the program.
3. If the program that issues the OSI$OPEN function uses Configuration Services to
obtain the called addressing information, then the APPLICATION ENTITY record it
references through the OSI-CALLED-AE-TITLE-ALIAS parameter should contain an
S-SEL parameter that matches the name of the PROGRAM record on the remote host.
If the program that issues the OSI$OPEN function supplies its own called addressing
information, then the OSI-CALLED-S-SELECTOR parameter should match the name
of the PROGRAM record on the remote host.

To receive the OSI$OPEN request, the program executed by the ECL runstream must:

$ Bind with DDP-PPC by specifying, in the OSI-INT-AP-NAME field of


OSI-REGISTER-PKT, the program name defined in the PROGRAM record.
$ Issue an OSI$RECEIVE function call using the receive new format.

If a program is already registered with DDP-PPC using the same name that was specified in
the OSI-CALLED-S-SELECTOR parameter on an incoming request (see the parameter
description in 3.11 on the OSI$OPEN function (Table 3-27- ADDRESS packet parameters),
then:

$ A new peer program is started if the Configuration Services PROGRAM record with
the same name has its COPIES keyword set to MULTIPLE.
$ A new peer program is not started if the Configuration Services PROGRAM record with
the same name has its COPIES keyword set to SINGLE. In this case, the incoming open
request is queued to the program that is already running and registered with DDP-PPC.

Any error encountered while trying to start a runstream is returned to the program that
issued the OSI$OPEN request. The program receives the error when it issues the
OSI$RECEIVE function call to receive the open response message. In addition, errors are
written to the DDP-PPC log file on the destination host.

3787 3296-200 4-5


Automatic Scheduling

The example in Figure 4-2 shows:

$ The program statements to automatically schedule a batch program


$ The runstream that executes the program
$ The Configuration Services APPLICATION ENTITY record that provides addressing
information
$ The Configuration Services PROGRAM record that provides information to start the
runstream

The Configuration Services database containing the APPLICATION ENTITY record is on


the host that issues the OSI$OPEN function. The runstream file and the Configuration
Services database containing the PROGRAM record are on the host that receives the open
request.

4-6 3787 3296-200


Automatic Scheduling

Runstream (File.element LOCAL*RUN-STREAMS.RUNPROGB) on HOST 2

@RUN run-id,,proj-id
@XQT LOCAL*RUN-STREAMS.PROGBPROGRAM
@FIN

PROGRAM Record in Remote Host Configuration Services Database on HOST 2

ADD PROGRAM
NAME=PROGB
TYPE=BATCH
FILE=LOCAL*RUN-STREAMS.RUNPROGB
ACCOUNT-NUMBER=ABC123
COPIES=MULTIPLE;

APPLICATION ENTITY Records in Local Host Configuration Services Database on HOST 1

ADD APPLICATION-ENTITY
NAME=PUBS-PROGB
S-SEL=PROGB
T-SEL=xxxx
NSAP=xxxx
. .

COBOL Program Statements

Initiating Program Receiving Program


on Host 1 on Host 2
MOVE 'PROGA' TO OSI-INT-AP-NAME. MOVE 'PROGB' TO OSI-INT-AP-NAME.
COPY OSI-BIND. COPY OSI-BIND.
. .
. .
MOVE 'PUBS-PROGB' TO OSI-CALLED-AE- MOVE 1 TO OSI-MODE.
TITLE-ALIAS.
COPY OSI-OPEN. COPY OSI-RECEIVE.

Figure 4-2. Automatic Scheduling of a Batch Program

3787 3296-200 4-7


Automatic Scheduling

On the initiating side:

$ Register your program with DDP-PPC by placing the program name (PROGA) in the
OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing an OSI$BIND function call.
$ Specify the application entity alias name in the OSI-CALLED-AE-TITLE-ALIAS field.
This name is defined in an APPLICATION ENTITY record in the Configuration
Services database on the local host. The S-SEL keyword of this record (PROGB)
references a PROGRAM record in the Configuration Services database on the remote
host that identifies the runstream containing the execute statement for the program
you want to initiate.
$ Issue an OSI$OPEN function call.

When DDP-PPC receives the OSI$OPEN request, it starts the runstream file that initiates
the program (PROGBPROGRAM).

$ This program registers with DDP-PPC by setting the program name (PROGB) in the
OSI-INT-AP-NAME field of OSI-REGISTER-PKT.
$ It then issues an OSI$RECEIVE function call (receive new format) to receive the
incoming open request from DDP-PPC.

4.2.2. Automatic Scheduling of TIP Transactions


There are two methods to automatically schedule a TIP transaction; they are indicated by
the format of the Called Session Selector on the incoming open request.

Method 1: PROGRAM Record Format


The Called Session Selector has any valid format but the one in Method 2. In this case, it
must match the name of a PROGRAM record in the Configuration Services database with
its TYPE keyword set to TPX. DDP-PPC reads this record to obtain the message control
bank (MCB) application group number and the transaction code.

4-8 3787 3296-200


Automatic Scheduling

Method 2: TIP$ Called Session Selector Format


The Called Session Selector has a special format (see OSI-CALLED-S-SELECTOR
description for the OSI$OPEN function) that contains the MCB application group number
and the transaction code for the TIP application that is to be initiated. In this case,
DDP-PPC uses this information to start the transaction and does not need to access a
record in the Configuration Services database.

Note: For both methods, the MCB application group number must also be defined in
the MCB record in the Configuration Services database. See the DDP-PPC
Implementation and Administration Guide.
There must be an MCB keyword for each MCB application in which you want
to start TIP transactions. See the Transaction Processing Administration and
Operations Reference Manual for VALTAB setup information.
DDP-PPC does not schedule TIP transactions if TIP Session Control is
configured in the Exec on the host that receives the open request.

Unlike a batch program, a TIP transaction is started whenever an OSI$OPEN request is


received, regardless of whether or not a TIP transaction with the same name is already
registered with DDP-PPC.

Any errors encountered while trying to start a TIP transaction are sent back to the program
that issued the OSI$OPEN request. The program receives the error when it issues the
OSI$RECEIVE function call to receive the open response message. In addition, errors are
written to the DDP-PPC log file on the destination host.

Note: DDP-PPC starts the TIP transaction by executing a CMSTOR function, which
causes a zero-length message to be created in the MCB. Your TIP transaction
should execute a TRINIT function to remove the message from the MCB.

Method 1: Referencing a PROGRAM Record


DDP-PPC automatically initiates a TIP transaction when it receives an OSI$OPEN request
with an OSI-CALLED-SESSION-SELECTOR field that matches the PROGRAM record
defined as a TIP program.

The PROGRAM record provides the transaction code that starts the program. It also
references the MCB application under which the transaction was configured.

To receive the OSI$OPEN request, the TIP program must:

$ Register with DDP-PPC by specifying the program name (PROGBTIP) in the


OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing an OSI$BIND function.
$ Issue an OSI$RECEIVE function (receive new format) to receive the incoming open
request from DDP-PPC.

3787 3296-200 4-9


Automatic Scheduling

The example in Figure 4-3 shows:

$ The program statements required to automatically schedule a TIP transaction.


$ The Configuration Services APPLICATION ENTITY record that provides addressing
information. The Configuration Services database containing this record is on the host
that issues the OSI$OPEN function.
$ The Configuration Services PROGRAM record used to initiate the TIP transaction. The
Configuration Services database containing this record is on the host that receives the
open request.

PROGRAM Record in Remote Host Configuration Services Database on Host 2

ADD PROGRAM
NAME=PROGBTIP
TYPE=TPX
MCB=02
CODE=TPROGB;

APPLICATION ENTITY Record in Local Host Configuration Services Database on Host 1

ADD APPLICATION-ENTITY
NAME=PUBS-PROGBTIP
S-SEL=PROGBTIP
T-SEL=xxxx
NSAP=xxxx
. .
. .

COBOL Program Statements

Initiating Program Receiving Program

MOVE 'PROGA' TO OSI-INT-AP-NAME. MOVE 'PROGBTIP' TO OSI-INT-AP-NAME.


COPY OSI-BIND. COPY OSI-BIND.
. .
. .
MOVE 'PUBS-PROGBTIP' TO MOVE 1 TO OSI-MODE.
OSI-CALLED-AE-TITLE-ALIAS.

COPY OSI-OPEN. COPY OSI-RECEIVE.

Figure 4-3. Scheduling a TIP Program by Referencing an APPLICATION ENTITY


Record

4-10 3787 3296-200


Automatic Scheduling

On the initiating side:

$ Register your program with DDP-PPC by placing the program name (PROGA) in the
OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing an OSI$BIND function call.
$ Specify the application entity alias name in the OSI-CALLED-AE-TITLE-ALIAS field
(PUBS-PROGBTIP). This name is defined in an APPLICATION ENTITY record in the
Configuration Services database on the local host. The S-SEL keyword of this record
references a PROGRAM record in the Configuration Services database that contains
the transaction code (TPROGB) and MCB information to start the transaction.
$ Issue an OSI$OPEN function call.

When DDP-PPC receives the OSI$OPEN request:

$ It schedules the TIP transaction TPROGB.


$ The TIP program registers with DDP-PPC by setting the program name (PROGBTIP) in
the OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing an OSI$BIND function.

$ The TIP program issues an OSI$RECEIVE function (receive new format) to receive the
incoming open request from DDP-PPC.

Method 2: Defining the Transaction Using the TIP$ Called Session Selector
Format
DDP-PPC automatically starts a TIP transaction when it receives an OSI$OPEN request
with the OSI-CALLED-SELECTOR field in the following format:
TIP$aatttttt

where:

TIP$
Indicates the program is a TIP application program.

aa
Is the MCB application group number that matches the AUDIT field in the VALTAB of
the TIP transaction that is to be started.

If this number is 00, DDP-PPC does a VINDEX read function to look up the AUDIT
field value in the VALTAB.

3787 3296-200 4-11


Automatic Scheduling

tttttt
Matches a TIP transaction code (one to six alphanumeric characters) defined in
VALTAB for the program that is to be started.

To receive the OSI$OPEN request, the TIP transaction that is started must:

$ Bind with DDP-PPC by specifying in OSI-REGISTER-PKT:


v TIP$ in the OSI-REG-TIP-IND field
v The application group number in the OSI-REG-APPL-NO field
v The transaction code in the OSI-REG-TPX-CODE field
$ Issue an OSI$RECEIVE function call in the new mode (OSI-MODE = OSI-NEW-CONV)

The example in Figure 4-4 shows the program statements to automatically schedule a TIP
transaction using the TIP$ format of the Called Session Selector.

APPLICATION ENTITY Record in Configuration Services Database on HOST 1

ADD APPLICATION-ENTITY
NAME=PUB-PROGBTIP2
S-SEL=TIP$07TRANSB
T-SEL=xxxx
NSAP=xxxx
. .
. .
Initiating Program Receiving Program
on HOST 1 on HOST 2

MOVE 'PROGA' TO OSI-INT-AP-NAME. MOVE 'TIP$07TRANSB' TO OSI-INT-AP-NAME.


COPY OSI-BIND. COPY OSI-BIND.
.
.
.
MOVE 'PUB-PROGBTIP2' TO MOVE 1 TO OSI-MODE.
OSI-CALLED-AE-TITLE-ALIAS.
COPY OSI-OPEN. COPY OSI-RECEIVE.

Figure 4-4. Scheduling a TIP Transaction Using the TIP$ Format

On the initiating side:

$ Register your program with DDP-PPC by placing the program name (PROGA) in the
OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing an OSI$BIND function call.
$ Specify the application entity alias name in the OSI-CALLED-AE-TITLE-ALIAS field
(PUB-PROGBTIP2). This name is defined in an APPLICATION ENTITY record in the
Configuration Services database on the local host. The S-SEL keyword of this record
(TIP$07TRANSB) is the special format that contains the information DDP-PPC needs
to initiate the transaction.

4-12 3787 3296-200


Automatic Scheduling

$ Issue an OSI$OPEN function call.

When DDP-PPC receives the open request, it initiates the TIP transaction (TRANSB).

$ The TIP program registers with DDP-PPC by setting the program name
(TIP$07TRANSB) in the OSI-INT-AP-NAME field of OSI-REGISTER-PKT and issuing
an OSI$BIND function.
$ The TIP program then issues an OSI$RECEIVE function (receive new format) to
receive the incoming open request from DDP-PPC.

3787 3296-200 4-13


Section 5
Compiling, Collecting, and Executing
DDP-PPC COBOL Application Programs

This section describes how to prepare programs for execution and the runstream for an
ASCII COBOL program-to-program application.

5.1. Preparing Programs for Execution


The DDP-PPC copy element OSI-COBOLCPY supports both ASCII and UCS COBOL
compilers. The function calls and COPY packets are the same for both compilers;
therefore, DDP-PPC does not require any source code changes to convert from one
compiler to the other.

A Unisys-supplied relocatable element, OSI-COBINTF, collects a program compiled under


ASCII COBOL and converts the COBOL functions into DDP format.

A program compiled under UCS COBOL can be dynamically linked at execution time or
statically linked using the LINK processor. The program is linked to a Unisys-supplied
object module, OSI-UCSIF-OM, that converts the COBOL function calls into DDP format.

Compile, collect, and execute DDP-PPC COBOL programs the same as any other ASCII or
UCS COBOL program. There are only three special requirements. You must:

$ Include an OSI-COBINTF interface relocatable element with your COBOL application


program relocatable element.
$ Include the OSI-UCSIF-OM interface object module with your COBOL application
program object module.
$ Ensure that the information packets, message buffer areas, and data areas in the
OSI-COBOLCPY element reside within address limitations.

3787 3296-200 5-1


Preparing Programs for Execution

Before running your application program, keep these precautions in mind:

$ You must follow the recommended MAP instructions in the collection of your
programs. Failure to do so can corrupt DDP banks, resulting in abnormal program
termination.
$ All buffer addresses, message lengths, user-ids, and conversation-ids must be correct.
Errors passed to DDP can cause abnormal program termination (that is, guard mode
violation).
$ Use only an E console keyin or @@X T command to terminate your run while in
session with DDP. Do not use an X console keyin.

5-2 3787 3296-200


The Runstream for an ASCII COBOL Program-to-Program Application

5.2. The Runstream for an ASCII COBOL


Program-to-Program Application
Figure 5-1 shows the runstream commands to compile and collect the ASCII COBOL
application element and the COBOL interface element for an OSI program-to-program
application.

@RUN run-id, acct no., project-id


@ASG,A COBOLCPY
@USE COB$PF, COBOLCPY DDP provides COPY
elements in a file
SYS$LIB$*DDP-PPC-3.
@ACOB,C filename.application-program-symbolic-name,
filename.application-program-relocatable-
element-name,,RN
@MAP,L ,filename.absolute-element-name
TYPE EXTDIAG
NOT TPF$. Suggested

LIB (ibank-name/$ODD,dbank-name/$EVEN)
LIB COBOL-relocatable-library() Parens ( ) are
LIB SYS$LIB$*DDP-PPC-1() optional. File
contains DDP
COBOL interface
relocatables.
IBANK,M ibank-name
FRSTIN user-filename.application-program-relocatable-element-name

DBANK,MC d-bank-name
FRSTIN user-filename.application-program-relocatable-element-name
END

@XQT filename.absolute-element-name

Figure 5-1. Runstream to Compile, Collect, and Execute an ASCII COBOL


Program-to-Program Application

After you obtain a clean compilation, you must collect the relocatable application element
and the DDP relocatable COBOL interface element and store them as one absolute element
in a program file. The COBOL/DDP interface relocatable elements are located in the DDP
relocatable file (SYS$LIB$*DDP-PPC-1).

3787 3296-200 5-3


The Runstream for a UCS COBOL Program-to-Program Application

5.3. The Runstream for a UCS COBOL


Program-to-Program Application
Figure 5-2 shows the runstream commands to compile the UCS COBOL application
element and the COBOL interface element for a program-to-program application into an
object program.

@RUN run-id, acct no., project-id


@USE COB$PF,SYS$LIB$*DDP-PPC-3.
@USE PPC-REL, SYS$LIB$*DDP-PPC-1.
@C.UCOB, E filename.application-program-symbolic-name,
filename.application-program-object-name
,,,COMPAT,no-remark
@LINK,S ,filename-application-program-name
OUTPUT ZOOM
INCLUDE filename-application-program-object-name
INCLUDE PPC-REL.OSI-UCSIF-OM
RESOLVE ALL REFERENCES USING LCN
@EOF
@XQT filename.application-program-name

Figure 5-2. Runstream to Compile and Execute a UCS COBOL Program-to-Program


Application

This runstream performs the following procedures:

1. Uses SYS$LIB$*DDP-PPC-3 and SYS$LIB$*DDP-PPC-1 as the files for the


DDP-PPC/OSI interface.
2. Specifies the element name of the source (symbolic element) program file that
contains your source application program and the element name of the object
module (relocatable element) output from the compiler.
3. Specifies the element name of the zoom module to the linker.
4. Specifies the compiled application program object module and the UCS
COBOL language interface code object module (OSI-UCSIF-OM) to be included in the
linked absolute module.
5. Executes the zoom module named in Step 3.

5-4 3787 3296-200


Multi-Activity and Banking Considerations

5.4. Multi-Activity and Banking Considerations

5.4.1. UCS COBOL


Banks that contains the message buffer and packets must not be greater that 262K words.

The entire messages buffer must reside in one data bank.

The packets and message buffer may reside in the same or different data banks.

Multiple activities are supported only if they are generated using the ASCII COBOL
synchronous processing feature.

5.4.2. ASCII COBOL


The entire messages buffer must reside in one data bank.

The packets and message buffer may reside in the same bank or different banks.

3787 3296-200 5-5


Appendix A
Data Packets

A.1. ACTIVITY Packet


This packet is referenced by the OSI$ACTMGT and OSI$RECEIVE functions. It contains
the specific activity management function to be performed, the activity id, and other
information needed to start, interrupt, resume, discard, and end activities.
01 OSI-ACTIVITY-PKT.
02 OSI-ACT-MGT-FUNC PIC 9(01) COMP.
88 OSI-ACT-START VALUE IS O.
88 OSI-ACT-RES VALUE IS 1.
88 OSI-ACT-INT VALUE IS 2.
88 OSI-ACT-INT-ACK VALUE IS 3.
88 OSI-ACT-DISC VALUE IS 4.
88 OSI-ACT-DISC-ACK VALUE IS 5.
88 OSI-ACT-END VALUE IS 6.
88 OSI-ACT-END-ACK VALUE IS 7.
02 FILLER PIC X(01) VALUE IS LOW-VALUES.
02 OSI-ACT-REASON PIC 9(03) COMP.
88 OSI-ACT-NO-REASON VALUE IS 0.
88 OSI-ACT-RCV-ABILITY-JEOP VALUE IS 1.
88 OSI-ACT-SEQUENCE-ERR VALUE IS 3.
88 OSI-ACT-LOCAL-USR-ERR VALUE IS 5.
88 OSI-ACT-UNRECOV-PROC-ERR VALUE IS 6.
88 OSI-ACT-DEMAND-DATA-TOKEN VALUE IS 128.
02 FILLER PIC X(1) VALUE IS LOW-VALUES.
02 OSI-ACT-ID-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-ACT-ID PIC X(6).
02 FILLER PIC X(1) VALUE IS LOW-VALUES.
02 OSI-OLD-ACT-ID-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-OLD-ACT-ID PIC X(6).
02 OSI-OLD-SCI-CALLING-REF-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-OLD-SCI-CALLED-REF-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-OLD-SCI-COMMON-REF-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-OLD-SCI-ADD-REF-LEN PIC 9(2) COMP VALUE IS 0.
02 OSI-ACT-SESSION-CONNECTION-ID.
05 OSI-OLD-SCI-CALLING-REF PIC X(64).
05 OSI-OLD-SCI-CALLED-REF PIC X(64).
05 OSI-OLD-SCI-COMMON-REF PIC X(64).
05 OSI-OLD-SCI-ADD-REF PIC X(4).

3787 3296-200 A-1


ADDRESS Packet

A.2. ADDRESS Packet


This packet is used on the OSI$OPEN, OSI$RECEIVE, and OSI$OPRESP calls. It contains
addressing information necessary to establish a connection with a peer program.
01 OSI-ADDRESS-PKT.
02 OSI-CALLING-AE-TITLE.
03 OSI-CALLING-AE-TITLE-ALIAS PIC X(16).
03 OSI-CALLING-AP-TITLE PIC X(256).
03 OSI-CALLING-AE-QUAL PIC X(100).
03 OSI-CALLING-AE-TITLE-FORM PIC X(1).
03 FILLER PIC X(03) VALUE LOW-VALUES.
02 OSI-CALLING-P-ADDRESS.
03 OSI-CALLING-P-SELECTOR PIC X(16).
03 OSI-CALLING-S-SELECTOR PIC X(16).
03 OSI-CALLING-T-SELECTOR PIC X(32).
03 OSI-CALLING-NSAP PIC X(32).
03 OSI-CALLING-HOST-NAME PIC X(8).
02 OSI-CALLING-AE-TITLE-LEN.
03 OSI-CALLING-AP-TITLE-LEN PIC 9(3) COMP.
03 OSI-CALLING-AE-QUAL-LEN PIC 9(3) COMP.
02 OSI-CALLING-P-ADDRESS-LEN.
03 OSI-CALLING-P-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLING-S-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLING-T-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLING-NSAP-LEN PIC 9(2) COMP.
02 OSI-CALLED-AE-TITLE.
03 OSI-CALLED-AE-TITLE-ALIAS PIC X(16).
03 OSI-CALLED-AP-TITLE PIC X(256).
03 OSI-CALLED-AE-QUAL PIC X(4).
03 OSI-CALLED-AP-TITLE-FORM PIC X(100).
03 FILLER PIC X(03) VALUE LOW-VALUES.
02 OSI-CALLED-P-ADDRESS.
03 OSI-CALLED-P-SELECTOR PIC X(16).
03 OSI-CALLED-S-SELECTOR PIC X(16).
03 OSI-OPEN-TIP REDEFINES OSI-CALLED-
S-SELECTOR.
05 OSI-OPEN-TIP-IND PIC X(4).
05 OSI-OPEN-APPL-NO PIC X(2).
05 OSI-OPEN-TPX-CODE PIC X(6).
05 FILLER PIC X(4).
03 OSI-CALLED-T-SELECTOR PIC X(32).
03 OSI-CALLED-NSAP PIC X(32).
03 OSI-CALLED-TRANSPORT PIC X(8).
02 OSI-CALLED-AE-TITLE-LEN.
03 OSI-CALLED-AP-TITLE-LEN PIC 9(3) COMP.
03 OSI-CALLED-AE-QUAL-LEN PIC 9(3) COMP.
02 OSI-CALLED-P-ADDRESS-LEN.
03 OSI-CALLED-P-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLED-S-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLED-T-SELECTOR-LEN PIC 9(2) COMP.
03 OSI-CALLED-NSAP-LEN PIC 9(2) COMP.
66 OSI-CALLED-HOST-NAME RENAMES OSI-CALLED-TRANSPORT.
66 OSI-RESPONDING-AE-TITLE-ALIAS RENAMES OSI-CALLED-AE-TITLE-ALIAS.
66 OSI-RESPONDING-AE-TITLE RENAMES OSI-CALLED-AE-TITLE.

A-2 3787 3296-200


ADDRESS Packet

66 OSI-RESPONDING-AP-TITLE RENAMES OSI-CALLED-AP-TITLE.


66 OSI-RESPONDING-AE-QUAL RENAMES OSI-CALLED-AE-QUAL.
66 OSI-RESPONDING-AP-TITLE-FORM RENAMES OSI-CALLED-AP-TITLE-FORM.
66 OSI-RESPONDING-P-ADDRESS RENAMES OSI-CALLED-P-ADDRESS.
66 OSI-RESPONDING-P-SELECTOR RENAMES OSI-CALLED-P-SELECTOR.
66 OSI-RESPONDING-S-SELECTOR RENAMES OSI-CALLED-S-SELECTOR.
66 OSI-RESPONDING-T-SELECTOR RENAMES OSI-CALLED-T-SELECTOR.
66 OSI-RESPONDING-NSAP RENAMES OSI-CALLED-NSAP.
66 OSI-RESPONDING-HOST-NAME RENAMES OSI-CALLED-TRANSPORT.
66 OSI-RESPONDING-AE-TITLE-FORM RENAMES OSI-CALLED-AE-TITLE-FORM.
66 OSI-RESPONDING-AE-TITLE-LEN RENAMES OSI-CALLED-AE-TITLE-LEN.
66 OSI-RESPONDING-AP-TITLE-LEN RENAMES OSI-CALLED-AP-TITLE-LEN.
66 OSI-RESPONDING-AE-QUAL-LEN RENAMES OSI-CALLED-AE-QUAL-LEN.
66 OSI-RESPONDING-P-ADDRESS-LEN RENAMES OSI-CALLED-P-ADDRESS-LEN.
66 OSI-RESPONDING-P-SELECTOR-LEN RENAMES OSI-CALLED-P-SELECTOR-LEN.
66 OSI-RESPONDING-S-SELECTOR-LEN RENAMES OSI-CALLED-S-SELECTOR-LEN.
66 OSI-RESPONDING-T-SELECTOR-LEN RENAMES OSI-CALLED-T-SELECTOR-LEN.
66 OSI-RESPONDING-NSAP-LEN RENAMES OSI-CALLED-NSAP-LEN.

3787 3296-200 A-3


APPLICATION PRESENTATION Packet

A.3. APPLICATION PRESENTATION Packet


This packet is used on the OSI$OPEN, OSI$RECEIVE, OSI$ABORT, and OSI$OPRESP
calls. DDP-PPC uses its contents only when the application layer interface is selected
(OSI-SERVICE-ENTRY = 7). It contains information necessary for opening connections
between application layer entities and for the negotiation and subsequent use of
Presentation Context Identifiers.
01 OSI-APPL-PRES-PKT.
02 OSI-APPL-CONTEXT-NAME-ALIAS PIC X(16).
02 OSI-APPL-CONTEXT-NAME PIC X(44).
02 OSI-APPL-CONTEXT-NAME-LEN PIC 9(02) COMP.
02 OSI-PRES-MODE PIC 9(02) COMP VALUE IS 0.
88 OSI-PRES-NORMAL-MODE VALUE IS 0.
88 OSI-PRES-X410-MODE VALUE IS 0.
02 FILLER PIC X(02) VALUE LOW-VALUES.
02 OSI-CALLED-P-INVOCATION-ID PIC 9(10) COMP.
02 OSI-CALLED-E-INVOCATION-ID PIC 9(10) COMP.
02 OSI-CALLING-P-INVOCATION-ID PIC 9(10) COMP.
02 OSI-CALLING-E-INVOCATION-ID PIC 9(10) COMP.
02 OSI-CALLED-P-INVOC-ID-LEN PIC 9(02) COMP.
02 OSI-CALLED-E-INVOC-ID-LEN PIC 9(02) COMP.
02 OSI-CALLING-P-INVOC-ID-LEN PIC 9(02) COMP.
02 OSI-CALLING-E-INVOC-ID-LEN PIC 9(02) COMP.
02 OSI-APPL-PRES-RESULT PIC 9(2) COMP VALUE IS 0.
88 OSI-AU-ASSOC-ACCEPTED VALUE IS 0.
88 OSI-AU-NO-REASON VALUE IS 1.
88 OSI-AU-APPL-CNTXT-UNSUPPORTED VALUE IS 2.
88 OSI-AU-CALLG-AP-TITLE-UNRECOG VALUE IS 3.
88 OSI-AU-CALLG-AP-INVID-UNRECOG VALUE IS 4.
88 OSI-AU-CALLG-AE-QUAL-UNRECOG VALUE IS 5.
88 OSI-AU-CALLG-AE-INVID-UNRECOG VALUE IS 6.
88 OSI-AU-CALLD-AP-TITLE-UNRECOG VALUE IS 7.
88 OSI-AU-CALLD-AP-INVID-UNRECOG VALUE IS 8.
88 OSI-AU-CALLD-AE-QUAL-UNRECOG VALUE IS 9.
88 OSI-AU-CALLD-AE-INVID-UNRECOG VALUE IS 10.
88 OSI-AP-NO-REASON VALUE IS 11.
88 OSI-AP-NO-COMMON-ACSE-VERSION VALUE IS 12.
88 OSI-PP-NO-REASON VALUE IS 13.
88 OSI-PP-CONGESTION VALUE IS 14.
88 OSI-PP-LOCAL-LIMIT-EXCEEDED VALUE IS 15.
88 OSI-PP-CALLD-PRES-ADDR-UNKNOWN VALUE IS 16.
88 OSI-PP-PROT-VER-UNSUPPORTED VALUE IS 17.
88 OSI-PP-DEF-CONTEXT-UNSUPPORTED VALUE IS 18.
88 OSI-PP-USER-DATA-UNREADABLE VALUE IS 19.
88 OSI-PP-NO-PSAP-AVAILABLE VALUE IS 20.
88 OSI-SP-SSAP-ID-UNKNOWN VALUE IS 21.
88 OSI-SP-USER-NOT-ATTACHED VALUE IS 22.
88 OSI-SP-SPM-CONGESTION VALUE IS 23.
88 OSI-SP-PROT-VER-UNSUPPORTED VALUE IS 24.
88 OSI-SP-SPM-NO-REASON VALUE IS 25.
88 OSI-SU-NO-REASON VALUE IS 26.
88 OSI-SU-CONGESTION VALUE IS 27.
88 OSI-SU-SEE-DDTP VALUE IS 28.
02 OSI-APPL-PRES-RESULT-TYPE PIC 9(2) COMP VALUE IS 0.
88 OSI-NULL VALUE IS 0.
88 OSI-PERMANENT VALUE IS 1.
88 OSI-TRANSIENT VALUE IS 2.

A-4 3787 3296-200


APPLICATION PRESENTATION Packet

02 OSI-PRES-CONTEXT-TABLE-ENTRIES PIC 9(2) COMP.


02 FILLER PIC X(1) VALUE LOW-VALUES.
02 OSI-PRES-CONTEXT-TABLE OCCURS 15 TIMES.
05 OSI-PRES-CONTEXT-IDENT PIC S9(10) COMP.
05 OSI-ABSTRACT-SYNTAX-ALIAS PIC X(16).
05 OSI-TRANSFER-SYNTAX-ALIAS PIC X(16).
05 OSI-CONTEXT-INDICATOR PIC 9(1) COMP.
88 OSI-PU-CONTEXT-ACCEPTED VALUE IS 0.
88 OSI-PU-CONTEXT-REJECTED VALUE IS 1.
88 OSI-PP-REJ-NO-REASON VALUE IS 2.
88 OSI-PP-REJ-AS-UNSUPPORTED VALUE IS 3.
88 OSI-PP-REJ-TS-UNSUPPORTED VALUE IS 4.
88 OSI-PP-REJ-DCS-LIM-EXCEEDED VALUE IS 5.
05 FILLER PIC X(3).
66 OSI-RESPONDING-P-INVOCATION-ID RENAMES OSI-CALLED-P-INVOCATION-ID.
66 OSI-RESPONDING-E-INVOCATION-ID RENAMES OSI-CALLED-E-INVOCATION-ID.
66 OSI-RESPONDING-P-INVOC-ID-LEN RENAMES OSI-CALLED-P-INVOC-ID-LEN.
66 OSI-RESPONDING-E-INVOC-ID-LEN RENAMES OSI-CALLED-E-INVOC-ID-LEN.

3787 3296-200 A-5


CONNECT Packet

A.4. CONNECT Packet


This packet is used on the OSI$OPEN, OSI$RECEIVE, and OSI$OPRESP calls. It contains
information necessary to establish a connection with a peer program.
01 OSI-CONNECT-PKT.
02 OSI-TRANSPORT-CLASS PIC 9(2) COMP VALUE IS 2.
88 OSI-TRANSPORT-CLASS-0 VALUE IS 0.
88 OSI-TRANSPORT-CLASS-2 VALUE IS 2.
88 OSI-TRANSPORT-CLASS-4 VALUE IS 4.
88 OSI-TRANSPORT-CLASS-4-IP VALUE IS 20.
88 OSI-TRANSPORT-CLASS-NOT-USED VALUE IS 99.
02 OSI-TRANSPORT-CLASS-ALT PIC 9(2) COMP VALUE IS 0.
02 OSI-TRANSPORT-FACILITIES PIC 9(2) COMP VALUE IS 34.
02 OSI-SESSION-RESULT PIC 9(1) COMP VALUE IS 0.
88 OSI-CN-ACCEPT VALUE 0.
88 OSI-CN-REJ-USR-NO-REASON VALUE 1.
88 OSI-CN-REJ-USR-CONGESTION VALUE 2.
88 OSI-CN-REJ-USR-SEE-DATA VALUE 3.
88 OSI-CN-REJ-PRO-SEL-UNKNOWN VALUE 4.
88 OSI-CN-REJ-PRO-NOT-ATTACH VALUE 5.
88 OSI-CN-REJ-PRO-CONGESTION VALUE 6.
88 OSI-CN-REJ-PRO-VER-UNSUPPORTED VALUE 7.
88 OSI-CN-REJ-PRO-NO-REASON VALUE 8.
02 OSI-SERVICE-ENTRY PIC 9(2) COMP VALUE IS 7.
02 OSI-SERVICE-EXIT PIC 9(2) COMP VALUE IS 0.
02 OSI-SESSION-VERSION.
05 OSI-SESSION-VERSION-1 PIC 9(1) COMP VALUE IS 1.
05 OSI-SESSION-VERSION-2 PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
02 OSI-FUNC-UNITS-SELECTED.
05 FUNC-UNIT-TYPED-DATA PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-EXCEPTIONS PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-CAP-DATA PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-ACT-MGT PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-RESYNC PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-MINOR-SYNC PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-DUPLEX PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-HALF-DUPLEX PIC 9(1) COMP VALUE IS 0.
88 OSI-TWA VALUE IS 1.
05 FILLER PIC 9(1) COMP VALUE IS 0.
05 FUNC-UNIT-DATA-SEP PIC 9(1) COMP VALUE IS 0.
05 FILLER PIC X(3) VALUE LOW-VALUES.
02 SCI-CALLING-REFERENCE-LEN PIC 9(2) COMP VALUE IS 0.
02 SCI-COMMON-REFERENCE-LEN PIC 9(2) COMP VALUE IS 0.
02 SCI-ADDITIONAL-REFERENCE-LEN PIC 9(2) COMP VALUE IS 0.
02 FILLER PIC X(1) VALUE LOW-VALUES.
02 OSI-CN-SESSION-CONNECTION-ID.
05 SCI-CALLING-REFERENCE PIC X(64).

A-6 3787 3296-200


CONNECT Packet

05 SCI-COMMON-REFERENCE PIC X(64).


05 SCI-ADDITIONAL-REFERENCE PIC X(4).
02 OSI-QUALITY-OF-SERVICE.
05 QOS-CNX-ESTAB-DELAY PIC 9(10) COMP VALUE 0.
05 QOS-CNX-ESTAB-FAILURE-PROB PIC 9(2) COMP VALUE 0.
05 QOS-RESIDUAL-ERROR-RATE PIC 9(2) COMP VALUE 0.
05 QOS-TRANSIT-DELAY PIC 9(5) COMP VALUE 0.
05 QOS-THROUGHPUT-OUT PIC 9(10) COMP VALUE 0.
05 QOS-THROUGHPUT-IN PIC 9(10) COMP VALUE 0.
05 QOS-CNX-RLS-DELAY PIC 9(10) COMP VALUE 0.
05 QOS-CNX-RLS-FAILURE-PROB PIC 9(2) COMP VALUE 0.
05 QOS-CNX-XFER-FAILURE-PROB PIC 9(2) COMP VALUE 0.
05 QOS-CNX-PROTECTION PIC 9(2) COMP VALUE 0.
05 QOS-PRIORITY PIC 9(2) COMP VALUE 0.
05 QOS-CNX-RESILIANCE PIC 9(2) COMP VALUE 0.
05 QOS-OPT-DIALOG-XFER PIC 9(2) COMP VALUE 0.
05 QOS-EXTENDED-CNTL-ABORT PIC 9(2) COMP VALUE 0.
05 QOS-EXTENDED-CNTL-EXCEPTION PIC 9(2) COMP VALUE 0.
66 SCI-CALLED-REFERENCE RENAMES SCI-CALLING-REFERENCE.
66 SCI-CALLED-REFERENCE-LEN RENAMES SCI-CALLING-REFERENCE-
LEN.

3787 3296-200 A-7


DATA Packet

A.5. DATA Packet


This packet is referenced by all function calls that can transfer data. It contains the type,
length, and location of data being sent or received. This packet is also used to control the
data, sync-minor, and major/activity tokens.
01 OSI-DATA-PKT.
02 OSI-CONNECTION PIC S9(10) COMP.
02 OSI-DATA-TYPE PIC 9(3) COMP.
88 OSI-TRANSPARENT-TYPE VALUE IS 134.
88 OSI-COMPRESSED-TRANSP VALUE IS 135.
88 OSI-PAD-TRANSPARENT VALUE IS 138.
88 OSI-COMP-PAD-TRANSP VALUE IS 139.
88 OSI-OCTET-STRING VALUE IS 140.
88 OSI-COMP-OCTET-STRING VALUE IS 141.
02 FILLER PIC X(2) VALUE IS LOW-VALUES.
02 OSI-BUFFER-OFFSET PIC 9(5) COMP.
02 OSI-TEXT-LENGTH PIC 9(5) COMP.
02 FILLER PIC X(4) VALUE IS LOW-VALUES.
02 OSI-TEXT-START PIC 9(5) COMP.
02 OSI-FLWCTL-WAIT PIC 9(5) COMP.
02 OSI-INPUT-MSGS-PENDING PIC 9(1) COMP VALUE IS 0.
88 OSI-NO-MSGS-TO-RECEIVE VALUE IS 0.
88 OSI-MSGS-TO-RECEIVE VALUE IS 1.
02 OSI-UNIT-INDICATOR PIC 9(1) COMP VALUE IS 1.
88 OSI-MSG-INCOMPL VALUE IS 0.
88 OSI-MSG-COMPL VALUE IS 1.
02 OSI-DATA-RELEASE PIC 9(1) COMP VALUE IS 1.
88 OSI-NOREL VALUE IS 0.
88 OSI-REL VALUE IS 1.
02 FILLER PIC X(1) VALUE IS LOW-VALUES.
02 OSI-DATA-TOKEN PIC 9(1) COMP VALUE IS 0.
88 OSI-DATA-HOLD VALUE IS 0.
88 OSI-DATA-PASS VALUE IS 1.
88 OSI-DATA-CHOICE VALUE IS 2.
88 OSI-DATA-RQST VALUE IS 3.
02 OSI-SYNC-MINOR-TOKEN PIC 9(1) COMP VALUE IS 0.
88 OSI-SYNC-MINOR-HOLD VALUE IS 0.
88 OSI-SYNC-MINOR-PASS VALUE IS 1.
88 OSI-SYNC-MINOR-CHOICE VALUE IS 2.
88 OSI-SYNC-MINOR-RQST VALUE IS 3.
02 OSI-ACT-MAJOR-TOKEN PIC 9(1) COMP VALUE IS 0.
88 OSI-ACT-MAJOR-HOLD VALUE IS 0.
88 OSI-ACT-MAJOR-PASS VALUE IS 1.
88 OSI-ACT-MAJOR-CHOICE VALUE IS 2.
88 OSI-ACT-MAJOR-RQST VALUE IS 3.
02 FILLER PIC X(1) VALUE IS LOW-VALUES.
02 OSI-EXCEPTION-REASON PIC 9(5) COMP.
88 OSI-XCP-NO-REASON VALUE IS 0.
88 OSI-XCP-RCV-ABILITY-JEOP VALUE IS 1.
88 OSI-XCP-SEQUENCE-ERR VALUE IS 3.
88 OSI-XCP-LOCAL-USR-ERR VALUE IS 5.
88 OSI-XCP-UNRECOV-PROC-ERR VALUE IS 6.
88 OSI-XCP-DEMAND-DATA-TOKEN VALUE IS 128.
02 FILLER PIC X(2) VALUE IS LOW-VALUES.
02 OSI-SYNC-POINT-SERIAL-NUMBER PIC 9(10) COMP VALUE IS 0.

A-8 3787 3296-200


RECEIVE Packet

A.6. RECEIVE Packet


This packet is referenced only by the OSI$RECEIVE function. It contains the time to wait
for data to be received. It contains several parameters, which are returned upon successful
reception of data, that describe the data received.
01 OSI-RCV-PKT.
02 OSI-RCV-WAIT-TIME PIC S9(5) COMP.
02 OSI-MODE PIC 9(1) COMP.
88 OSI-CONT-MODE VALUE IS 0.
88 OSI-NEW-CONV VALUE IS 1.
02 OSI-MSG-TYPE PIC 9(2) COMP.
88 OSI-MSG-OPEN VALUE IS 0.
88 OSI-MSG-SEND VALUE IS 1.
88 OSI-MSG-CLOSE VALUE IS 2.
88 OSI-MSG-OPRESP VALUE IS 4.
88 OSI-MSG-TPDATA VALUE IS 5.
88 OSI-MSG-CLRESP VALUE IS 6.
88 OSI-MSG-ABORT VALUE IS 7.
88 OSI-MSG-SYNC VALUE IS 8.
88 OSI-MSG-ACTMGT VALUE IS 9.
88 OSI-MSG-XRPT VALUE IS 10.
88 OSI-TOKENS-INDICATION VALUE IS 11.
88 OSI-NO-INDICATION VALUE IS 12.
88 OSI-MSG-CPRESP VALUE IS 13.
88 OSI-MSG-RESYNC VALUE IS 14.
88 OSI-MSG-CPDATA VALUE IS 15.
02 OSI-TOTAL-MSG-LEN PIC 9(5) COMP.
02 FILLER PIC X(2) VALUE IS LOW-VALUES.

3787 3296-200 A-9


REGISTER Packet

A.7. REGISTER Packet


This packet contains the program name for the OSI$BIND function. Only the OSI$BIND
function uses it.
01 OSI-REGISTER-PKT.
02 OSI-INT-AP-NAME PIC X(16).
02 OSI-REGISTER-TIP REDEFINES OSI-INT-AP-NAME.
03 OSI-REG-TIP-IND PIC X(4).
03 OSI-REG-APPL-NO PIC X(2).
03 OSI-REG-TPX-CODE PIC X(6).
03 FILLER PIC X(4).

A-10 3787 3296-200


RESYNCHRONIZATION Packet

A.8. RESYNCHRONIZATION Packet


This packet is referenced by the OSI$RESYNC and OSI$RECEIVE functions. It contains
information needed to resynchronize a connection to a previous synchronization point.
01 OSI-RESYNC-PKT.
02 OSI-RESYNC-FUNC PIC 9(01) COMP.
88 OSI-RESYNC-RESTART VALUE 0.
88 OSI-RESYNC-ABANDON VALUE 1.
88 OSI-RESYNC-SET VALUE 2.
88 OSI-RESYNC-CONFIRM VALUE 3.
02 FILLER PIC X(3) VALUE IS LOW-VALUES.

3787 3296-200 A-11


STATUS Packet

A.9. STATUS Packet


All function calls reference this packet to:

$ Determine the completion status of the DDP-PPC function


$ Identify the user program to DDP-PPC
$ Indicate the interface version the program uses
01 OSI-STATUS-PKT.
02 OSI-CLASS-CODE PIC 9(3) COMP.
88 OSI-OK VALUE IS 1.
88 OSI-ERROR VALUE IS 2 THRU 132.
02 OSI-DETAIL-STATUS PIC 9(3) COMP.
02 OSI-USER-ID PIC S9(10) COMP.
02 OSI-VERSION PIC 9(5) COMP VALUE IS 1538.
02 OSI-SPECIFIC-ERROR PIC 9(5) COMP.
02 FILLER PIC X(92) VALUE IS LOW-VALUES.

A-12 3787 3296-200


SYNCHRONIZATION Packet

A.10. SYNCHRONIZATION Packet


This packet is referenced by the OSI$SYNC and OSI$RECEIVE functions. It contains
information needed to set synchronization points.
01 OSI-SYNC-PKT.
02 OSI-SYNC-FUNC PIC 9(01) COMP.
88 OSI-SYNC-SET-CNFRM-EXPLICIT VALUE 0.
88 OSI-SYNC-SET-CNFRM-OPTIONAL VALUE 1.
88 OSI-SYNC-CONFIRM VALUE 2.
02 OSI-SYNC-DATA-SEP PIC 9(01) COMP.
02 FILLER PIC X(2) VALUE IS LOW-VALUES.

3787 3296-200 A-13


Appendix B
DDP-PPC/OSI Sample Programs

This appendix provides a sample set of DDP-PPC/OSI program-to-program applications.

$ B.1 is the ASCII COBOL ECL runstream for the session-level primary program in B.3.
$ B.2 is the UCS COBOL ECL runstream for the session-level primary program in B.3.
$ B.4 is the ASCII COBOL ECL runstream for the session-level secondary program in B.6.
$ B.5 is the UCS COBOL ECL runstream for the session-level secondary program in B.6.
$ B.7 is the ASCII COBOL ECL runstream for the application-level primary program in
B.9.
$ B.8 is the UCS COBOL ECL runstream for the application-level primary program in B.9.
$ B.10 is the ASCII COBOL ECL runstream for the application-level primary program in
B.12.
$ B.11 is the UCS COBOL ECL runstream for the application-level primary program in
B.12.

Table B-1 describes how to convert a session-level program to an application-level


program.

3787 3296-200 B-1


DDP-PPC/OSI Sample Programs

Table B-1. Conversion Coding from Session Entry to Application Entry

Step Description

1 Add a data type to the data packet for OSI$SOPEN, OSI$SYNC, OSI$SEND,
OSI$RECEIVE, and OSI$OPRESP procedure division routines. For example:
MOVE 140 TO OSI-DATA-TYPE.

2 Change the service entry point in the connect packet from session-level entry to
application-level entry in both the OSI$OPEN and OSI$RECEIVE procedure division
routines. For example:
MOVE 7 TO OSI-SERVICE-ENTRY.

3 Initialize the context table syntaxes in the application presentation packet for
OSI$OPEN and OSI$OPRESP to the corresponding abstract and transfer syntaxes.
For example:
MOVE 1 TO OSI-PRESENTATION-CONTEXT-IDENT (1).
MOVE 'ACSE-AS' TO OSI-ABSTRACT-SYNTAX-ALIAS(1).
MOVE 'ACN1-TS' TO OSI-TRANSFER-SYNTAX-ALIAS(1).

MOVE 3 TO OSI-PRESENTATION-CONTEXT-IDENT (2).


MOVE 'ACSE-AS' TO OSI-ABSTRACT-SYNTAX-ALIAS(2).
MOVE 'ACN1-TS' TO OSI-TRANSFER-SYNTAX-ALIAS(2).

MOVE 2 TO OSI-PRES-CONTEXT-TABLE-ENTRIES.

4 Set an application context name alias in the application presentation packet. For
example:
MOVE 'MYAPPL' TO OSI-APPL-CONTEXT-NAME-ALIAS.

B-2 3787 3296-200


ACOB Session-level Entry Primary Program Runstream

B.1. ACOB Session-level Entry Primary Program


Runstream
Example code for ACOB Session-level Entry Primary Program Runstream
@USE COB$PF,sys$lib$*ddp-ppc-3.
@USE src,sample*7r1programs.
@USE rel,sample*7r1programs.
@USE abs,sample*7r1programs.
@USE ppc-rel,sys$lib$*ddp-ppc-1.
@ACOB,ECS src.acobosi5pri,rel.acobosi5pri/7r1,,NR
@MAP,ES ,abs.acobosi5pri/7r1

TYPE EXTDIAG
NOT TPF$.
LIB (I$1/$ODD,D$2/$EVEN)
LIB sys$lib$*acob()
LIB ppc-rel()
IBANK,M I$1
FRSTIN rel.acobosi5pri/7r1
DBANK,UMC D$2
FRSTIN rel.acobosi5pri/7r1
END

3787 3296-200 B-3


UCOB Session-level Primary Program Runstream

B.2. UCOB Session-level Primary Program


Runstream
Example code for UCOB Session-level Primary Program
@use COB$PF,sys$lib$*ddp-ppc-3.
@use src,sample*7r1programs.
@use om,sample*7r1programs.
@use ppc-rel,sys$lib$*ddp-ppc-1.
@ucob,s src.ucobosi5pri,om.ucobosi5pri,,,compat,no-remark
@link,s ,om.ucobosi5pri/7r1
output zoom
include om.ucobosi5pri
include ppc-rel.osi-ucsif-om
resolve all references using lcn
@eof

B-4 3787 3296-200


Session-level Entry Primary Program

B.3. Session-level Entry Primary Program


IDENTIFICATION DIVISION.
PROGRAM-ID. DDP-UCOB-OSI-PRIMARY-PROGRAM.
INSTALLATION. UNISYS COMPUTER SYSTEMS, MALVERN, PA.
DATE-WRITTEN.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
OBJECT-COMPUTER. UNISYS-2200.
*
/
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 LOCAL-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-1'.
*
01 DESTINATION-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-2'.
*
01 OSI-MSG-BUFFER.
02 OUTPUT-MESSAGE-FORMAT.
05 OUTPUT-MESSAGE-AREA PIC X(132).
02 INPUT-MESSAGE-FORMAT REDEFINES OUTPUT-MESSAGE-FORMAT.
05 INPUT-MESSAGE-AREA PIC X(132).
*
01 OPEN-MESSAGE.
05 FILLER PIC X(49) VALUE
'THIS MESSAGE WAS SENT WITH AN OPEN REQUEST, YOUR '.
05 FILLER PIC X(51) VALUE
'OPRESP WILL COMPLETE THE OPEN PROCESS AND ESTABLISH'.
05 FILLER PIC X(16) VALUE
' A CONVERSATION.'.
*
01 SYNC-MESSAGE-1.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE IS SENT WITH THE SYNC FUNCTION. '.
05 FILLER PIC X(48) VALUE
'THE SYNC POINT SERIAL IS SET TO 1 AND A CONFIRM '.
05 FILLER PIC X(12) VALUE
'IS REQUIRED.'.

01 SEND-MESSAGE-1.
05 FILLER PIC X(51) VALUE
'THIS WAS THE 1ST MESSAGE SENT WITH A SEND FUNCTION '.
05 FILLER PIC X(21) VALUE 'IN THIS CONVERSATION.'.
*
01 SEND-MESSAGE-2.
05 FILLER PIC X(54) VALUE
'THIS WAS THE LAST MESSAGE SENT BY THE CALLING PROGRAM '.

3787 3296-200 B-5


Session-level Entry Primary Program

05 FILLER PIC X(25) VALUE 'USING THE SEND FUNCTION.'.


*
01 SYNC-MESSAGE-2.
05 FILLER PIC X(53) VALUE
'THIS MESSAGE WAS THE 2ND SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(48) VALUE
'THE SYNC POINT SERIAL NUMBER IS SET TO 2 AND'.
05 FILLER PIC X(23) VALUE ' A CONFIRM IS REQUIRED.'.
*
01 CLOSE-MESSAGE.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH A CLOSE FUNCTION, '.
05 FILLER PIC X(47) VALUE
'YOUR RESPONSE WILL COMPLETE THE CLOSE PROCESS'.
05 FILLER PIC X(32) VALUE
' AND TERMINATE THE CONVERSATION.'.
*
01 STATUS-VARIABLES.
02 AP-CLASS-CODE PIC 9(3).
02 AP-DETAIL-STATUS PIC 9(3).
02 AP-SPECIFIC-ERROR PIC 9(6).
02 DONE PIC 9(1) VALUE IS 0.
02 USER-ID PIC S9(11) SIGN IS LEADING.
02 USER-ID-NO-SIGN REDEFINES USER-ID.
03 FILLER PIC X(1).
03 USER-ID-NUM PIC 9(10).
02 CONNECTION-ID PIC S9(11) SIGN IS LEADING.
02 CONNECTION-ID-NO-SIGN REDEFINES CONNECTION-ID.
03 FILLER PIC X(1).
03 CONNECTION-ID-NUM PIC 9(10).
02 BOUND PIC 9(1) VALUE IS 0.
*
/
* INPUT AREAS
01 AE-ALIAS PIC X(16) VALUE ALL SPACES.
*
*

/
COPY OSI-PKT.
/
PROCEDURE DIVISION.

******************************************************************
* *
* BIND - AP NAME IS FIXED AT SAMPLE-PROGRAM-1 *
* *
* *
******************************************************************

0100-BIND-ROUTINE.

MOVE LOCAL-PROGRAM-NAME TO OSI-INT-AP-NAME.

COPY OSI-BIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

B-6 3787 3296-200


Session-level Entry Primary Program

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'BIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',
AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE OSI-USER-ID TO USER-ID.


DISPLAY 'USER ID IS ' USER-ID-NUM.
MOVE 1 TO BOUND.

******************************************************************
* *
* *
* SETUP PACKETS TO OPEN CONVERSATION *
* *
* *
******************************************************************

0200-OPEN-CONVERSATION.

MOVE USER-ID TO OSI-USER-ID.

* SETUP DATA PACKET.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE OPEN-MESSAGE TO OUTPUT-MESSAGE-AREA.
MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.

* SETUP CONNECT PACKET.

MOVE 5 TO OSI-SERVICE-ENTRY.
MOVE 1 TO OSI-SESSION-VERSION-1.
MOVE 1 TO OSI-SESSION-VERSION-2.
MOVE 0 TO FUNC-UNIT-TYPED-DATA.
MOVE 0 TO FUNC-UNIT-EXCEPTIONS.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 0 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.
MOVE 0 TO SCI-CALLING-REFERENCE-LEN.
MOVE 0 TO SCI-COMMON-REFERENCE-LEN.
MOVE 0 TO SCI-ADDITIONAL-REFERENCE-LEN.

* SETUP ADDRESS PACKET.

DISPLAY 'ENTER CALLED AE-ALIAS.'.

ACCEPT AE-ALIAS.
INSPECT AE-ALIAS REPLACING CHARACTERS BY ' ' AFTER

3787 3296-200 B-7


Session-level Entry Primary Program

INITIAL SPACE.
MOVE AE-ALIAS TO OSI-CALLED-AE-TITLE-ALIAS.

DISPLAY 'ENTER CALLING AE-ALIAS.'.

ACCEPT AE-ALIAS.
INSPECT AE-ALIAS REPLACING CHARACTERS BY ' ' AFTER
INITIAL SPACE.
MOVE AE-ALIAS TO OSI-CALLING-AE-TITLE-ALIAS.

COPY OSI-OPEN.

MOVE OSI-CONNECTION TO CONNECTION-ID.


MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.
MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'OPEN CLASS IS ',


AP-CLASS-CODE, ' STATUS IS ',
AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.


DISPLAY 'CONNECTION ID IS ' CONNECTION-ID-NUM.

******************************************************************
* *
* *
* RECEIVE OPEN RESPONSE FROM SAMPLE-PROGRAM-2 *
* *
* *
******************************************************************

*
0300-RECEIVE-OPEN-RESPONSE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

IF NOT OSI-CN-ACCEPTED
DISPLAY 'PEER REFUSED OPEN REQUEST DUE TO REASON ',
OSI-SESSION-RESULT
GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *

B - 3787 3296-200
Session-level Entry Primary Program

* *
* SYNC WITH CONFIRM REQUESTED *
* *
* *
*****************************************************************

0400-SYNC-1.

MOVE SYNC-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE SYNC CONFIRM *
* *
* *
*****************************************************************

0500-RECEIVE-SYNC-1-CONFIRM.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SEND 1ST MESSAGE *
* *
* *
*****************************************************************

0600-SEND-MSG-1.

MOVE SEND-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 3000-SEND-MSG.

DISPLAY 'SEND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',

3787 3296-200 B-9


Session-level Entry Primary Program

AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',


AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SEND LAST MESSAGE *
* *
* *
*****************************************************************

0700-SEND-MSG-2.

MOVE SEND-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 3000-SEND-MSG.

DISPLAY 'SEND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SYNC WITH CONFIRM REQUESTED *
* *
* *
*****************************************************************

0800-SYNC-2.

MOVE SYNC-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE SYNC CONFIRM *
* *
* *
*****************************************************************

0810-RECEIVE-SYNC-2-CONFIRM.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.

B-10 3787 3296-200


Session-level Entry Primary Program

MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR CLOSE *
* *
* *
*****************************************************************

0900-CLOSE.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE CLOSE-MESSAGE TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 0 TO OSI-DATA-TOKEN.
MOVE 0 TO OSI-SYNC-MINOR-TOKEN.
MOVE 0 TO OSI-ACT-MAJOR-TOKEN.

COPY OSI-CLOSE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'CLOSE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE CLOSE CONFIRM *
* *
* *
*****************************************************************

1000-RECEIVE-CLRESP.

3787 3296-200 B-11


Session-level Entry Primary Program

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR UNBIND *
* *
* *
*****************************************************************

1100-UNBIND.

MOVE USER-ID TO OSI-USER-ID.

COPY OSI-UNBIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'UNBIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

MOVE 0 TO BOUND.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE 1 TO DONE.

*****************************************************************
* *
* TERMINATE PROGRAM *
* *
* *
*****************************************************************

1200-NORMAL-TERMINATION.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'NORMAL TERMINATION.'.

STOP RUN.

*****************************************************************
* *

B - 3
Session-level Entry Primary Program

* *
* SETUP PACKET FOR SYNC *
* *
* *
*****************************************************************

2000-SYNC-WITH-CONFIRM.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-SYNC-FUNC.
MOVE 0 TO OSI-SYNC-DATA-SEP.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.

COPY OSI-SYNC.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

2001-SYNC-END.

EXIT.

*****************************************************************
* *
* *
* SETUP PACKET FOR SEND *
* *
* *
*****************************************************************

3000-SEND-MSG.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 30 TO OSI-FLWCTL-WAIT.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.

COPY OSI-SEND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

3001-SEND-END.

EXIT.

3787 3296-200 B-13


Session-level Entry Primary Program

*****************************************************************
* *
* *
* SETUP PACKETS FOR RECEIVE *
* *
* *
*****************************************************************

4000-RECEIVE-MSG.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE SPACES TO INPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET, OSI-TEXT-START.
MOVE 1 TO OSI-DATA-RELEASE.
MOVE 300 TO OSI-RCV-WAIT-TIME.

COPY OSI-RECEIVE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

4001-RECEIVE-END.

EXIT.

*****************************************************************
* *
* *
* ABNORMAL TERMINATION *
* *
* *
*****************************************************************

9000-ABNORMAL-TERMINATION.

IF BOUND = 1 PERFORM 1100-UNBIND.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'ABNORMAL TERMINATION.'.
*
*
STOP RUN.

B-14 3787 3296-200


ACOB Session-level Entry Secondary Program Runstream

B.4. ACOB Session-level Entry Secondary Program


Runstream
@USE COB$PF,sys$lib$*ddp-ppc-3.
@USE src,sample*7r1programs.
@USE rel,sample*7r1programs.
@USE abs,sample*7r1programs.
@USE ppc-rel,sys$lib$*ddp-ppc-1.
@ACOB,ECS src.acobosi5sec,rel.acobosi5sec/7r1,,NR
@MAP,ES ,abs.acobosi5sec/7r1

TYPE EXTDIAG
NOT TPF$.
LIB (I$1/$ODD,D$2/$EVEN)
LIB sys$lib$*acob()
LIB ppc-rel()
IBANK,M I$1
FRSTIN rel.acobosi5sec/7r1
DBANK,UMC D$2
FRSTIN rel.acobosi5sec/7r1
END

3787 3296-200 B-15


UCOB Session-level Entry Secondary Program Runstream

B.5. UCOB Session-level Entry Secondary Program


Runstream
@use COB$PF,sys$lib$*ddp-ppc-3.
@use src,sample*7r1programs.
@use om,sample*7r1programs.
@use ppc-rel,sys$lib$*ddp-ppc-1.
@ucob,s src.ucobosi5sec,om.ucobosi5sec,,,compat,no-remark
@link,l ,om.ucobosi5sec/7r1
output zoom
include om.ucobosi5sec
include ppc-rel.osi-ucsif-om
resolve all references using lcn
@eof

B-16 3787 3296-200


Session-level Entry Secondary Program

B.6. Session-level Entry Secondary Program


IDENTIFICATION DIVISION.
PROGRAM-ID. DDP-UCOB-OSI-SECONDARY-PROGRAM.
INSTALLATION. UNISYS COMPUTER SYSTEMS, MALVERN, PA.
DATE-WRITTEN.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNIVAC-1100.
OBJECT-COMPUTER. UNIVAC-1100 MEMORY 3 MODULES.
*
/
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 LOCAL-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-2'.
*
01 DESTINATION-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-1'.
*
01 OSI-MSG-BUFFER.
02 OUTPUT-MESSAGE-FORMAT.
05 OUTPUT-MESSAGE-AREA PIC X(132).
02 INPUT-MESSAGE-FORMAT REDEFINES OUTPUT-MESSAGE-FORMAT.
05 INPUT-MESSAGE-AREA PIC X(132).
*
01 OPRESP-MESSAGE.
05 FILLER PIC X(50) VALUE
'THIS MESSAGE WAS SENT WITH THE OPEN RESPONSE AND '.
05 FILLER PIC X(41) VALUE
'WILL COMPLETE THE OPEN PROCESS AND'.
05 FILLER PIC X(28) VALUE
' ESTABLISH THE CONVERSATION.'.
*
01 SYNC-MESSAGE-1.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(51) VALUE
'AND CONFIRMS RECEIPT OF SYNC POINT SERIAL NUMBER 1.'.
*
01 SYNC-MESSAGE-2.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(51) VALUE
'AND CONFIRMS RECEIPT OF SYNC POINT SERIAL NUMBER 2.'.
*

01 CLRESP-MESSAGE.
05 FILLER PIC X(47) VALUE

3787 3296-200 B-17


Session-level Entry Secondary Program

'THIS MESSAGE WAS SENT WITH THE CLRESP FUNCTION '.


05 FILLER PIC X(24) VALUE
'ENDING THE CONVERSATION.'.
*
01 STATUS-VARIABLES.
02 AP-CLASS-CODE PIC 9(3).
02 AP-DETAIL-STATUS PIC 9(3).
02 AP-SPECIFIC-ERROR PIC 9(5).
02 DONE PIC 9(1) VALUE IS 0.
02 USER-ID PIC S9(11) SIGN IS LEADING.
02 USER-ID-NO-SIGN REDEFINES USER-ID.
03 FILLER PIC X(1).
03 USER-ID-NUM PIC 9(10).
02 CONNECTION-ID PIC S9(11) SIGN IS LEADING.
02 CONNECTION-ID-NO-SIGN REDEFINES CONNECTION-ID.
03 FILLER PIC X(1).
03 CONNECTION-ID-NUM PIC 9(10).
02 BOUND PIC 9(1) VALUE IS 0.
*
/
* INPUT AREAS
01 S-SELECTOR PIC X(16) VALUE ALL SPACES.
*
*
/
COPY OSI-PKT.
/
PROCEDURE DIVISION.

******************************************************************
* *
* BIND - AP NAME IS FIXED AT SAMPLE-PROGRAM-1 *
* *
* *
******************************************************************

0100-BIND-ROUTINE.

DISPLAY
'ENTER THE S-SELECTOR NAME (FROM CS-DATA BASE S-SELECTOR).'.

ACCEPT S-SELECTOR.

INSPECT S-SELECTOR REPLACING CHARACTERS BY ' ' AFTER


INITIAL SPACE.

MOVE S-SELECTOR TO OSI-INT-AP-NAME.

COPY OSI-BIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'BIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',

B-18 3787 3296-200


Session-level Entry Secondary Program

AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',


AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE OSI-USER-ID TO USER-ID.


DISPLAY 'USER ID IS ' USER-ID-NUM.
MOVE 1 TO BOUND.

******************************************************************
* *
* *
* RECEIVE-NEW *
* *
* *
******************************************************************

*
0200-RECEIVE-NEW.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 1 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE-NEW CLASS IS ', AP-CLASS-CODE, ' STATUS IS '


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.


MOVE OSI-CONNECTION TO CONNECTION-ID.
DISPLAY 'CONNECTION ID IS ' CONNECTION-ID-NUM.
DISPLAY INPUT-MESSAGE-AREA.

******************************************************************
* *
* *
* SETUP PACKETS FOR OPRESP *
* *
* *
******************************************************************

0300-OPRESP.

* SETUP DATA PACKET.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE OPRESP-MESSAGE TO OUTPUT-MESSAGE-AREA.
MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.

* SETUP CONNECT PACKET.

3787 3296-200 B-19


Session-level Entry Secondary Program

MOVE 0 TO OSI-SESSION-RESULT.
MOVE 0 TO OSI-SESSION-VERSION-1.
MOVE 1 TO OSI-SESSION-VERSION-2.
MOVE 0 TO FUNC-UNIT-TYPED-DATA.
MOVE 0 TO FUNC-UNIT-EXCEPTIONS.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 0 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.
MOVE 0 TO SCI-CALLED-REFERENCE-LEN.
MOVE 0 TO SCI-COMMON-REFERENCE-LEN.
MOVE 0 TO SCI-ADDITIONAL-REFERENCE-LEN.

* SETUP ADDRESS PACKET.

MOVE SPACES TO OSI-RESPONDING-AE-TITLE-ALIAS.

COPY OSI-OPRESP.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'OPEN CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

******************************************************************
* *
* *
* RECEIVE 1ST SYNC *
* *
* *
******************************************************************

*
0400-RECEIVE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

B-20 3787 3296-200


Session-level Entry Secondary Program

*****************************************************************
* *
* *
* CONFIRM 1ST SYNC *
* *
* *
*****************************************************************

0410-SYNC-1.

MOVE SYNC-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE 1ST MESSAGE *
* *
* *
*****************************************************************

0500-RECEIVE-1.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

******************************************************************
* *
* *
* RECEIVE LAST MESSAGE *
* *
* *
******************************************************************

*
0510-RECEIVE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

3787 3296-200 B-21


Session-level Entry Secondary Program

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* RECEIVE 2ND SYNC *
* *
* *
*****************************************************************

0520-RECEIVE-SYNC-2.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* CONFIRM 2ND SYNC *
* *
* *
*****************************************************************

0530-SYNC-MSG-2.

MOVE SYNC-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE CLOSE MESSAGE *
* *

B - 3
Session-level Entry Secondary Program

* *
*****************************************************************

0600-RECEIVE-CLOSE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR CLRESP *
* *
* *
*****************************************************************

0900-CLRESP.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE CLRESP-MESSAGE TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.

COPY OSI-CLRESP.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'CLRESP CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SETUP FOR UNBIND *
* *
* *
*****************************************************************

3787 3296-200 B-23


Session-level Entry Secondary Program

1100-UNBIND.

MOVE USER-ID TO OSI-USER-ID.

COPY OSI-UNBIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'UNBIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

MOVE 0 TO BOUND.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE 1 TO DONE.

*****************************************************************
* *
* TERMINATE PROGRAM *
* *
* *
*****************************************************************

1200-NORMAL-TERMINATION.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'NORMAL TERMINATION.'.

STOP RUN.

*****************************************************************
* *
* *
* SETUP PACKET FOR SYNC *
* *
* *
*****************************************************************

2000-SYNC-WITH-CONFIRM.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.

MOVE 2 TO OSI-SYNC-FUNC.
MOVE 0 TO OSI-SYNC-DATA-SEP.

COPY OSI-SYNC.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.

B-24 3787 3296-200


Session-level Entry Secondary Program

MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

2001-SYNC-END.
EXIT.

*****************************************************************
* *
* *
* SETUP PACKETS FOR RECEIVE *
* *
* *
*****************************************************************

4000-RECEIVE-MSG.

MOVE USER-ID TO OSI-USER-ID.


IF OSI-MODE = 0
MOVE CONNECTION-ID TO OSI-CONNECTION.
IF OSI-MODE = 1
MOVE 5 TO OSI-SERVICE-ENTRY.

MOVE SPACES TO INPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET, OSI-TEXT-START.
MOVE 1 TO OSI-DATA-RELEASE.
MOVE 300 TO OSI-RCV-WAIT-TIME.

COPY OSI-RECEIVE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

4001-RECEIVE-END.
EXIT.

*****************************************************************
* *
* *
* ABNORMAL TERMINATION *
* *
* *
*****************************************************************

9000-ABNORMAL-TERMINATION.

IF BOUND = 1 PERFORM 1100-UNBIND.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'ABNORMAL TERMINATION.'.
*
*
STOP RUN.

3787 3296-200 B-25


ACOB Application-level Entry Primary Program Runstream

B.7. ACOB Application-level Entry Primary


Program Runstream
@USE COB$PF,sys$lib$*ddp-ppc-3.
@USE src,sample*7r1programs.
@USE rel,sample*7r1programs.
@USE abs,sample*7r1programs.
@USE ppc-rel,sys$lib$*ddp-ppc-1.
@ACOB,ECS src.acobosi7pri,rel.acobosi7pri/7r1,,NR
@MAP,ES ,abs.acobosi7pri/7r1

TYPE EXTDIAG
NOT TPF$.
LIB (I$1/$ODD,D$2/$EVEN)
LIB sys$lib$*acob()
LIB ppc-rel()
IBANK,M I$1
FRSTIN rel.acobosi7pri/7r1
DBANK,UMC D$2
FRSTIN rel.acobosi7pri/7r1
END

B-26 3787 3296-200


UCOB Application-level Entry Primary Program Runstream

B.8. UCOB Application-level Entry Primary


Program Runstream
@use COB$PF,sys$lib$*ddp-ppc-3.
@use src,sample*7r1programs.
@use om,sample*7r1programs.
@use ppc-rel,sys$lib$*ddp-ppc-1.
@ucob,s src.ucobosi7pri,om.ucobosi7pri,,,compat,no-remark
@link,s ,om.ucobosi7pri/7r1
output zoom
include om.ucobosi7pri
include ppc-rel.osi-ucsif-om
resolve all references using lcn
@eof

3787 3296-200 B-27


Application-level Entry Primary Program

B.9. Application-level Entry Primary Program


IDENTIFICATION DIVISION.
PROGRAM-ID. DDP-UCOB-OSI-APPL-PRI-PROGRAM.
INSTALLATION. UNISYS COMPUTER SYSTEMS, MALVERN, PA.
DATE-WRITTEN.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-1100.
OBJECT-COMPUTER. UNISYS-1100.
*
/
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 LOCAL-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-1'.
*
01 DESTINATION-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-2'.
*
01 OSI-MSG-BUFFER.
02 OUTPUT-MESSAGE-FORMAT.
05 OUTPUT-MESSAGE-AREA PIC X(132).
02 INPUT-MESSAGE-FORMAT REDEFINES OUTPUT-MESSAGE-FORMAT.
05 INPUT-MESSAGE-AREA PIC X(132).
*
01 OPEN-MESSAGE.
05 FILLER PIC X(49) VALUE
'THIS MESSAGE WAS SENT WITH AN OPEN REQUEST, YOUR '.
05 FILLER PIC X(51) VALUE
'OPRESP WILL COMPLETE THE OPEN PROCESS AND ESTABLISH'.
05 FILLER PIC X(16) VALUE
' A CONVERSATION.'.
*
01 SYNC-MESSAGE-1.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE IS SENT WITH THE SYNC FUNCTION. '.
05 FILLER PIC X(48) VALUE
'THE SYNC POINT SERIAL IS SET TO 1 AND A CONFIRM '.
05 FILLER PIC X(12) VALUE
'IS REQUIRED.'.

01 SEND-MESSAGE-1.
05 FILLER PIC X(51) VALUE
'THIS WAS THE 1ST MESSAGE SENT WITH A SEND FUNCTION '.
05 FILLER PIC X(21) VALUE 'IN THIS CONVERSATION.'.
*
01 SEND-MESSAGE-2.

B-28 3787 3296-200


Application-level Entry Primary Program

05 FILLER PIC X(54) VALUE


'THIS WAS THE LAST MESSAGE SENT BY THE CALLING PROGRAM '.
05 FILLER PIC X(25) VALUE 'USING THE SEND FUNCTION.'.
*
01 SYNC-MESSAGE-2.
05 FILLER PIC X(53) VALUE
'THIS MESSAGE WAS THE 2ND SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(48) VALUE
'THE SYNC POINT SERIAL NUMBER IS SET TO 2 AND'.
05 FILLER PIC X(23) VALUE ' A CONFIRM IS REQUIRED.'.
*
01 CLOSE-MESSAGE.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH A CLOSE FUNCTION, '.
05 FILLER PIC X(47) VALUE
'YOUR RESPONSE WILL COMPLETE THE CLOSE PROCESS'.
05 FILLER PIC X(32) VALUE
' AND TERMINATE THE CONVERSATION.'.
*
01 STATUS-VARIABLES.
02 AP-CLASS-CODE PIC 9(3).
02 AP-DETAIL-STATUS PIC 9(3).
02 AP-SPECIFIC-ERROR PIC 9(6).
02 DONE PIC 9(1) VALUE IS 0.
02 USER-ID PIC S9(11) SIGN IS LEADING.
02 USER-ID-NO-SIGN REDEFINES USER-ID.
03 FILLER PIC X(1).
03 USER-ID-NUM PIC 9(10).
02 CONNECTION-ID PIC S9(11) SIGN IS LEADING.
02 CONNECTION-ID-NO-SIGN REDEFINES CONNECTION-ID.
03 FILLER PIC X(1).
03 CONNECTION-ID-NUM PIC 9(10).
02 BOUND PIC 9(1) VALUE IS 0.
*
/
* INPUT AREAS
01 AE-ALIAS PIC X(16) VALUE ALL SPACES.
*
*

/
COPY OSI-PKT.
/
PROCEDURE DIVISION.

******************************************************************
* *
* BIND - AP NAME IS FIXED AT SAMPLE-PROGRAM-1 *
* *
* *
******************************************************************

0100-BIND-ROUTINE.

MOVE LOCAL-PROGRAM-NAME TO OSI-INT-AP-NAME.

COPY OSI-BIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.

3787 3296-200 B-29


Application-level Entry Primary Program

MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'BIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',
AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE OSI-USER-ID TO USER-ID.


DISPLAY 'USER ID IS ' USER-ID-NUM.
MOVE 1 TO BOUND.

******************************************************************
* *
* *
* SETUP PACKETS TO OPEN CONVERSATION *
* *
* *
******************************************************************

0200-OPEN-CONVERSATION.

MOVE USER-ID TO OSI-USER-ID.

* SETUP DATA PACKET.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE OPEN-MESSAGE TO OUTPUT-MESSAGE-AREA.
MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.
MOVE 140 TO OSI-DATA-TYPE.

* SETUP CONNECT PACKET.

MOVE 7 TO OSI-SERVICE-ENTRY.
MOVE 1 TO OSI-SESSION-VERSION-1.
MOVE 1 TO OSI-SESSION-VERSION-2.
MOVE 0 TO FUNC-UNIT-TYPED-DATA.
MOVE 0 TO FUNC-UNIT-EXCEPTIONS.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 0 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.
MOVE 0 TO SCI-CALLING-REFERENCE-LEN.
MOVE 0 TO SCI-COMMON-REFERENCE-LEN.
MOVE 0 TO SCI-ADDITIONAL-REFERENCE-LEN.

* SETUP APPLICATION PACKET

MOVE 0 TO OSI-PRES-MODE.
MOVE 0 TO OSI-CALLED-P-INVOC-ID-LEN.

B-30 3787 3296-200


Application-level Entry Primary Program

MOVE 0 TO OSI-CALLED-E-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLING-P-INVOC-ID-LEN.
MOVE 0 TO OSI-CALLING-E-INVOC-ID-LEN.
MOVE 2 TO OSI-PRES-CONTEXT-TABLE-ENTRIES.
MOVE 1 TO OSI-PRES-CONTEXT-IDENT(1).
MOVE 'ACSE-AS ' TO
OSI-ABSTRACT-SYNTAX-ALIAS(1).
MOVE 'ASN1-TS ' TO
OSI-TRANSFER-SYNTAX-ALIAS(1).

MOVE 3 TO OSI-PRES-CONTEXT-IDENT(2).
MOVE 'OIW-OCTET-AS ' TO
OSI-ABSTRACT-SYNTAX-ALIAS(2).
MOVE 'ASN1-TS ' TO
OSI-TRANSFER-SYNTAX-ALIAS(2).

MOVE 'GENERAL-CONTEXT ' TO OSI-APPL-CONTEXT-NAME-ALIAS.

* SETUP ADDRESS PACKET.

DISPLAY 'ENTER CALLED AE-ALIAS.'.

ACCEPT AE-ALIAS.
INSPECT AE-ALIAS REPLACING CHARACTERS BY ' ' AFTER
INITIAL SPACE.
MOVE AE-ALIAS TO OSI-CALLED-AE-TITLE-ALIAS.

DISPLAY 'ENTER CALLING AE-ALIAS.'.

ACCEPT AE-ALIAS.
INSPECT AE-ALIAS REPLACING CHARACTERS BY ' ' AFTER
INITIAL SPACE.
MOVE AE-ALIAS TO OSI-CALLING-AE-TITLE-ALIAS.

COPY OSI-OPEN.

MOVE OSI-CONNECTION TO CONNECTION-ID.


MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.
MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'OPEN CLASS IS ',


AP-CLASS-CODE, ' STATUS IS ',
AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.


DISPLAY 'CONNECTION ID IS ' CONNECTION-ID-NUM.

******************************************************************
* *
* *
* RECEIVE OPEN RESPONSE FROM SAMPLE-PROGRAM-2 *
* *
* *
******************************************************************

*
0300-RECEIVE-OPEN-RESPONSE.

3787 3296-200 B-31


Application-level Entry Primary Program

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

IF NOT OSI-AU-ASSOC-ACCEPTED
DISPLAY 'PEER REFUSED OPEN REQUEST DUE TO REASON ',
OSI-APPL-PRES-RESULT
GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SYNC WITH CONFIRM REQUESTED *
* *
* *
*****************************************************************

0400-SYNC-1.

MOVE SYNC-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE SYNC CONFIRM *
* *
* *
*****************************************************************

0500-RECEIVE-SYNC-1-CONFIRM.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

B-32 3787 3296-200


Application-level Entry Primary Program

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SEND 1ST MESSAGE *
* *
* *
*****************************************************************

0600-SEND-MSG-1.

MOVE SEND-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 3000-SEND-MSG.

DISPLAY 'SEND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SEND LAST MESSAGE *
* *
* *
*****************************************************************

0700-SEND-MSG-2.

MOVE SEND-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 3000-SEND-MSG.

DISPLAY 'SEND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SYNC WITH CONFIRM REQUESTED *
* *
* *
*****************************************************************

0800-SYNC-2.

MOVE SYNC-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.

3787 3296-200 B-33


Application-level Entry Primary Program

MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE SYNC CONFIRM *
* *
* *
*****************************************************************

0810-RECEIVE-SYNC-2-CONFIRM.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR CLOSE *
* *
* *
*****************************************************************

0900-CLOSE.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE CLOSE-MESSAGE TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 0 TO OSI-DATA-TOKEN.
MOVE 0 TO OSI-SYNC-MINOR-TOKEN.
MOVE 0 TO OSI-ACT-MAJOR-TOKEN.
MOVE 140 TO OSI-DATA-TYPE.

COPY OSI-CLOSE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

B-34 3787 3296-200


Application-level Entry Primary Program

DISPLAY 'CLOSE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE CLOSE CONFIRM *
* *
* *
*****************************************************************

1000-RECEIVE-CLRESP.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR UNBIND *
* *
* *
*****************************************************************

1100-UNBIND.

MOVE USER-ID TO OSI-USER-ID.

COPY OSI-UNBIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'UNBIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

MOVE 0 TO BOUND.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE 1 TO DONE.

3787 3296-200 B-35


Application-level Entry Primary Program

*****************************************************************
* *
* TERMINATE PROGRAM *
* *
* *
*****************************************************************

1200-NORMAL-TERMINATION.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'NORMAL TERMINATION.'.

STOP RUN.

*****************************************************************
* *
* *
* SETUP PACKET FOR SYNC *
* *
* *
*****************************************************************

2000-SYNC-WITH-CONFIRM.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-SYNC-FUNC.
MOVE 0 TO OSI-SYNC-DATA-SEP.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.
MOVE 140 TO OSI-DATA-TYPE.

COPY OSI-SYNC.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

2001-SYNC-END.

EXIT.

*****************************************************************
* *
* *
* SETUP PACKET FOR SEND *
* *
* *
*****************************************************************

3000-SEND-MSG.

MOVE USER-ID TO OSI-USER-ID.

B-36 3787 3296-200


Application-level Entry Primary Program

MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 30 TO OSI-FLWCTL-WAIT.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 140 TO OSI-DATA-TYPE.

COPY OSI-SEND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

3001-SEND-END.

EXIT.

*****************************************************************
* *
* *
* SETUP PACKETS FOR RECEIVE *
* *
* *
*****************************************************************

4000-RECEIVE-MSG.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE SPACES TO INPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET, OSI-TEXT-START.
MOVE 1 TO OSI-DATA-RELEASE.
MOVE 300 TO OSI-RCV-WAIT-TIME.

COPY OSI-RECEIVE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

4001-RECEIVE-END.

EXIT.

*****************************************************************
* *
* *
* ABNORMAL TERMINATION *
* *
* *
*****************************************************************

9000-ABNORMAL-TERMINATION.

IF BOUND = 1 PERFORM 1100-UNBIND.

3787 3296-200 B-37


Application-level Entry Primary Program

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'ABNORMAL TERMINATION.'.
*
*
STOP RUN.

B-38 3787 3296-200


ACOB Application-level Entry Secondary Program Runstream

B.10. ACOB Application-level Entry Secondary


Program Runstream
@USE COB$PF,sys$lib$*ddp-ppc-3.
@USE src,sample*7r1programs.
@USE rel,sample*7r1programs.
@USE abs,sample*7r1programs.
@USE ppc-rel,sys$lib$*ddp-ppc-1.
@ACOB,ECS src.acobosi7sec,rel.acobosi7sec/7r1,,NR
@MAP,ES ,abs.acobosi7sec/7r1

TYPE EXTDIAG
NOT TPF$.
LIB (I$1/$ODD,D$2/$EVEN)
LIB sys$lib$*acob()
LIB ppc-rel()
IBANK,M I$1
FRSTIN rel.acobosi7sec/7r1
DBANK,UMC D$2
FRSTIN rel.acobosi7sec/7r1
END

3787 3296-200 B-39


UCOB Application-level Entry Secondary Program Runstream

B.11. UCOB Application-level Entry Secondary


Program Runstream
@use COB$PF,sys$lib$*ddp-ppc-3.
@use src,sample*7r1programs.
@use om,sample*7r1programs.
@use ppc-rel,sys$lib$*ddp-ppc-1.
@ucob,s src.ucobosi7sec,om.ucobosi7sec,,,compat,no-remark
@link,l ,om.ucobosi7sec/7r1
output zoom
include om.ucobosi7sec
include ppc-rel.osi-ucsif-om
resolve all references using lcn
@eof

B-40 3787 3296-200


Application-level Entry Secondary Program

B.12. Application-level Entry Secondary Program


IDENTIFICATION DIVISION.
PROGRAM-ID. DDP-UCOB-OSI-APPL-SEC-PROGRAM.
INSTALLATION. UNISYS COMPUTER SYSTEMS, MALVERN, PA.
DATE-WRITTEN.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNISYS-2200.
OBJECT-COMPUTER. UNISYS-2200.
*
/
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 LOCAL-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-2'.
*
01 DESTINATION-PROGRAM-NAME PIC X(16) VALUE
'SAMPLE-PROGRAM-1'.
*
01 OSI-MSG-BUFFER.
02 OUTPUT-MESSAGE-FORMAT.
05 OUTPUT-MESSAGE-AREA PIC X(132).
02 INPUT-MESSAGE-FORMAT REDEFINES OUTPUT-MESSAGE-FORMAT.
05 INPUT-MESSAGE-AREA PIC X(132).
*
01 OPRESP-MESSAGE.
05 FILLER PIC X(50) VALUE
'THIS MESSAGE WAS SENT WITH THE OPEN RESPONSE AND '.
05 FILLER PIC X(41) VALUE
'WILL COMPLETE THE OPEN PROCESS AND'.
05 FILLER PIC X(28) VALUE
' ESTABLISH THE CONVERSATION.'.
*
01 SYNC-MESSAGE-1.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(51) VALUE
'AND CONFIRMS RECEIPT OF SYNC POINT SERIAL NUMBER 1.'.
*
01 SYNC-MESSAGE-2.
05 FILLER PIC X(45) VALUE
'THIS MESSAGE WAS SENT WITH THE SYNC FUNCTION '.
05 FILLER PIC X(51) VALUE
'AND CONFIRMS RECEIPT OF SYNC POINT SERIAL NUMBER 2.'.
*

01 CLRESP-MESSAGE.
05 FILLER PIC X(47) VALUE

3787 3296-200 B-41


Application-level Entry Secondary Program

'THIS MESSAGE WAS SENT WITH THE CLRESP FUNCTION '.


05 FILLER PIC X(24) VALUE
'ENDING THE CONVERSATION.'.
*
01 STATUS-VARIABLES.
02 AP-CLASS-CODE PIC 9(3).
02 AP-DETAIL-STATUS PIC 9(3).
02 AP-SPECIFIC-ERROR PIC 9(5).
02 DONE PIC 9(1) VALUE IS 0.
02 USER-ID PIC S9(11) SIGN IS LEADING.
02 USER-ID-NO-SIGN REDEFINES USER-ID.
03 FILLER PIC X(1).
03 USER-ID-NUM PIC 9(10).
02 CONNECTION-ID PIC S9(11) SIGN IS LEADING.
02 CONNECTION-ID-NO-SIGN REDEFINES CONNECTION-ID.
03 FILLER PIC X(1).
03 CONNECTION-ID-NUM PIC 9(10).
02 BOUND PIC 9(1) VALUE IS 0.
*
/
* INPUT AREAS
01 S-SELECTOR PIC X(16) VALUE ALL SPACES.
*
*
/
COPY OSI-PKT.
/
PROCEDURE DIVISION.

******************************************************************
* *
* BIND - AP NAME IS FIXED AT SAMPLE-PROGRAM-1 *
* *
* *
******************************************************************

0100-BIND-ROUTINE.

DISPLAY
'ENTER THE S-SELECTOR NAME (FROM CS-DATA BASE S-SELECTOR).'.

ACCEPT S-SELECTOR.

INSPECT S-SELECTOR REPLACING CHARACTERS BY ' ' AFTER


INITIAL SPACE.

MOVE S-SELECTOR TO OSI-INT-AP-NAME.

COPY OSI-BIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'BIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',
AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',

B-42 3787 3296-200


Application-level Entry Secondary Program

AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE OSI-USER-ID TO USER-ID.


DISPLAY 'USER ID IS ' USER-ID-NUM.
MOVE 1 TO BOUND.

******************************************************************
* *
* *
* RECEIVE-NEW *
* *
* *
******************************************************************

*
0200-RECEIVE-NEW.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 1 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE-NEW CLASS IS ', AP-CLASS-CODE, ' STATUS IS '


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.


MOVE OSI-CONNECTION TO CONNECTION-ID.
DISPLAY 'CONNECTION ID IS ' CONNECTION-ID-NUM.
DISPLAY INPUT-MESSAGE-AREA.

******************************************************************
* *
* *
* SETUP PACKETS FOR OPRESP *
* *
* *
******************************************************************

0300-OPRESP.

* SETUP DATA PACKET.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE OPRESP-MESSAGE TO OUTPUT-MESSAGE-AREA.
MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 0 TO OSI-SYNC-POINT-SERIAL-NUMBER.
MOVE 140 TO OSI-DATA-TYPE.

* SETUP CONNECT PACKET.

3787 3296-200 B-43


Application-level Entry Secondary Program

MOVE 0 TO OSI-SESSION-RESULT.
MOVE 0 TO OSI-SESSION-VERSION-1.
MOVE 1 TO OSI-SESSION-VERSION-2.
MOVE 0 TO FUNC-UNIT-TYPED-DATA.
MOVE 0 TO FUNC-UNIT-EXCEPTIONS.
MOVE 0 TO FUNC-UNIT-CAP-DATA.
MOVE 0 TO FUNC-UNIT-ACT-MGT.
MOVE 0 TO FUNC-UNIT-RESYNC.
MOVE 1 TO FUNC-UNIT-MINOR-SYNC.
MOVE 0 TO FUNC-UNIT-DUPLEX.
MOVE 1 TO FUNC-UNIT-HALF-DUPLEX.
MOVE 0 TO FUNC-UNIT-DATA-SEP.
MOVE 0 TO SCI-CALLED-REFERENCE-LEN.
MOVE 0 TO SCI-COMMON-REFERENCE-LEN.
MOVE 0 TO SCI-ADDITIONAL-REFERENCE-LEN.

* SETUP APPLICATION PACKET

IF NOT OSI-PU-CONTEXT-ACCEPTED(1)
OR
NOT OSI-PU-CONTEXT-ACCEPTED(2)

DISPLAY 'PRESENTATION CONTEXT REJECTED BY DDP-PPC.'

GO TO 9000-ABNORMAL-TERMINATION.

MOVE 0 TO OSI-CONTEXT-INDICATOR(1).
MOVE 0 TO OSI-CONTEXT-INDICATOR(2).

* SETUP ADDRESS PACKET

MOVE SPACES TO OSI-RESPONDING-AE-TITLE-ALIAS.

COPY OSI-OPRESP.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'OPEN CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

******************************************************************
* *
* *
* RECEIVE 1ST SYNC *
* *
* *
******************************************************************

*
0400-RECEIVE.

B-44 3787 3296-200


Application-level Entry Secondary Program

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* CONFIRM 1ST SYNC *
* *
* *
*****************************************************************

0410-SYNC-1.

MOVE SYNC-MESSAGE-1 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE 1ST MESSAGE *
* *
* *
*****************************************************************

0500-RECEIVE-1.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

******************************************************************
* *

3787 3296-200 B-45


Application-level Entry Secondary Program

* *
* RECEIVE LAST MESSAGE *
* *
* *
******************************************************************

*
0510-RECEIVE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* RECEIVE 2ND SYNC *
* *
* *
*****************************************************************

0520-RECEIVE-SYNC-2.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* CONFIRM 2ND SYNC *
* *
* *
*****************************************************************

0530-SYNC-MSG-2.

MOVE SYNC-MESSAGE-2 TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.

PERFORM 2000-SYNC-WITH-CONFIRM.

B-46 3787 3296-200


Application-level Entry Secondary Program

DISPLAY 'SYNC CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* RECEIVE CLOSE MESSAGE *
* *
* *
*****************************************************************

0600-RECEIVE-CLOSE.

MOVE ALL SPACES TO INPUT-MESSAGE-AREA.


MOVE 0 TO OSI-MODE.

PERFORM 4000-RECEIVE-MSG.

DISPLAY 'RECEIVE CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

DISPLAY INPUT-MESSAGE-AREA.

*****************************************************************
* *
* *
* SETUP FOR CLRESP *
* *
* *
*****************************************************************

0900-CLRESP.

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE CLRESP-MESSAGE TO OUTPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 140 TO OSI-DATA-TYPE.

COPY OSI-CLRESP.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

3787 3296-200 B-47


Application-level Entry Secondary Program

DISPLAY 'CLRESP CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

*****************************************************************
* *
* *
* SETUP FOR UNBIND *
* *
* *
*****************************************************************

1100-UNBIND.

MOVE USER-ID TO OSI-USER-ID.

COPY OSI-UNBIND.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

DISPLAY 'UNBIND CLASS IS ', AP-CLASS-CODE, ' STATUS IS ',


AP-DETAIL-STATUS, ' SPECIFIC ERROR IS ',
AP-SPECIFIC-ERROR, '.'.

MOVE 0 TO BOUND.

IF NOT OSI-OK GO TO 9000-ABNORMAL-TERMINATION.

MOVE 1 TO DONE.

*****************************************************************
* *
* TERMINATE PROGRAM *
* *
* *
*****************************************************************

1200-NORMAL-TERMINATION.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'NORMAL TERMINATION.'.

STOP RUN.

*****************************************************************
* *
* *
* SETUP PACKET FOR SYNC *
* *
* *
*****************************************************************

2000-SYNC-WITH-CONFIRM.

B-48 3787 3296-200


Application-level Entry Secondary Program

MOVE USER-ID TO OSI-USER-ID.


MOVE CONNECTION-ID TO OSI-CONNECTION.

MOVE 0 TO OSI-BUFFER-OFFSET.
MOVE 1 TO OSI-UNIT-INDICATOR.
MOVE 0 TO OSI-DATA-TOKEN, OSI-SYNC-MINOR-TOKEN,
OSI-ACT-MAJOR-TOKEN.
MOVE 140 TO OSI-DATA-TYPE.

MOVE 2 TO OSI-SYNC-FUNC.
MOVE 0 TO OSI-SYNC-DATA-SEP.

COPY OSI-SYNC.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

2001-SYNC-END.
EXIT.

*****************************************************************
* *
* *
* SETUP PACKETS FOR RECEIVE *
* *
* *
*****************************************************************

4000-RECEIVE-MSG.

MOVE USER-ID TO OSI-USER-ID.


IF OSI-MODE = 0
MOVE CONNECTION-ID TO OSI-CONNECTION.
IF OSI-MODE = 1
MOVE 7 TO OSI-SERVICE-ENTRY.

MOVE SPACES TO INPUT-MESSAGE-AREA.


MOVE 132 TO OSI-TEXT-LENGTH.
MOVE 0 TO OSI-BUFFER-OFFSET, OSI-TEXT-START.
MOVE 1 TO OSI-DATA-RELEASE.
MOVE 300 TO OSI-RCV-WAIT-TIME.

COPY OSI-RECEIVE.

MOVE OSI-CLASS-CODE TO AP-CLASS-CODE.


MOVE OSI-DETAIL-STATUS TO AP-DETAIL-STATUS.
MOVE OSI-SPECIFIC-ERROR TO AP-SPECIFIC-ERROR.

4001-RECEIVE-END.
EXIT.

*****************************************************************
* *
* *
* ABNORMAL TERMINATION *
* *
* *
*****************************************************************

3787 3296-200 B-49


Application-level Entry Secondary Program

9000-ABNORMAL-TERMINATION.

IF BOUND = 1 PERFORM 1100-UNBIND.

DISPLAY LOCAL-PROGRAM-NAME.
DISPLAY 'ABNORMAL TERMINATION.'.
*
*
STOP RUN.

B-50 3787 3296-200


Appendix C
DDP-PPC/OSI and ISO/OSI
Cross-Reference

Table C-1 and Table C-2 show the relationship between the DDP-PPC COBOL functions
and the ISO/OSI services that are invoked. Table C-3 shows the relationship between the
OSI parameters and the DDP-PPC COBOL fields.

Table C-1. Relationship between DDP-PPC and OSI Services

DDP-PPC Function OSI Application Interface OSI Session Interface

OSI$BIND, OSI$UNBIND None None

OSI$OPEN A_ASSOCIATE request S_CONNECT request

OSI$SEND None S_DATA

OSI$OPRESP A_ASSOCIATE response S_CONNECT response

OSI$CPDATA None S_CAPABILITY_DATA

OSI$CPRESP None S_CAPABILITY_DATA

OSI$TPDATA None S_TYPEDDATA

OSI$CLRESP A_RELEASE response S_RELEASE response

OSI$PLTOKEN None S_TOKEN_PLEASE

OSI$GVTOKEN None S_TOKEN_GIVE

OSI$GVCNTRL None S_CONTROL_GIVE

OSI$RECEIVE None None

OSI$CLOSE A_RELEASE request S_RELEASE request

OSI$ABORT A_ABORT S_U_ABORT

OSI$ACTMGT None S_ACTIVITY_START


None S_ACTIVITY_RESUME
None S_ACTIVITY_INTERRUPT
None S_ACTIVITY_DISCARD
None S_ACTIVITY_END

OSI$SYNC None S_SYNC_MINOR

continued

3787 3296-200 C-1


DDP-PPC/OSI and ISO/OSI Cross-Reference

Table C-1. Relationship between DDP-PPC and OSI Services (cont.)

DDP-PPC Function OSI Application Interface OSI Session Interface

OSI$RESYNC None S_RESYNCHRONIZE

OSI$XRPT None S_U_EXCEPTION-REPORT

Table C-2. Relationship between OSI Services and DDP-PPC

OSI Application OSI Session Interface DDP-PPC Function


Service

A_ASSOCIATE S_CONNECT request OSI$OPEN


OSI$OPRESP

A_RELEASE S_RELEASE OSI$CLOSE


OSI$CLRESP

A_ABORT S_U_ABORT OSI$ABORT


S_DATA OSI$SEND
S_TYPEDDATA OSI$TPDATA
S_TOKEN_GIVE OSI$GVTOKEN
S_TOKEN_PLEASE OSI$PLTOKEN
S_SYNC_MINOR OSI$SYNC
S_RESYNCHRONIZE OSI$RESYNC
S_ACTIVITY_START OSI$ACTMGT
S_ACTIVITY_RESUME OSI$ACTMGT
S_ACTIVITY_INTERRUPT OSI$ACTMGT
S_ACTIVITY_DISCARD OSI$ACTMGT
S_ACTIVITY_END OSI$ACTMGT
S_U_EXCEPTION-REPORT OSI$XRPT
S_U_CAPABILITY_DATA OSI$CPDATA
OSI$CPRESP

Table C-3. Relationship between OSI Parameters and DDP-PPC COBOL Fields

OSI Parameter DDP-PPC COBOL Field

Activity Identifier OSI-ACT-ID (AC)

Application Context Name OSI-APPL-CONTEXT-NAME-ALIAS (AP)


OSI-APPL-CONTEXT-NAME (AP)

Called AE Invocation Id OSI-CALLED-E-INVOCATION-ID (AP)

Called AP Invocation Id OSI-CALLED-P-INVOCATION-ID (AP)

continued

C-2 3787 3296-200


DDP-PPC/OSI and ISO/OSI Cross-Reference

Table C-3. Relationship between OSI Parameters and DDP-PPC COBOL Fields (cont.)

OSI Parameter DDP-PPC COBOL Field

Calling AE Invocation Id OSI-CALLING-E-INVOCATION-ID (AP)

Calling AE Invocation Id OSI-CALLING-P-INVOCATION-ID (AP)

Called AE Qualifier OSI-CALLED-AE-QUALIFIER (AD)

Calling AE Qualifier OSI-CALLING-AE-QUALIFIER (AD)

Called AP Title OSI-CALLED-AE-TITLE-ALIAS(AD)


OSI-CALLED-AP-TITLE (AD)

Calling AP Title OSI-CALLING-AE-TITLE-ALIAS (AD)


OSI-CALLING-AP-TITLE (AD)

Called Presentation Address OSI-CALLED-P-SELECTOR (AD)


OSI-CALLED-S-SELECTOR (AD)
OSI-CALLED-T-SELECTOR (AD)
OSI-CALLED-NSAP (AD)

Calling Presentation Address OSI-CALLING-P-SELECTOR (AD)


OSI-CALLING-S-SELECTOR (AD)
OSI-CALLING-T-SELECTOR (AD)
OSI-CALLING-NSAP (AD)

Called Session Address OSI-CALLED-S-SELECTOR (AD)


OSI-CALLED-T-SELECTOR (AD)
OSI-CALLED-NSAP (AD)

Calling Session Address OSI-CALLING-S-SELECTOR (AD)


OSI-CALLING-T-SELECTOR (AD)
OSI-CALLING-NSAP (AD)

Data Separation OSI-SYNC-DATA-SEP (SY)

Diagnostic OSI-APPL-PRES-RESULT (AP)

Minor Synchronization Type 1 OSI-SYNC-FUNC (SY)

Old Activity Identifier OSI-OLD-ACT-ID (AC)

Old Session Connection Id OSI-OLD-AC-SESSION-CONNECTION-ID (AC)

Presentation Context Definition List OSI-PRESENTATION-CONTEXT-TABLE (AP)

Quality of Service OSI-QUALITY-OF-SERVICE (CO)

Reason 2 OSI-ACT-REASON (AC)

Reason 3 OSI-EXCEPTION-RSN (DA)

Responding AE Invocation Id OSI-RESPONDING-E-INVOCATION-ID (AP)

continued

3787 3296-200 C-3


DDP-PPC/OSI and ISO/OSI Cross-Reference

Table C-3. Relationship between OSI Parameters and DDP-PPC COBOL Fields (cont.)

OSI Parameter DDP-PPC COBOL Field

Responding AP Invocation Id OSI-RESPONDING-P-INVOCATION-ID (AP)

Responding AE Qualifier OSI-RESPONDING-AE-QUALIFIER (AD)

Responding AP Title OSI-RESPONDING-AP-TITLE-ALIAS (AD)


OSI-RESPONDING-AP-TITLE (AD)

Responding Presentation Address OSI-RESPONDING-P-SELECTOR (AD)


OSI-RESPONDING-S-SELECTOR (AD)
OSI-RESPONDING-T-SELECTOR (AD)
OSI-RESPONDING-NSAP (AD)

Responding Session Address OSI-RESPONDING-S-SELECTOR (AD)


OSI-RESPONDING-T-SELECTOR (AD)
OSI-RESPONDING-NSAP (AD)

Result ACSE OSI-APPL-PRES-RESULT-TYPE (AP)

Result Source OSI-APPL-PRES-RESULT (AP)

Resynchronize Type OSI-RESYNC-FUNC (RS)

Session Result OSI-SESSION-RESULT (CO)

Session Connection Id OSI-CN-SESSION-CONNECTION-ID (CO)

Session Requirements OSI-FUNC-UNITS-SELECTED (CO)

Sync Point Serial Number OSI-SYNC-POINT-SERIAL-NUMBER (DA)

Tokens OSI-DATA-TOKEN (DA)


OSI-SYNC-MINOR-TOKEN (DA)
OSI-ACT-MAJOR-TOKEN (DA)

1 Used by Minor Synchronization


2 Used by Activity Services
3 Used by Exception Report Services
(AC) Activity Packet
(AP) Application Presentation Packet
(CO) Connect Packet
(DA) Data Packet
(RS) Resynchronization Packet
(SY) Synchronization Packet

C-4 3787 3296-200


Bibliography

Distributed Communications Architecture (DCA) Level II Technical Overview


(UP-9676). Unisys Corporation.

Information processing systems - Open Systems Interconnection - Basic connection


oriented session service definition, ISO 8326.

Information processing systems - Open Systems Interconnection - Basic connection


oriented session protocol specification, ISO 8327.

Information processing systems - Open Systems Interconnection - Connection oriented


presentation protocol specification, ISO 8823.

Information processing systems - Open Systems Interconnection - Connection oriented


presentation service definition, ISO 8822.

Information processing systems - Open Systems Interconnection - Protocol specification


for the Association Control Service Element, ISO 8650.

Information processing systems - Open Systems Interconnection - Service definition for


the Association Control Service Element, ISO 8649.

Information technology - Open Systems Interconnection - Specification of Basic


Encoding Rules for Abstract Syntax Notation One (ASN.1), ISO 8825.

OS 1100 ASCII COBOL Programming Reference Manual (UP-8582). Unisys Corporation.

OS 1100/DCP Series Open Systems Communications Software Conceptual Overview


(7831 5835). Unisys Corporation.

OS 2200 Transaction Processing Administration and Operations Reference Manual


(7830 7881). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC) DCA Interface C Language


Programming Guide (3787 3254). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC) OSI Interface C Language


Programming Guide (3787 3288). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC) TCP/IP Interface C Language


Programming Guide (4173 5127). Unisys Corporation.

3787 3296-200 Bibliography-1


Bibliography

OS 2200 Distributed Data Processing (DDP-PPC) TCP/IP Interface COBOL


Programming Guide (3789 6651). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC) TCP/IP Interface FORTRAN


Programming Guide (3789 6669). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC/DDP-FJT) DCA Interface COBOL


Programming Guide (3787 3510). Unisys Corporation.

OS 2200 Distributed Data Processing (DDP-PPC/DDP-FJT) Messages Reference Manual


(3787 3528). Unisys Corporation.

OS 2200 Distributed Data Processing Program to Program Communications (DDP-PPC)


Implementation and Administration Guide (3787 3270). Unisys Corporation.

OS 2200 Universal Compiling System (UCS) COBOL Programming Reference Manual,


Volume 1: COBOL Statements (7831 0448). Unisys Corporation.

OS 2200 Universal Compiling System (UCS) COBOL Programming Reference Manual,


Volume 2: Compiler and Library Information (7831 0455). Unisys Corporation.

Bibliography-2 3787 3296-200

You might also like