¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: RPG and VSAMIO

 

On Sat, Jan 09, 2021 at 09:28:27AM -0600, Harold Grovesteen wrote:

Do not feel bad. I never could get an RPG program to work right. In
the 70's I was at a shop that strictly used RPG. Others in the shop
had no problem. My brain just did not grok RPG.
My brain has had similar experiences with RPG. A few years ago the company
I work for migrated from our mainframe z/OS based platform to an IBM i based
platform. I'm thankful that platform now has free-format RPG. I'm not a
programmer, but have dabbled a bit with CL and free-format RPG and have no
trouble with those. I've tried learning older versions of RPG out of
curiosity. My brain was not willing to cooperate with that endeavor.



--

Kevin



Bruceville, TX

What's the definition of a legacy system? One that works!
Errare humanum est, ignoscere caninum.


Re: RPG and VSAMIO

 

¿ªÔÆÌåÓý

Do not feel bad. ?I never could get an RPG program to work right. ? In the 70's I was at a shop that strictly used RPG. ? Others in the shop had no problem. ?My brain just did not grok RPG. ?One time I gave up and did it in assembler. ?That worked fine. ?Fortunately I was the systems programmer so did not write a lot of application programs.

Harold Grovesteen

On Fri, 2021-01-08 at 18:40 -0800, Jim Snellen wrote:
Hello again,
I've been running the RPG examples from Jay Moseley's website (?and been successful, sorta, until example 3.? It reads a card file to create an ISAM file but I thought it would invoke VSAMIO and process the RPG program to work with a VSAM file instead of ISAM.? According to what I've read on his site is should work with COBOL, Assembler, and PL/1 as well.? However, it seems to be on MVS systems only.? Can anyone confirm?
I don't remember how to create or process ISAM, it's been way too long!??I downloaded and ran the samples from??without problem and thought I'd play around with Jay's RPG example programs.?
BTW, example 2 runs ok except it goes into a loop at EOJ.? I replaced the tape output with SYSLST and it runs fine. I've no idea what's going on.


Re: RPG and VSAMIO

 

Hello Jim,

VSAMIO was written for an usage with the COBOL and PL/I (F) compilers of MVT. I was able to assemble VSAMIO on DOS/VS and use it with the FCOBOL compiler of DOS/VS. I have no idea how to use it from a RPG program.

As for ISAM datasets, they must reside on a 2314 DASD and they are defined with the usual DLBL and EXTENT statements. The exact syntax is on page 38 of GC33-5376 "DOS/VS System Control Statements". :-)

At first sight, I would say it is probably easier for you trying to (recall how to) use ISAM datasets than trying to use VSAMIO with RPG.

Cheers,

Rene FERLAND, Montreal


RPG and VSAMIO

 

Hello again,
I've been running the RPG examples from Jay Moseley's website (?and been successful, sorta, until example 3.? It reads a card file to create an ISAM file but I thought it would invoke VSAMIO and process the RPG program to work with a VSAM file instead of ISAM.? According to what I've read on his site is should work with COBOL, Assembler, and PL/1 as well.? However, it seems to be on MVS systems only.? Can anyone confirm?
I don't remember how to create or process ISAM, it's been way too long!??I downloaded and ran the samples from??without problem and thought I'd play around with Jay's RPG example programs.?
BTW, example 2 runs ok except it goes into a loop at EOJ.? I replaced the tape output with SYSLST and it runs fine. I've no idea what's going on.


Re: Command Sequence for Handling Tape Files (AWS)

 

On Thu, Dec 31, 2020 at 05:42 PM, Jim Snellen wrote:
However, I'm not sure what is meant by:
P.S. -- I will still unmount the tape manually, because I hate seeing message DMKTAP516I. :-)
I thought I explained in my last message, but apparently it is not clear :-) Just forget it and keep doing what you do.

BTW, I usually set OSTAILOR QUIET in the configuration file, this will reduce the number of messages on the console. But it's just my own taste.

Cheers,

Rene FERLAND, Montreal


Re: Command Sequence for Handling Tape Files (AWS)

 

Whew, poor Jim is still somewhat confused BUT it appears my initial premise is correct and the "error" messages are normal.
However, I'm not sure what is meant by:
P.S. -- I will still unmount the tape manually, because I hate seeing message DMKTAP516I. :-)
Thank you gentlemen, for working so diligently on this question.??

Attached is the log file of my latest session.


Re: Command Sequence for Handling Tape Files (AWS)

 

On Thu, Dec 31, 2020 at 05:10 PM, Jim Snellen wrote:
I will still unmount the tape manually, because I hate seeing message DMKTAP516I. :-)
You can skip the devinit 481 * (unmount manually) because VM will automatically unmount the tape, but then (harmless and normal) message DMKTAP516I will be generated on the Hercules console. Since it is annoying to me, I keep typing devinit 481 *.

Cheers,

Rene FERLAND, Montreal


Re: Command Sequence for Handling Tape Files (AWS)

 

Whew!
So, in answer to my question,
-From Hercules,
  • /attach 481 to cmsuser as 181
  • devinit 481 fish.het
-From 3270, do whatever tape processing is necessary, VM or DOS

-From Hercules,
  • devinit 481 *
-From 3270
  • det 181
I'm not sure what is meant by?
P.S. -- I will still unmount the tape manually, because I hate seeing message DMKTAP516I. :-)


Re: Command Sequence for Handling Tape Files (AWS)

 

Ren¨¦ Ferland wrote:

[...]
And VM is not confused, he's just sending a confusing message. :-)
(LOL!) No argument. :)

[...]
Anyway, now the situation is clear and we know that /attach, devinit,
detach is a simple, fast and perfectly legit sequence.
Agreed. I should have just kept my dang mouth shut. :)


Cheers,

Rene FERLAND, Montreal

P.S. -- I will still unmount the tape manually, because I hate seeing
message DMKTAP516I. :-)
I don't blame you in the least. :)

I'll go slink back to my pond now and leave you guys alone. I must be getting old and losing my touch. I'm just confusing things instead of clearing them up!

Take care. :)

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


Re: Command Sequence for Handling Tape Files (AWS)

 

Hello Fish,

Thanks for taking your precious time to look at this.?

Yes, device 481 is a 3420 indeed. And VM is not confused, he's just sending a confusing message. :-)

If I am reading its documentation properly, VM/370 does not support the subsequent models of magnetic tape you mention. Even though addresses 4A0-4A15 are defined as 3480 in DMKRIO, they don't seem to work. And defining a 3480 on 481 in the Hercules configuration file does not fool VM/370 either. We still get message DMKTAP516I and even a new one, DMKTAP500I.

Anyway, now the situation is clear and we know that /attach, devinit, detach is a simple, fast and perfectly legit sequence.

Cheers,

Rene FERLAND, Montreal

P.S. -- I will still unmount the tape manually, because I hate seeing message DMKTAP516I. :-)

?


Re: Command Sequence for Handling Tape Files (AWS)

 

Ren¨¦ Ferland wrote:
Fish wrote:

Does [SDL Hyperion 4.3] behave the same way?
Yes, but I feel Hercules is not the guilty one here.
Okay, after looking at Hercules code (and verifying it against the appropriate manual), it appears this behavior is actually correct -- for 3410, 3411 and 3420 tape devices (which, without you even telling me, I am presuming is how you have your tape device defined, correct? You tape device is defined as a 3420, yes?).

If you look on page 24-25 of reference manual "3803 Model 2, IBM 3420 Models 4, 6, and 8, Magnetic Tape Subsystems, Subsystem Description" (GA32-0021-01), you will see that it states quite clearly:


Motion Control Commands

Motion control commands move tape but do not transfer data
across the channel/tape control interface.

All motion control commands operate as follows:

1. Channel End is signaled when the command is accepted
(initial status).

2. Device End is signaled when the operation, except for
Rewind Unload (see below), is completed (ending status).

3. The tape control responds with 'busy' if the tape control
is addressed while executing the command.

Note: For Rewind/Unload, Channel End is signaled in initial status,
and Device End, Control Unit End, and Unit Check are signaled in an
interrupt status cycle after the command becomes effective at the
tape unit. Device End is signaled again when the operator reloads
tape, presses START, and the tape unit goes from 'not ready' to
'ready' providing the tape control has not been offline in the
interim.


So Hercules is indeed behaving correctly, and the DMKTAP516I "BAD SENSE" message that VM is reporting on the unload command (X'0F') is actually correct (normal) and completely benign, as indicated in the reported sense information: "SNS= 4022000000C0030...", the X'40' in the first byte of which means INTREQ = "Intervention Required" (which makes logical sense (no pun intended) since the drive is "not ready for use" since it no longer has any tape media mounted on it, and therefore requires a human being to "intervene" to "correct" the situation by mounting a new tape onto the drive).

IBM must have recognized that having an "I/O error" result from what *should* otherwise be a completely normal/usual/typical thing as asking the tape drive to please unload its media, was a mistake, because for all other subsequent tape drive models (i.e. 3422, 3430, 3480, 3490, 3590, 3592, 9347, 9348 and 0x8809, etc), a Unit Check (I/O error) no longer occurs on a Rewind-Unload command.

If you change the device type for your tape drive in your Hercules configuration to one of the previously mentioned models (e.g. 9347, which I believe was also, like the 3420, a reel-to-reel drive), I'll bet DMKTAP516I no longer occurs when the same sequence is used.

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


Re: Command Sequence for Handling Tape Files (AWS)

 

Sorry, forgot the Hercules log.

Rene FERLAND, Montreal


Re: Command Sequence for Handling Tape Files (AWS)

 

On Thu, Dec 31, 2020 at 01:09 AM, Fish Fish wrote:
Does it behave the same way?
Yes, but I feel Hercules is not the guilty one here.

Rene FERLAND, Montreal


Re: Command Sequence for Handling Tape Files (AWS)

 

My sequence is similar like yours, but after dump I issue?
Tape rew
Tape scan
To see what's on the tape?
Then?
Tape run?
This rewinds and unmount tape, of course there's a cms error message, since tape is no more. But is unharmful.?
For a new tape I start devinit and mount in operator console again?


Re: Command Sequence for Handling Tape Files (AWS)

 

Ren¨¦ Ferland wrote:
Fish wrote:

Please do a ccw trace on 481 for both scenarios and post
the results. I'd like to see them.
See attached log from Hercules.
Okay, that's Hercules 3.13. But what about SDL Hyperion 4.3? Does it behave the same way?

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


Re: Command Sequence for Handling Tape Files (AWS)

 

On Wed, Dec 30, 2020 at 11:52 PM, Fish Fish wrote:
Please do a ccw trace on 481 for both scenarios and post the results. I'd like to see them.
See attached log from Hercules.

Rene FERLAND, Montreal


Re: Command Sequence for Handling Tape Files (AWS)

 

Ren¨¦ Ferland wrote:

[...]
If I do:

/attach 481 to cmsuser as 181
devinit 481 fish.het
det 181

then the tape is unmounted yes, but I get:

TAPE 481 DETACHED CMSUSER 181
DMKTAP516I TAPE 481 BAD SENSE CMD= 0F
SNS= 4022000000C003000000000000800100010000FFFF000000
CSW= 00F0AD68 2E000001 USERID= SYSTEM

The (information) message DMKTAP516I is generated by "an
error recovery routine [which] encountered an error on a
sense operation".

Why the message? The tape was there and VM did rewind it
and unmount it.
Weird. I can't explain that. Bug in Hercules maybe? Have you tried doing a CCW trace on device 481 to see what's going on?


However, if I do

/attach 481 to cmsuser as 181
devinit 481 fish.het
devinit 481 *
det 181

or just

/attach 481 to cmsuser as 181
/detach 481 from cmsuser

I get

TAPE 481 DETACHED CMSUSER 181

and no DMKTAP516I message. Now VM is trying to rewind and
unmount a non-existing tape and get so confused that it
cannot produce any message induced by the said confusion?

I don't know about VM but poor Rene *is* confused. :-)
Me too now! :(

Please do a ccw trace on 481 for both scenarios and post the results. I'd like to see them.

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


Re: Command Sequence for Handling Tape Files (AWS)

 

On Wed, Dec 30, 2020 at 10:28 PM, Fish Fish wrote:
By doing it in the CORRECT sequence instead ("detach 181" from CMS guest and nothing else), VM's I/O request to unmount the tape then succeeds.
Fish, I don't understand. If I do
?
/attach 481 to cmsuser as 181
devinit 481 fish.het
det 181
?
then the tape is unmounted yes, but I get:
?
TAPE 481 DETACHED CMSUSER? 181? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
DMKTAP516I TAPE 481 BAD SENSE? ?CMD= 0F? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
SNS= 4022000000C003000000000000800100010000FFFF000000? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
CSW= 00F0AD68 2E000001 USERID= SYSTEM
?
The (information) message DMKTAP516I is generated by "an error recovery routine [which] encountered an error on a sense operation".
?
Why the message? The tape was there and VM did rewind it and unmount it.?
?
However, if I do
?
/attach 481 to cmsuser as 181
devinit 481 fish.het
devinit 481 *
det 181
?
or just
?
/attach 481 to cmsuser as 181
/detach 481 from cmsuser
?
I get
?
TAPE 481 DETACHED CMSUSER? 181? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
?
and no DMKTAP516I message. Now VM is trying to rewind and unmount a non-existing tape and get so confused that it can not produce any message induced by the said confusion?

I don't know about VM but poor Rene *is* confused. :-)
?
Rene FERLAND, Montreal
?


Re: Command Sequence for Handling Tape Files (AWS)

 

[...]
I believe VM is purposely coded that way. Under some
conditions it doesn't unload the tape from the drive
whereas under other conditions it does. I can't remember.
It's been too many years.
I believe it's module DMKVDR that handles this? I seem to recall having to manually patch it (modify it) back when I was the VM/SP system administrator for our company, to purposely *prevent* VM from ever issuing the rewind and unload I/O to its tape drives upon detach.

We did this, as I recall, because our string of tape drives was physically attached to multiple systems, and if the VM operator accidentally issued the detach command for the wrong drive, it would of course dutifully unload the tape from that drive which the *production* system MIGHT have been using! (writing to!) (Oops!)

I believe later versions of VM's detach command supported a "(leave" option to accomplish the same thing (i.e. prevent the rewind-unload from ever being issued upon detach), but either we didn't have that version or else we patched DMKVDR anyway because it was too easy for the operator to forget to specify that option (and unloading a tape in the middle of an important job that was running on the production system was writing to was painful enough to warrant doing so in order to prevent it from EVER happening again!).

I'm too busy working on Hercules itself to check, but just for fun, can someone check my memory for me? Was it indeed the DMKVDR module (VDR = "Virtual Device Release"?) that handled this?

Thanks.

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


Re: Command Sequence for Handling Tape Files (AWS)

 

Ren¨¦ Ferland wrote:

/attach 481 to cmsuser as 181
devinit 481 jim.het
tape dump * * a
devinit 481 *
/detach 481 from cmsuser

and it generates no error messages.
Because you asked VM *directly* to detach REAL device X'481' drive from its CMS guest's system, I'm guessing it didn't bother trying to unload whatever media it might have thought might still be mounted on the drive. It didn't issue the "run" CCW (X'0F' = "Rewind and Unload"), but rather instead decided to leave the tape drive alone. It decided to leave the media (the tape) mounted on the drive, position right where it was at.

In Jim's scenario however, he detached the virtual drive from his CMS userid, which triggered VM to issue the "run" CCW to the corresponding real device to unload the media (the tape) that it *believed* was still mounted there. I believe VM is purposely coded that way. Under some conditions it doesn't unload the tape from the drive whereas under other conditions it does. I can't remember. It's been too many years.


On DOS/VS, I use a similar sequence:

/attach 481 to dosvs as 280
(submit my job)
devinit 481 jim.het
devinit 481 *
/detach 481 from dosvs
Which is the same exact thing since your "dosvs" was, like "cmsuser", just another virtual machine GUEST running under the VM hypervisor, which is the REAL operating system in this situation, and the one that is ultimately in control of its own REAL devices.


[...]
Moreover, on DOS/VS, if I am to work with tapes, I will
typically do the /attach before the IPL, once for all,
and the /detach after the shutdown.
Which IMO is the correct way to do it.


If I run DOS/VS native, the attach/detach is not needed because
the tapes are already defined in my Hercules configuration file.
Precisely.

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...