• Keine Ergebnisse gefunden

CLOSE #1: IOERR IC FERR

Im Dokument I BM System/34 (Seite 80-87)

30 w!-10 IOER:FERR

ENDING A COMMUNICATIONS TRANSACTION

99 CLOSE #1: IOERR IC FERR

If an error occurs when closing the session, your program goes to ICFERR, and BASIC issues a $$EOS operation to end the session.

Interactive Communications Programming with BASIC 4-15

4-16

OTHER SSP-ICF OPERATIONS YOU CAN DO

The following are optional operations you can do with SSP-ICF. Use the WRITE statement to do these operations. See WRITE Statement Format in this chapter for the format of the WRITE statement.

• Ask for a change in transmission direction

• Use SSP-ICF or work station timer operations

• Send a negative response to the remote system (used only with the Intra and SNUF subsystems)

• Send a fail operation (used only with the Intra and Peer subsystems)

• Cancel a group (chain) of data records (used only with the Intra and SNUF subsystems)

• Use pass-through operations (used only with the Intra and SNUF subsystems)

Asking for a Change in Transmission Direction

If your program is receiving data, you can ask the remote system to stop sending so your program can send data. To ask for a change. in the direction of transmission, use the WRITE statement to do a request to change direction operation ($$RCD). After you issue the $$RCD operation, your program must continue to receive data until an end of transaction or change of direction indication is received from the remote system. There are no parameters or data needed with the $$RCD operation. See Request to Change Direction Operation in Chapter 2 for more information about this operation.

For example, this statement asks the remote system to stop sending so that your program can send data:

30 WRITE #1,FORMAT "$$RCD": IOERR ICFERR

Using SSP-ICF and Work Station Timer Operations

To use the SSP-ICF and work station timer, use the $$TIMER operation or the TIMER intrinsic function to set the timer, and use the WAITIO statement to determine when the time has ended. Return code 0310 (RETCODE$) or 73 (ERR) is returned when the time has ended.

Example of Using the $$TIMER Operation

If you use the $$TIMER operation, a work station or session must be attached to your program before you can set the time.

You specify the time in hours, minutes, and seconds in the format:

hhmmss For example:

D--030 A$= "013000"

040 WRITE #1,USING 50,FORMAT "$$TIMER": A$ IOERR ICFERR 050 FORM C

6--fl

~ITIO IOERR TIME

. •

910 TIME: IF ERR<>

73

THEN GO TO ICFERR

II

The timer is set to 1 hour, 30 minutes, and 00 seconds.

II

There are 6 characters used to set the time (hhmmss).

II

If an I

I

0 error occurs when the WAITIO statement is executed, go to TIME and check for the timer return code.

II

If the return code does not indicate that the timer expired (ERR is not 73), go to ICFERR. If the return code does indicate the time expired, perform operations based upon the reason for the time-out. For example, display a message indicating that the remote system did not respond within the time allowed.

Interactive Communications Programming with BASIC 4-17

4-18

Example of Using the TIMER Intrinsic Function

If you use the TIMER intrinsic function to set the timer, a work station or session does not have to be attached to the program; however SSP-ICF must be active. To set the timer, use the TIMER intrinsic function in the format:

TIMER(time$), where time$ is the time in the format "hhmmss". For example:

a

030 TIME=TIMER("013000")

040 IF TIME=1 THEN PRINT "SSP-ICF IS NOT ACTIVE" ELSE WAITIO !OERR TIME1 1

'-.,..-I . •

. 11 B ·11

910 TIME1: IF ERR<>73 THEN ~OTO ICFERR,

Ii

a

The timer is set to 1 hour, 30 minutes, and 00 seconds.

II

If SSP-ICF is not active, the timer is not set and TIME is set to 1. If TIME is 1, print a message.

II

If TIME is 0, the timer is set and the WAITIO statement is executed.

II

If a return code is returned when the WAITIO statement is executed, go to TIME1 and check the return code.

II

If the return code does not indicate that the timer expired (ERR is not 73). go to ICFERR. If the return code does indicate the time expired, perform operations based upon the reason for the time-out. For example, display a message indicating that the remote system did not respond within the time allowed.

Sending a Negative Response

To tell the remote system or program that your program found something wrong with the data it received (to send a negative response), use one of the following operations. Both types of negative response operations are for the Intra and SNUF subsystems only. See Negative Response Operation in Chapter 2 for more information.

• $$NRSPNI performs a negative response operation, which transmits a negative response to the remote system or program.

• $$NRSP performs a negative response then invite operation, which transmits a negative response and tells the remote system or program to transmit.

Optional sense data can be sent with the negative response. The following is the format of the data:

Data Positions 1 through 8

Meaning

The sense data transmitted with the negative response. The sense data must begin with 10xx, 08xx, or 0000 (for the Intra and SNUF subsystems). All other positions are user defined.

For example, the following statements send a negative response with the sense data 08008000:

20 SENSE$="08008000"

30 WRITE #1.USING 40,FORMAT "$$NRSPNI": SENSE$ IOERR ICFERR 40 FORM C 8

Interactive Communications Programming with BASIC 4-19

4-20

Sending a Fail Operation

c';

To tell the remote system that your program detected an abnormal condition (for example, received incorrect data), use the $$FAIL o'peration. The fail operation does not need any parameters, and no data can be sent with the fail operation. The fail operation is used only with the Intra and Peer subsystems.

See Fail Operation in Chapter 2 for more information.

For example, the following statement sends a fail operation toSSP-ICF:

30 WRITE #1,FORMAT "$$FAIL": IOERR ICFERR

Issuing a Cancel Operation

To cancel a group of records, use one of the following cancel operations. The cancel operation does not need any parameters or data. The cancel operation is used only with the Intra and SNUF subsystems. See Cance/ Operation in Chapter 2 for more information.

• $$CANLNI performs a cancel operation, which cancels the current group (chain) of data records.

• $$CANL performs a cancel then invite operation, which cancels the current group of data records and allows the remote system or program to transmit.

For example, the following statement cancels the current chain of records:

30 WRITE #1,FORMAT "$$CANL": IOERR ICFERR

Using Pass· Through Operations

Pass-through operations are used only with the Intra and SNUF subsystems.

See Appendix B for a description of pass-through operations.

BASIC OPERATIONS SUMMARY CHART

The following chart shows the valid BASIC operations for each subsystem. An

x

in a subsystem column indicates the subsystem supports the operation. A -indicates the subsystem does not support the operation.

Communications Subsystem

Interactive Communications Programming with BASIC 4-21

4-22

Im Dokument I BM System/34 (Seite 80-87)