Channel Appendage Routines

18 views
Skip to first unread message

Dave Clark

unread,
Sep 18, 2023, 4:09:42 PM9/18/23
to ASSEMBL...@listserv.uga.edu
I found some sample assembler code for doing this, but it leaves me
asking a few questions... The sample I found uses a format 0 CCW but my
program uses a format 1 CCW. Does that preclude using an appendage routine
or is it six of one and half dozen of the other? I suppose there is no
reason that I am attached to using a format 1 CCW but I'm making this
change to a program I've had around for years and was hoping for minimal
changes. I've tried looking at two or three different manuals and I just
can't find much on using appendage routines. So, either information around
the first question or point me to a definitive manual would be appreciated.


Sincerely,

Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331



*********************************************************************************************
This email message and any attachments is for use only by the named addressee(s) and may contain confidential, privileged and/or proprietary information. If you have received this message in error, please immediately notify the sender and delete and destroy the message and all copies. All unauthorized direct or indirect use or disclosure of this message is strictly prohibited. No right to confidentiality or privilege is waived or lost by any error in transmission.
*********************************************************************************************

Tony Thigpen

unread,
Sep 18, 2023, 4:22:36 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Dave,

I have been looking at the same thing. One thing I came across, and am
now looking for again, was that format 1 CCWs are bad under VM.

Tony Thigpen

Dave Clark wrote on 9/18/23 4:08 PM:

Tony Thigpen

unread,
Sep 18, 2023, 4:25:18 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Found it:
https://www.ibm.com/docs/en/zvse/6.2?topic=addressing-ccw-formats

"Note: Use format-1 CCWs only if necessary. When running under VM, the
format-1 CCW translation affects the VM guest performance."

Tony Thigpen

Tony Thigpen wrote on 9/18/23 4:22 PM:

Tony Thigpen

unread,
Sep 18, 2023, 4:27:57 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Dave,

On the program we are both working on, the use of format-1 CCWs is not
needed. In the end, it's one linked together program that is loaded by a
// EXEC card, thus it is always loaded in 24bit.

Tony Thigpen

Tony Thigpen wrote on 9/18/23 4:22 PM:

Dave Clark

unread,
Sep 18, 2023, 4:36:48 PM9/18/23
to ASSEMBL...@listserv.uga.edu
"IBM Mainframe Assembler List" <ASSEMBL...@LISTSERV.UGA.EDU> wrote on
09/18/2023 04:27:49 PM:
> On the program we are both working on, the use of format-1 CCWs is not
> needed. In the end, it's one linked together program that is loaded by a
> // EXEC card, thus it is always loaded in 24bit.


So, the only reason for using a format-1 CCW is so that the I/O
buffer can reside in 31-bit space?

Tony Thigpen

unread,
Sep 18, 2023, 4:54:49 PM9/18/23
to ASSEMBL...@listserv.uga.edu
In VSE, yes.

Tony Thigpen

Dave Clark wrote on 9/18/23 4:36 PM:

Steve Thompson

unread,
Sep 18, 2023, 5:10:54 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Forgive me, but I can't remember what a channel appendage is or
is for.

Could you just give me a quick answer/idea.

I used to do CCW stuff but since ECKD, I've only done CCWs for
tape (which is now not supported).

Regards,
Steve Thompson

Seymour J Metz

unread,
Sep 18, 2023, 5:14:36 PM9/18/23
to ASSEMBL...@listserv.uga.edu
A CE appendage gets control after the channel program and any associated error recovery have completed. In OS/360 it ran disabled, but in MVS it runs as an extension of the EXCP Supervisor; I don't recall what locks are held.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Steve Thompson <ste...@WKYR.NET>
Sent: Monday, September 18, 2023 5:10 PM
To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Channel Appendage Routines

Steve Thompson

unread,
Sep 18, 2023, 5:23:43 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Thanks. Now I kind of remember what they can do.

Steve Thompson

Tony Thigpen

unread,
Sep 18, 2023, 5:24:30 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Some of us on VSE-L are working on a program for which the original
programmer as passed away. The program runs under VSE and does direct IO
to a 3270 device to allow for repairing 'things' that have been messed
up, such as the IPL procedures. It includes a small editor.

The channel appendage routine is for handling errors from the 3270 which
is really a TN3270 session on an OSA-C.

Tony Thigpen

Seymour J Metz wrote on 9/18/23 5:14 PM:

Dave Clark

unread,
Sep 18, 2023, 5:30:26 PM9/18/23
to ASSEMBL...@listserv.uga.edu
"IBM Mainframe Assembler List" <ASSEMBL...@LISTSERV.UGA.EDU> wrote on
09/18/2023 05:10:51 PM:
> Forgive me, but I can't remember what a channel appendage is or
> is for.
>
> Could you just give me a quick answer/idea.
>
> I used to do CCW stuff but since ECKD, I've only done CCWs for
> tape (which is now not supported).


In my case, I am using a channel appendage routine to synchronize
native 3270 I/O. Basically, after writing to the 3270 device, I can't read
immediately and must wait for an attention interrupt to tell me when the
3270 device has data to be received.

Steve Thompson

unread,
Sep 18, 2023, 5:34:15 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Yes, it is coming back to me. Back in the day with Wylbur... I
had to deal with all of that. And then with Connect:Direct I was
doing testing with the cartridge tapes and when the Tape
libraries came out, they went scsi and IBM dropped EXCP support
for them, so that code is now deprecated since the Cart drives
are all EOL/OOS.

Steve Thompson

Steve Thompson

unread,
Sep 18, 2023, 5:38:47 PM9/18/23
to ASSEMBL...@listserv.uga.edu
Oh yes. Just like with a console typewriter as I recall.

It has to send the interrupt to tell you it is ready for you to read.

I'm not sure how T-MON does this, but it can write back to the
device and keep it updating as I recall. Some of the other
monitor products can do the same. I don't think that is what you
would want.

Steve Thompson

Seymour J Metz

unread,
Sep 18, 2023, 7:06:14 PM9/18/23
to ASSEMBL...@listserv.uga.edu
?

ATTN comes as a stand-alone interrupt, after the CE interrupt has already been processed. I have no idea what facilities VSE has for handling ATTN in an EXCP application.

________________________________________
From: IBM Mainframe Assembler List <ASSEMBL...@LISTSERV.UGA.EDU> on behalf of Dave Clark <dlc...@WINSUPPLYINC.COM>
Sent: Monday, September 18, 2023 5:29 PM


To: ASSEMBL...@LISTSERV.UGA.EDU
Subject: Re: Channel Appendage Routines

"IBM Mainframe Assembler List" <ASSEMBL...@LISTSERV.UGA.EDU> wrote on

Jonathan Scott

unread,
Sep 19, 2023, 5:15:15 AM9/19/23
to ASSEMBL...@listserv.uga.edu
Dave Clark writes:
> In my case, I am using a channel appendage routine to synchronize
> native 3270 I/O. Basically, after writing to the 3270 device, I can't read
> immediately and must wait for an attention interrupt to tell me when the
> 3270 device has data to be received.

I implemented local 3270 support for Altergo Software's
transaction processing system Shadow II on OS/VS in the 1970s
using similar tricks, but I think it also used a start-I/O
appendage.

To keep track of attention, it marked the UCB as still busy on
completion of any request, and queued a NOP to wait if a read
was issued. When Attention came in, the I/O supervisor marked
the UCB as available and executed any queued request.

The trickiest bit was cancelling the wait for attention if
another Write was issued. I don't remember the details (this
was nearly 50 years ago) but I think it involved marking the
next request as related so that the start-I/O appendage would
run immediately rather than waiting for the previous request,
then clearing the UCB busy bit from the start-I/O appendage.
I think we also marked the queued request so it would be
cancelled (and marked as purged) rather than executed.

It still worked on MVS (although I think there may have been
some small changes) but was obviously somewhat risky and
required authorized code. For local terminals we therefore also
supported the use of BTAM, although the BTAM interface was very
awkward and had performance problems because it was mainly aimed
at remote bisync terminals, and imposed completely unnecessary
restrictions on working with local devices (in particular, only
being able to handle I/O to one device at a time). We later
added VTAM support.

I also later implemented an emergency stand-alone 3270 editor
(on a 4331 console) as a way to prepare stand-alone dump control
input on tape because we didn't have a card reader. However,
rather than implementing interrupt support I simply used a TIO
loop to wait for I/O completion. And stand-alone dump soon
gained the capability to read control input from the console,
eliminating the need for my stand-alone editor.

Jonathan Scott, HLASM
IBM Hursley, UK

Dave Clark

unread,
Sep 19, 2023, 9:46:16 AM9/19/23
to ASSEMBL...@listserv.uga.edu
"IBM Mainframe Assembler List" <ASSEMBL...@LISTSERV.UGA.EDU> wrote on
09/19/2023 04:41:14 AM:
> I implemented local 3270 support for Altergo Software's
> transaction processing system Shadow II on OS/VS in the 1970s
> using similar tricks, but I think it also used a start-I/O
> appendage.
>
> To keep track of attention, it marked the UCB as still busy on
> completion of any request, and queued a NOP to wait if a read
> was issued. When Attention came in, the I/O supervisor marked
> the UCB as available and executed any queued request.
>
> The trickiest bit was cancelling the wait for attention if
> another Write was issued. I don't remember the details (this
> was nearly 50 years ago) but I think it involved marking the
> next request as related so that the start-I/O appendage would
> run immediately rather than waiting for the previous request,
> then clearing the UCB busy bit from the start-I/O appendage.
> I think we also marked the queued request so it would be
> cancelled (and marked as purged) rather than executed.


Yes, that is basically what I am doing. Before the WRITE, if a READ
is already queued, then I remove it from the queue.

LA R1,MYCCB SET ADDRESS OF CCB
IF CCBQUEUE,(ON,TF),$NOOP IF ALREADY QUEUED FOR READ
SVC 25 DEQUE CHANNEL QUEUE (HIO)
CF CCBQUEUE CLEAR THE FLAG
ENDIF ENDIF
EXCP (1) START THE I/O OPERATION
WAIT (1) WAIT FOR I/O COMPLETION
IF MYCCB+4(2),(NE,CLC),=X'0C00' IF NOT CE+DE, ERROR
LA R5,16 SET RC VALUE
XR R15,R15 CLEAR REGISTER
IC R15,MYCCB+4 SET RESULT VALUE
B RETERR GO RETURN ERROR
ENDIF ENDIF


At READ time, I queue up a NOOP first.

IF OPT,(NE,CLC),=C'READQ' IF NOT QUERY
IF CCBQUEUE,(NOT,TF),$NOOP THEN NEED I/O QUEUEING
MVC MYCCW+0(1),LCLNOOP USE NOOP FOR CHANNEL QUEUE
MVC MYCCW+6(2),=H'1' WITH I/O LENGTH OF 1
EXCP (1) PUT IN CHANNEL QUEUE
SF CCBQUEUE SET QUEUED FLAG
ENDIF ENDIF
WAIT (1) WAIT FOR ATTN INTERRUPT
CF CCBQUEUE CLEAR QUEUED FLAG
ENDIF ENDIF


Then, in the channel appendage routine, I do the following.

IF X'44'(2),(EQ,CLC),=X'0C00' IF CE+DE
IF 8(R1),EQ,X'03' IF CCW STILL NOOP
MVC X'44'(2),=X'0080' CHANGE TO PCI, STAY QUEUED
ENDIF
ELSE
IF X'44',(ON,TM),X'80' IF INTERRUPT WAS ATTN
MVC X'44'(2),=X'0C00' CHANGE TO CE+DE, DEQUE
ENDIF
ENDIF
B 4(R7) RETURN TO SUPERVISOR


When WAIT for attention interrupt is satisfied, I continue the READ
as follows.

IF OPT,(EQ,CLC),=C'READB'
MVC MYCCW+0(1),LCLREADB PUT COMMAND CODE IN CCW
ELSE
MVC MYCCW+0(1),LCLREADM PUT COMMAND CODE IN CCW
ENDIF
L R0,BUFLEN PUT MAX LENGTH OF BUFFER
STH R0,MYCCW+6 IN CHANNEL COMMAND WORD
EXCP (1) START THE I/O OPERATION
WAIT (1) WAIT FOR I/O COMPLETION
IF MYCCB+4(2),(NE,CLC),=X'0C00' IF NOT CE+DE, ERROR
LA R5,16 SET RC VALUE
XR R15,R15 CLEAR REGISTER
IC R15,MYCCB+4 SET RESULT VALUE
B RETERR GO RETURN ERROR
ENDIF ENDIF


I haven't tested this, yet, though. Does that all look correct?
Reply all
Reply to author
Forward
0 new messages