You are on page 1of 10

Appendix A.

ICF Operations, DDS Keywords, and System-Supplied


Formats
Information in this appendix includes the following for APPC: Ÿ System-supplied formats
Ÿ All valid language operations supported by ICF
Ÿ Valid operations for each programming language that
Language Operations
supports ICF
Ÿ Data description specifications (DDS) processing Table A-1 describes the language operations supported by
keywords ICF.

Table A-1. Language Operations


ICF Operations Description
Open Opens the ICF file.
Acquire Establishes a session between the application and the remote location.
Get attributes Used to determine the status of the session.
Read Obtains data from a specific session.
Read-from-invited-program-devices Obtains data from any session that has responded to an invite function.
Write Passes data records from the issuing program to the other program in the transaction.
Write/Read Allows a write operation followed by a read operation.
Release Attempts to end a session.
Close Closes the ICF file.

Language Operations Supported


Use high-level language operations and ICF to communicate
with a program at a remote system. (See the specific high-
level language manual for the non-ICF operations.)

Table A-2 on page A-2 presents the ICF file operations used
with APPC communications and the equivalent high-level lan-
guage statement.

 Copyright IBM Corp. 1997 A-1


Table A-2. High-Level Language I/O Operations
ILE RPG/400 Opera- ILE COBOL/400 Pro- FORTRAN/400 State-
ICF Operation tion Code cedure Statement ILE C/400 Function1 ment
Open OPEN OPEN fopen or _Ropen OPEN
Acquire ACQ ACQUIRE _Racquire Not supported2
Get attributes POST ACCEPT _Rdevatr Not supported
Read READ READ fread or _Rreadn READ
Read-from-invited- READ3 READ3 _Rreadindv Not supported
program-devices
Write WRITE WRITE fwrite or _Rwrite WRITE
Write/Read EXFMT Not supported _Rwriterd Not supported
Release REL DROP _Rrelease Not supported
Close CLOSE CLOSE fclose or _Rclose CLOSE
Note:
1 ILE C/400 is case sensitive.
2 FORTRAN/400 does not support multiple sessions for one ICF file. Therefore, program device names are not used in a
FORTRAN/400 program. An implicit acquire must be used by specifying ACQPGMDEV (program device name) on the
CRTICFF, CHGICFF, or OVRICFF commands.
3 A read operation can be directed either to a specific program device or to any invited program device. The support pro-
vided by the compiler you are using determines whether to issue an ICF read or read-from-invited-program-devices opera-
tion, based on the format of the read operation. For example, if a read is issued with a specific format or program device
specified, the read operation is interpreted as an ICF read operation. Refer to the appropriate language reference manual
for more information.

Data Description Specifications Keywords Table A-3 (Page 1 of 2). DDS Keywords
DDS Keyword Description
Table A-3 lists the DDS keywords that are valid for APPC.
INVITE Schedules an invite function.

Table A-3 (Page 1 of 2). DDS Keywords PRPCMT Requests that the remote program prepare
to commit its protected resources.
DDS Keyword Description
RCVCONFIRM Indicates that the remote program is
ALWWRT The record currently being written ends a requesting a confirmation of transaction
transmission. The program goes to receive activity.
state.
RCVCTLDTA Informs the local program that control data
CONFIRM Requests that the remote program confirm has been received.
receipt of data.
RCVDETACH Indicates that the remote program has
CTLDTA Causes the data to be sent as control data. ended the transaction.
DETACH Informs the remote program that the RCVFAIL Indicates that the remote program has
sending program is ending the transaction. issued a fail indicator.
DFREVOKE Delays an evoke until one of the following RCVROLLB Indicates that the local program needs to
conditions is met. rollback its protected resources.
Ÿ The send buffer is full. RCVTKCMT Indicates that the local program needs to
Ÿ An ALWWRT, CONFIRM, DETACH, determine if it can commit its protected
FRCDTA, INVITE, PRPCMT, or READ resources.
function is issued. RCVTRNRND Indicates that the program is now in send
Ÿ A commit or rollback operation is done. state.

EOS Used to specify an end-of-session function. RECID Used to allow the data content to identify
the record format to use to receive the
EVOKE Starts a program on the remote system. data.
FAIL Sends a fail indicator to the remote system. RQSWRT Specifies that the program is requesting
FMTNAME Specifies that a format-name should be permission to write.
sent on output operations. RSPCONFIRM Used to respond positively to a received
FRCDTA Immediately sends communications data confirm request.
currently in the buffer without waiting for SECURITY Includes security information needed to
the buffer to become full. start a program on the remote system.

A-2 OS/400 APPC Programming V4R1


Table A-3 (Page 2 of 2). DDS Keywords System-Supplied Formats
DDS Keyword Description
Table A-4 lists all the keyword functions performed by the
SYNLVL Includes the synchronization level of the
program.
system-supplied formats that are valid for APPC. Refer to the
ICF Programming book for more information about system-
TIMER Allows the user to specify an interval of
supplied formats.
time to wait before a read-from-invited-
program-devices operation receives a
timer-expired return code. Table A-4. System-Supplied Formats
TNSSYNLVL Specifies that synchronization for this trans- System-Supplied Formats Description
action should be done at the level that the $$EOS End-of-session
SYNLVL keyword specified on the evoke. $$EVOK Evoke with invite
VARBUFMGT Allows the user to send or receive multiple $$EVOKET Evoke with detach
or partial records using one record format $$EVOKNI Evoke
for each read or write operation. $$FAIL Fail
$$RCD Request-write-with-invite
VARLEN Specifies that the length of the user data to
$$SEND Send-then-invite or invite
be sent will be specified in the 5 bytes of
$$SENDET Send-then-detach or detach
the field specified.
$$SENDNI Send
$$TIMER Timer

Appendix A. Language Operations A-3


A-4 OS/400 APPC Programming V4R1
Appendix B. Sense Data and Return Codes
Code Description/Action
SNA Sense Data
0000 Description: For input operations issued by your
For some ICF return codes, the negative-response data field program, 0000 indicates that your program
in the input/output feedback area contains SNA sense data received some data with a turnaroundindication.
received from the remote system, indicating the reason for a The partner program is ready to receive data.
negative-response. For output operations issued by your program,
Note: CPI Communications does not return sense data. 0000 indicates that the last output operation
Refer to the APPN Support book and the SNA completed successfully and that your program
Formatsmanual for information about sense data. can continue to send data.
Action: If your program received a turnaround
on an input operation, issue an output operation.
Return Codes For the actions which can be taken after 0000 is
received, refer to Table B-1:
This section describes all the return codes that are valid for
APPC. These return codes are set in the I/O feedback area Table B-1. Actions for Return Code 0000
of the ICF file; they report the results of each I/O operation
Type of Last Operation Actions Your Program
issued by your application program. Your program should Session Issued Can Take
check the return code and act accordingly. Refer to your
Started by a Acquire or open Issue an evoke or timer
high-level language manual for more information on how to source function, or a get-attributes
access these return codes. program operation.
Evoke with detach or Issue another evoke func-
Each return code is a four-digit hexadecimal value. The first write with detach tion, issue a release opera-
two digits contain the major code, and the last two digits tion, continue local
contain the minor code. processing, or end.
Any other output Issue another output oper-
With some return codes, a message is also sent to the job operation ation (except evoke), or
issue an input operation.
log or the system operator message queue (QSYSOPR).
You can refer to the message for additional information. End-of-Session Continue local processing
or end.

Notes: Started by a Acquire or open Issue an input or output


remote operation.
1. In the return code descriptions, your program refers to program start
the local AS/400 application program that issues the request1
operation and receives a return code from ICF communi- Write with detach Continue local processing
cations. The partnerprogram refers to the application or end. This session has
ended.
program on the remote system with which your program
Any other output Issue another output oper-
is communicating through ICF.
operation ation (except evoke), or
2. Several references to input and output operations are issue an input operation.
made in the descriptions. These operations can include End-of-Session Continue local processing
DDS keywords and system-supplied formats, which are or end.

listed in Appendix A. Note:


1 A target program (started by a program start request)
cannot issue an evoke function in this session; it can
issue an evoke function only in a different session
Major Code 00 that it has first acquired.

Major Code 00 – Operation completed successfully.


0001 Description: On a successful input operation,
Description: The operation issued by your program com- your program received some data. Your program
pleted successfully. Your program may have sent or received must continue to receive data until it receives a
some data, or may have received a message from the turnaround indication (which allows your program
remote system. to send data) or a detach indication.
Action: Issue another input operation. If your
Action: Examine the minor return code and continue with the program detects a turnaround indication, it can
next operation. issue an output operation.

 Copyright IBM Corp. 1997 B-1


0002 Description: For a receive operation, your 0010 Description: On a successful output operation,
program received control data, sent with the your program received a request-to-write indi-
program start request, on the first input opera- cation. The partner program will send data as
tion. Your program must continue to receive data soon as possible. You should allow the partner
until it receives a turnaroundindication (which program to send this data.
allows your program to send data) or a detach
Action: Issue an input operation as soon as
indication.
possible.
For an acquire operation, your program received
0011 Description: Your program received control
control data, sent with the program start request.
data, sent with the program start request, on the
Action: Issue another input operation. If your first input operation, along with a detach indi-
program detects a turnaround indication, it can cation. The communications transaction with the
issue an output operation. partner program has ended, but the session with
0004 Description: On a successful input operation, the partner system is still active.
your program received some control data with a Action: Your program can either issue an end-
turnaround indication. The partnerprogram is of-session function or end.
ready to receive data.
0013 Description: Your program received control
0005 Description: On a successful input operation, data, sent with the program start request, on the
your program received some control data. Your first input operation, along with a
program must continue to receive data until it turnaroundindication. In addition, the partner
receives a turnaround indication (which allows program requested confirmation.
your program to send data) or a detach indi-
cation.
Action: Process any control data received with
Action: Issue another input operation. If your the request. If your program detects no errors,
program detects a turnaround indication, it can respond to the confirm request with a
issue an output operation. respond-to-confirm(RSPCONFIRM) function,
0006 Description: Your program received control then issue an output operation. If your program
data, sent with the program start request, on the does detect an error, issue a fail function, or end
first input operation, along with a your program.
turnaroundindication. 0014 Description: On a successful input operation,
0008 Description: On a successful input operation, your program received some data with a turn-
your program received a detach indication with around indication. In addition, the partner
the last of the data. The communications trans- program requested confirmation.
action with the partner program has ended, but Action: Process any data received with the
the session with the partner system is still active. request. If your program detects no errors,
Action: If your program started the session, it respond to the confirm request with a respond-
can issue another evoke function (to start to-confirm (RSPCONFIRM) function, then issue
another program), issue a release operation (to an output operation. If your program does detect
perform local processing or to start another an error, issue a fail function, or end your
session), or end. If a program start request from program.
the partner program started the transaction, your 0015 Description: On a successful input operation,
program can either issue an end-of-session func- your program received some data. In addition,
tion or end. the partner program requested confirmation.
000C Description: On a successful input operation, Action: Process any data received with the
your program received a detach indication with request. If your program detects no errors,
the last of the control data. The communications respond to the confirm request with a
transaction with the partner program has ended, respond-to-confirm(RSPCONFIRM) function,
but the session with the partner system is still then issue an input operation. If your program
active. does detect an error, issue a fail function, or end
Action: If your program started the session, it your program.
can issue another evoke function (to start 0018 Description: Your program received control
another program), issue a release operation (to data, sent with the program start request, on the
perform local processing or to start another first input operation. In addition, the partner
session), or end. If a program start request from program requested confirmation.
the partnerprogram started the transaction, your
Action: Process any data received with the
program can either issue an end-of-session func-
request. If your program detects no errors,
tion or end.

B-2 OS/400 APPC Programming V4R1


respond to the confirm request with a respond- Action: Process any data received with the
to-confirm (RSPCONFIRM) function, then issue request. If your program detects no errors,
an input operation. If your program does detect respond to the confirm request with a respond-
an error, issue a fail function, or end your to-confirm (RSPCONFIRM) function, then issue
program. an output operation. If your program does detect
001C Description: On a successful input operation, an error, issue a fail function, or end your
your program received some data with a detach program.
indication. In addition, the partner program 0045 Description: On a successful input operation,
requested confirmation. your program received some control data. In
Action: If your program detects no errors, it addition, the partner program requested confir-
should respond to the confirm request with a mation.
respond-to-confirm (RSPCONFIRM) function, Action: Process any control data received with
and then: the request. If your program detects no errors,
Ÿ If your program started the transaction, it respond to the confirm request with a respond-
can issue another evoke operation (to start to-confirm (RSPCONFIRM) function, then issue
another program), issue a release operation an input operation. If your program does detect
(to perform local processing or to start an error, issue a fail function, or end your
another session), or end. program.

Ÿ If a program start request from the partner 0046 Description: On a successful input operation,
program started the transaction, your your program received some control data with a
program can issue an end-of-session func- detach indication. In addition, the partner
tion or end. program requested confirmation.

If your program does detect an error, issue a fail Action: If your program detects no errors, it
operation. The transaction remains active, and should respond to the confirm request with a
your program and the partner program can respond-to-confirm (RSPCONFIRM) function,
perform the necessary error recovery. To end and then:
the transaction abnormally if your program Ÿ If your program started the transaction, it
detects an error, issue an end-of-session func- can issue another evoke operation (to start
tion, or end your program. another program), issue a release operation
001D Description: Your program received control (to perform local processing or to start
data, sent with the program start request, on the another session), or end.
first input operation, along with a detach indi- Ÿ If a program start request from the partner
cation. In addition, the partner program program started the transaction, your
requested confirmation. program can issue an end-of-session func-
Action: If your program detects no errors, it tion or end.
should respond to the confirm request with a If your program does detect an error, issue a fail
respond-to-confirm (RSPCONFIRM) function, operation. The transaction remains active, and
and can then issue an end-of-session function or your program and the partner program can
end. perform the necessary error recovery. To end
If your program does detect an error, issue a fail the transaction abnormally if your program
operation. The transaction remains active, and detects an error, issue an end-of-session func-
your program and the partner program can tion, or end your program.
perform the necessary error recovery. To end 0054 Description: Rollback is required. The trans-
the transaction abnormally if your program action program (TP) has entered the rollback-
detects an error, issue an end-of-session func- required state.
tion, or end your program.
Note: This is only returned after an EOS func-
0044 Description: On a successful input operation, tion or a close operation has been
your program received control data with a turn- issued, so that local resources and other
around indication. In addition, the partner remote resources must be rolled back.
program requested confirmation.
Action: Use the rollback operation to roll back
all local protected resources.

Appendix B. Sense Data and Return Codes B-3


to complete all processing and end your program
Major Code 02 as soon as possible. The system eventually
changes a job ended (controlled) to a job ended
Major Code 02 – Input operation completed successfully, but
(immediate) and forces all processing to stop for
your job is being ended (controlled).
your job.
Description: The input operation issued by your program 0204 Description: On a successful input operation,
completed successfully. Your program may have received your program received some control data with a
some data or a message from the remote system. However, turnaround indication. Also, your job is being
your job is being ended (controlled). ended (controlled) The partnerprogram is ready
to receive data from your program.
Action: Your program should complete its processing and
end as soon as possible. The system eventually changes a Action: Your program can issue an output oper-
job ended (controlled) to a job ended (immediate) and forces ation. However, the recommended action is to
all processing to stop for your job. complete all processing and end your program
as soon as possible. The system eventually
Code Description/Action changes a job ended (controlled) to a job ended
0200 Description: On a successful input operation, (immediate) and forces all processing to stop for
your program received some data with a turn- your job.
around indication. Also, your job is being ended 0205 Description: On a successful input operation,
(controlled) The partnerprogram is ready to your program received some control data. Also,
receive data from your program. your job is being ended (controlled) Your
Action: Your program can issue an output oper- program can continue to receive data until it
ation. However, the recommended action is to receives a turnaround indication (which allows
complete all processing and end your program your program to send data) or a detach indi-
as soon as possible. The system eventually cation.
changes a job ended (controlled) to a job ended Action: Your program can issue another input
(immediate) and forces all processing to stop for operation. If your program detects the equivalent
your job. of a turnaround indication, it can issue an output
0201 Description: On a successful input operation, operation. However, the recommended action is
your program received some data. Also, your job to complete all processing and end your program
is being ended (controlled) Your program can as soon as possible. The system eventually
continue to receive data until it receives a turn- changes a job ended (controlled) to a job ended
around indication (which allows your program to (immediate) and forces all processing to stop for
send data) or a detach indication. your job.
Action: Your program can issue another input 0206 Description: Your program received control
operation. If your program detects the equivalent data, sent with the program start request, on the
of a turnaround indication, it can issue an output first input operation, along with a
operation. However, the recommended action is turnaroundindication. Also, your job is being
to complete all processing and end your program ended (controlled) The partner program is ready
as soon as possible. The system eventually to receive data from your program.
changes a job ended (controlled) to a job ended Action: Your program can issue an
(immediate) and forces all processing to stop for outputoperation. However, the recommended
your job. action is to complete all processing and end your
0202 Description: For a receive operation, your program as soon as possible. The system even-
program received control data, sent with the tually changes a job ended (controlled) to a job
program start request, on the first input opera- ended (immediate) and forces all processing to
tion. Also, your job is being ended (controlled) stop for your job.
Your program can continue to receive data until 0208 Description: On a successful input operation,
it receives a turnaroundindication (which allows your program received a detach indication with
your program to send data) or a detach indi- the last of the data. The communications trans-
cation. action with the partner program has ended, but
For an acquire operation, your program received the session with the partnersystem is still active.
control data, sent with the program start request. Also, your job is being ended (controlled)
Action: Your program can issue another input Action: If your program started the session, it
operation. If your program detects the equivalent can issue another evoke function (to start
of a turnaroundindication, it can issue an output another program), issue a release operation (to
operation. However, the recommended action is perform local processing or to start another

B-4 OS/400 APPC Programming V4R1


session), or end. If a program start request from tually changes a job ended (controlled) to a job
the partner program started the transaction, your ended (immediate) and forces all processing to
program can either issue an end-of-session func- stop for your job.
tion or end. However, the recommended action
0214 Description: On a successful input operation,
is to complete all processing and end your
your program received some data with a turn-
program as soon as possible. The system even-
around indication. In addition, the
tually changes a job ended (controlled) to a job
partnerprogram requested confirmation. Also,
ended (immediate) and forces all processing to
your job is being ended (controlled)
stop for your job.
Action: Process any data received with the
0211 Description: Your program received control
request. If your program detects no errors,
data, sent with the program start request, on the
respond to the confirm request with a respond-
first input operation, along with a detach indi-
to-confirm (RSPCONFIRM) function, then issue
cation. The communications transaction with the
an outputoperation. If your program does detect
partner program has ended, but the session with
an error, issue a fail function, or end your
the partner system is still active. Also, your job is
program. However, the recommended action is
being ended (controlled)
to complete all processing and end your program
Action: Your program can either issue an end- as soon as possible. The system eventually
of-session function or end. However, the recom- changes a job ended (controlled) to a job ended
mended action is to complete all processing and (immediate) and forces all processing to stop for
end your program as soon as possible. The your job.
system eventually changes a job ended (con-
0215 Description: On a successful input operation,
trolled) to a job ended (immediate) and forces all
your program received some data. In addition,
processing to stop for your job.
the partner program requested confirmation.
020C Description: On a successful input operation, Also, your job is being ended (controlled)
your program received a detach indication with
Action: Process any data received with the
the last of the control data. The communications
request. If your program detects no errors,
transaction with the partner program has ended,
respond to the confirm request with a respond-
but the session with the partner system is still
to-confirm (RSPCONFIRM) function, then issue
active. Also, your job is being ended (controlled)
an input operation. If your program does detect
Action: If your program started the session, it an error, issue a fail function, or end your
can issue another evoke function (to start program. However, the recommended action is
another program), issue a release operation (to to complete all processing and end your program
perform local processing or to start another as soon as possible. The system eventually
session), or end. If a program start request from changes a job ended (controlled) to a job ended
the partner program started the transaction, your (immediate) and forces all processing to stop for
program can either issue an end-of-session func- your job.
tion or end. However, the recommended action
0218 Description: Your program received control
is to complete all processing and end your
data, sent with the program start request, on the
program as soon as possible. The system even-
first input operation. In addition, the partner
tually changes a job ended (controlled) to a job
program requested confirmation. Also, your job
ended (immediate) and forces all processing to
is being ended (controlled)
stop for your job.
Action: Process any data received with the
0213 Description: Your program received control
request. If your program detects no errors,
data, sent with the program start request, on the
respond to the confirm request with a respond-
first input operation, along with a
to-confirm (RSPCONFIRM) function, then issue
turnaroundindication. In addition, the partner
an input operation. If your program does detect
program requested confirmation. Also, your job
an error, issue a fail function, or end your
is being ended (controlled)
program. However, the recommended action is
Action: Process any control data received with to complete all processing and end your program
the request. If your program detects no errors, as soon as possible. The system eventually
respond to the confirm request with a changes a job ended (controlled) to a job ended
respond-to-confirm(RSPCONFIRM) function, (immediate) and forces all processing to stop for
then issue an output operation. If your program your job.
does detect an error, issue a fail function, or end
021C Description: On a successful input operation,
your program. However, the recommended
your program received some data with a detach
action is to complete all processing and end your
indication. In addition, the partnerprogram
program as soon as possible. The system even-

Appendix B. Sense Data and Return Codes B-5


requested confirmation. Also, your job is being Action: Process any control data received with
ended (controlled) the request. If your program detects no errors,
Action: If your program detects no errors, it respond to the confirm request with a respond-
should respond to the confirm request with a to-confirm (RSPCONFIRM) function, then issue
respond-to-confirm (RSPCONFIRM) function, an output operation. If your program does detect
and then: an error, issue a fail function, or end your
program. However, the recommended action is
Ÿ If your program started the transaction, it to complete all processing and end your program
can issue another evoke operation (to start as soon as possible. The system eventually
another program), issue a release operation changes a job ended (controlled) to a job ended
(to perform local processing or to start (immediate) and forces all processing to stop for
another session), or end. your job.
Ÿ If a program start request from the partner 0245 Description: On a successful input operation,
program started the transaction, your your program received some control data. In
program can issue an end-of-session func- addition, the partner program requested confir-
tion or end. mation. Also, your job is being ended (controlled)
If your program does detect an error, issue a fail Action: Process any data received with the
operation. The transaction remains active, and request. If your program detects no errors,
your program and the partner program can respond to the confirm request with a respond-
perform the necessary error recovery. If your to-confirm (RSPCONFIRM) function, then issue
program detects an error and wants to end the an input operation. If your program does detect
transaction abnormally, issue an end-of-session an error, issue a fail function, or end your
function, or end your program. program. However, the recommended action is
However, the recommended action is to com- to complete all processing and end your program
plete all processing and end your program as as soon as possible. The system eventually
soon as possible. The system eventually changes a job ended (controlled) to a job ended
changes a job ended (controlled) to a job ended (immediate) and forces all processing to stop for
(immediate) and forces all processing to stop for your job.
your job. 0246 Description: On a successful input operation,
021D Description: Your program received control your program received some control data with a
data, sent with the program start request, on the detach indication. In addition, the partner
first input operation, along with a detach indi- program requested confirmation. Also, your job
cation. In addition, the partner program is being ended (controlled)
requested confirmation. Also, your job is being Action: If your program detects no errors, it
ended (controlled) should respond to the confirm request with a
Action: If your program detects no errors, it respond-to-confirm (RSPCONFIRM) function,
should respond to the confirm request with a and then:
respond-to-confirm (RSPCONFIRM) function, Ÿ If your program started the transaction, it
and can then issue an end-of-session function or can issue another evoke operation (to start
end. If your program does detect an error, issue another program), issue a release operation
a fail operation. The transaction remains active, (to perform local processing or to start
and your program and the partnerprogram can another session), or end.
perform the necessary error recovery. To end a
transaction abnormally if your program detects Ÿ If a program start request from the partner
an error, issue an end-of-session function, or program started the transaction, your
end your program. program can issue an end-of-session func-
tion or end.
However, the recommended action is to com-
plete all processing and end your program as If your program does detect an error, issue a
soon as possible. The system eventually fail operation. The transaction remains active,
changes a job ended (controlled) to a job ended and your program and the partner program can
(immediate) and forces all processing to stop for perform the necessary error recovery. To end
your job. the transaction abnormally if your program
detects an error, issue an end-of-session func-
0244 Description: On a successful input operation, tion, or end your program.
your program received some control data with a
turnaround indication. In addition, the partner However, the recommended action is to com-
program requested confirmation. Also, your job plete all processing and end your program as
is being ended (controlled) soon as possible. The system eventually

B-6 OS/400 APPC Programming V4R1

You might also like