This is a text-only version of the following page on https://raymii.org:
---
Title       :   Mount ISO and execute scripts on OpenVMS
Author      :   Remy van Elst
Date        :   08-05-2018
URL         :   https://raymii.org/s/blog/OpenVMS_Mount_ISO_and_execute_scripts.html
Format      :   Markdown/HTML
---



[![openvms][1]][2]

(You can read all my OpenVMS articles by [clicking the picture above][2])

I'm playing around with OpenVMS on Alpha using [an emulator][3], but was not
able to copy paste in my Hobbyist License. I suspect Putty pasting too quickly,
so I had to get the license script on the OpenVMS, without using the network. In
this article you'll learn some OpenVMS filesystem history, how OpenVMS handles
line endings and in the end I get my license installed by creating an ISO with
the script on it.

<p class="ad"> <b>Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:</b><br><br> <a href="https://leafnode.nl">I'm developing an open source monitoring app called  Leaf Node Monitoring, for windows, linux & android. Go check it out!</a><br><br> <a href="https://github.com/sponsors/RaymiiOrg/">Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.</a><br><br> <a href="https://www.digitalocean.com/?refcode=7435ae6b8212">You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days. </a><br><br> </p>


### -SYSTEM-W-DATAOVERUN, data overrun

When pasting in my ISO using simh and a VAX system, I had no issues. When trying
it on the Alpha and putty, it errors out:



   %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
    \$\
   $ $ /ISSUER=DEC -
   %DCL-W-NOCOMD, no command on line - reenter with alphabetic first character
   $ /AUTHORIZATION=H
   %RMS-F-RER, file read error
   -SYSTEM-W-DATAOVERUN, data overrun


On a few forums it was suggested to create an ISO with the license script on it,
mount that and execute the script from there. Since the installed system has no
network yet (I'm having a lot of issues with Windows and bridging in Virtualbox)
I cannot just copy over the file via FTP.

### Create the ISO

On Ubuntu and Debian you can `apt-get install genisoimage`. Place the License
PAK script in a new folder, in my case the folder is named `license`. The PAK
script is named `a.com`. Generate the ISO:



   genisoimage -V license -o a.iso license


`-V license` is so that the ISO label is `license`.

Using your favorite emulator, couple this ISO to your OpenVMS installation and
boot up. I'm using a trial version of [AlphaVM Basic][3], but FreeAXP is
available as well as is [es40][5].

In the case of AlphaVM the disk drive is `DKA400`.

### OpenVMS mounts

When OpenVMS is booted up, in my case it complains about the licenses:



    Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4

   Username: system
   Password:
   %LICENSE-I-NOLICENSE, no license is active for this software product
   %LOGIN-S-LOGOPRCON, login allowed from OPA0:
      Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4

   $


Find out what your cdrom device is:



   $ SHOW DEVICE

   Device                  Device           Error    Volume         Free  Trans Mnt
    Name                   Status           Count     Label        Blocks Count Cnt
   REMY1$DKA0:             Mounted              0  REMY1          5419104   307   1
   REMY1$DKA400:           Online               0


In my case `DKA400`. You can find more information by specifying it to the `SHOW
DEV` command:



   $ show device dka400 /full

   Disk REMY1$DKA400:, device type EmuVM CDROM ISO image, is online, file-oriented
       device, shareable, available to cluster, error logging is enabled.

       Error count                    0    Operations completed                268
       Owner process                 ""    Owner UIC                      [SYSTEM]
       Owner process ID        00000000    Dev Prot            S:RWPL,O:RWPL,G:R,W
       Reference count                0    Default buffer size                 512
       Total blocks                 256    Sectors per track                   128
       Total cylinders                1    Tracks per cylinder                   2


Let's try my linux-mindedness and see if mounting is the same. First create a
folder to mount the device on:



   $ CREATE /DIR [.MNT]


Try to mount the device:



   $ MOUNT DKA400 [.MNT]


And nope, no luck this time:



   %MOUNT-I-OPRQST, incorrect volume label
   %MOUNT-I-OPRQST, Please mount volume [.MNT] in device _REMY1$DKA400:


Different variations on this command with the ISO label did not help.

Looking around the OpenVMS `HELP` for mount I found the `OVERRIDE` option.



   $ HELP MOUNT /OVERRIDE


Snipping the relevant part:



    IDENTIFICATION Overrides processing of the volume identifier
                   in the volume label. Use this keyword to mount
                   a volume for which you do not know the label,
                   or for an ISO 9660 volume whose label is not
                   unique in the first 12 characters. Only the volume
                   identifier field is overridden. Volume protection,
                   if any, is preserved. The volume must be mounted
                   /NOSHARE (either explicitly or by default).

                   The /OVERRIDE=IDENTIFICATION qualifier is
                   incompatible with the /GROUP and /SYSTEM
                   qualifiers.


Let's try that since I'm not able to figure out this volume label:



   $ MOUNT /OVERRIDE=IDENT DKA400
   %MOUNT-I-WRITELOCK, volume is write locked
   %MOUNT-I-CDROM_ISO, license: (1 of 1) , mounted on  _REMY1$DKA400:


Lets see if the `SHOW DEV` output shows it as mounted now?



   $ SHOW DEV DKA400 /FULL

   Disk REMY1$DKA400:, device type EmuVM CDROM ISO image, is online, allocated,
       deallocate on dismount, mounted, software write-locked, file-oriented
       device, shareable, available to cluster, error logging is enabled.

       Error count                    0    Operations completed                267
       Owner process           "SYSTEM"    Owner UIC                      [SYSTEM]
       Owner process ID        00000216    Dev Prot            S:RWPL,O:RWPL,G:R,W
       Reference count                2    Default buffer size                 512
       Total blocks                 256    Sectors per track                   128
       Total cylinders                1    Tracks per cylinder                   2

       Volume label           "license"    Relative volume number                1
       Cluster size                   0    Transaction count                     1
       Free blocks                    0    Maximum files allowed                 0
       Extend quantity                0    Mount count                           1
       Mount status             Process    ACP process name           "DKA400CACP"

     Volume Status:  ISO 9660.
     Members of this volume set are REMY1$DKA400: (rvn 1).


So now for the easy part right? Go into the device folder and execute the
script. Can't go wrong here.

But oh yes we can go wrong. Lets see what happens if we `cd` (`SET DEFAULT` on
OpenVMS) into the device:



   $ SET DEFAULT _REMY1$DKA400:
   $ DIR
   %DIRECT-E-OPENIN, error opening REMY1$DKA400:[SYSMGR]*.*;* as input
   -RMS-E-DNF, directory not found
   -SYSTEM-W-BADIRECTORY, bad directory file format


Again an OpenVMS error message. Not sure why, but I guess I did something wrong.

### [000000], the Master File Directory

Diving into some history [][6] we find more on why our previous command did not
work. We did not execute it in the root directory of the device. On OpenVMS a
filesystem's root directory is `[000000]`.

The HP documentation is not very helpfull on this part. I had to go on my local
ebook seller and buy this book since Google Books doesn't allow copy pasting.
But, reading through it, it seems to be a good book for me. Shame it cost me EUR
30\. A few hours of reading later I realised I was busy with an ISO mount.

Quoting verbatim:

> Files11 is the file system used by OpenVMS. As one might imagine, the file
system is that part of an operating system that controls the storage and
manipulation of files.

>

> ODS2 stands for OnDisk Structure, Version 2. It describes the actual layout of
files on the disk, including all control information needed to interpret the
contents of the disk. Later versions of OpenVMS Alpha (and presumably, the
upcoming Itanium version) also support a newer Files11 structure level, ODS5.
ODS2 and ODS5 volumes may exist on the same system, so long as the system is
running a compatible version of OpenVMS.

>

> On ODS2 disks, the toplevel directory is called [000000]. This toplevel
directory is also known as the "MFD," or "Master File Directory."

>

> New users may find it curious that directory listings of the [000000]
directory include the file 000000.DIR. This is because the MFD includes an entry
for itself, making it appear that the MFD "contains itself."

>

> Why Call It 000000?

>

> The unlikelysounding name 000000 has a historical basis. On much older Digital
systems, the directory name for each user took the form [gggmmm], where ggg was
the UIC group number for that user, and mmm was the member number. So,
[000000][7] represented the MFD. (Try it: as of OpenVMS V7.3, the command
DIRECTORY [0,0] still works as a substitute for DIRECTORY [000000] if you have
the appropriate privileges.)

(Duffy, M. (2003). Getting started with openVMS system management: a guide for
(new users. Boston: Digital Press, p. 76-78)

When we execute the command in the correct folder it does show my script:



   $ SET DEF _REMY1$DKA400:[000000]
   $ DIR _REMY1$DKA400:[000000]

   Directory _REMY1$DKA400:[000000]

   A_COM.;1

   Total of 1 file.


### Execute a DCL script

From [the documentation][8]:

> @ (Execute Procedure) Executes a command procedure or requests the command
interpreter to read subsequent command input from a specific file or device.

So no `./` as in linux.

Do specify the version number, otherwise it will fail:



   $ @A_COM
   %DCL-E-OPENIN, error opening REMY1$DKA400:[000000]A_COM.COM; as input
   -RMS-E-FNF, file not found


My license script did fail nontheless:



   $ @A_COM.;1
   %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
    \RODUCT\
   %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
   $\
   %DCL-W-UNDSYM, undefined symbol - check validity and spelling
    \APR\


I re-downloaded my license PAK and created a new ISO. That did not help. I
suspected it had something to do with line endings as I was using Windows to
create the text file. Opening the file with `EDIT` comfirmed my suspicion:

![][9]

### Line endings

A search around the web lead me to the [OpenVMS Wizard][10]. Read the page for
the full answer and explanation. I've snipped the relevant parts here:



   This depends on the current format of the file.  The OpenVMS Wizard
   assumes that the reason for the CR characters is that this is a STREAM
   file copied from Microsoft MS-DOS or Microsoft Windows system, as this
   is a common reason for seeing apparently extraneous CR characters embedded
   within a file.

   RMS recognises three types of stream files:

     1) STREAM_LF - in which records are delimited by an LF character
     2) STREAM_CR - in which records are delimited by a CR character
     3) STREAM    - in which records are delimited by an LF character,
                a CR+LF character pair, or an FF or VT character

   Often, text files from MS-DOS or Windows systems will have records ending
   with a CR+LF pair. When such a file is copied onto a VMS system as a
   STREAM_LF file, the CR character becomes part of the data stream and
   therefore will appear at the end of each record.

   You can check if your file falls into this category with the following
   two commands:

       $ DIRECTORY/FULL filespec

   Check that the Record Format is Stream_LF:

       Record format:      Stream_LF, maximum 0 bytes, longest 0 bytes

   and that the records contain a CR+LF pair. Ensure you dump sufficient
   blocks to see the ends of a number of records

       $ DUMP/BLOCK=COUNT:1 filespec

   31310962 65462031 300A0D38 312E3009 .0.18..01 Feb.11 000020
                     ^^^^

   0A0D is a CR+LF pair (remember that the hex dump reads right to left!).

   If your file satisfies BOTH these conditions, you have two choices for
   removing the CR from your data. The first doesn't actually remove the
   character, it just tells RMS that the CR is part of the record
   delimiter:

       $ SET FILE/ATTRIBUTE=(RFM=STM) filespec

   Note that this does not involve any conversion or copying of data. The
   DIRECTORY/FULL command will now display the record format as:

       Record format:      Stream, maximum 0 bytes, longest 0 bytes

   and applications reading the file will no longer "see" the embedded CR
   character.

   If you really must physically remove the CR character, you can now do
   so with a simple CONVERT command:

       $ SET FILE/ATTRIBUTE=(RFM=STM) filespec
       $ CONVERT/FDL=SYS$INPUT filespec newfilespec
           RECORD
             FORMAT STREAM_LF
       $

   The first command tells RMS that the record relimiter is CR+LF as before.
   The second performs a conversion of the file to STREAM_LF format, so when
   the new file is created, records will be delimited by a single LF character.


Since the CDROM is mounted read only we cannot change the file spec:



   $ SET FILE/ATTRIBUTE=(RFM=STM) A_COM.;1
   %SET-E-READERR, error reading REMY1$DKA400:[000000]A_COM.;1
   -SYSTEM-F-WRITLCK, write lock error


Copy the file over to your home folder:



   $ COPY A_COM.;1 SYS$LOGIN


Change to that folder:



   $ SET DEF SYS$LOGIN


Retry the command, which should work now:



   $ SET FILE/ATTRIBUTE=(RFM=STM) A_COM.;1


In my case, it now looks correct in the editor:

![][11]

But would it actually execute?



   $ @A_COM.;1


Output:



   %SHOW-I-NOLICENSE, no licenses exist
   %LICENSE-I-DISABLED, ACMS has been disabled
   %LICENSE-W-NOENT, no license was loaded for this product - DEC ACMS
   %LICENSE-I-ENABLED, ACMS  has been enabled
   %LICENSE-I-LOADED, DEC ACMS was successfully loaded with 0 units
   %SHOW-I-NOLICMATCH, no licenses match search criteria
   [...]
   %LICENSE-W-NOENT, no license was loaded for this product - DEC X500-DIRECTORY-SERVER
   %LICENSE-I-ENABLED, X500-DIRECTORY-SERVER has been enabled
   %LICENSE-I-LOADED, DEC X500-DIRECTORY-SERVER was successfully loaded with 0 units
   Completion of PAK Load Command File....


Yay! It works and my licenses have been setup.

I can now check my activated licenses:



   $
   $ SHOW LICENSE

   Active licenses on node REMY1:

   ------- Product ID --------    ---- Rating ----- -- Version --
   Product            Producer    Units Avail Activ Version Release    Termination
   ACMS               DEC             0  0     100    0.0  (none)       1-APR-2019
   ACMS-REM           DEC             0  0     100    0.0  (none)       1-APR-2019
   ACMS-RT            DEC             0  0     100    0.0  (none)       1-APR-2019
   [...]
   VMSCLUSTER         DEC             0  0     100    0.0  (none)       1-APR-2019
   VOLSHAD            DEC             0  0     100    0.0  (none)       1-APR-2019
   X25                DEC             0  0     100    0.0  (none)       1-APR-2019
   X25-CLIENT         DEC             0  0     100    0.0  (none)       1-APR-2019
   X500-ADMIN-FACILIT DEC             0  0     100    0.0  (none)       1-APR-2019
   X500-DIRECTORY-SER DEC             0  0     100    0.0  (none)       1-APR-2019


When it's not DNS it's line endings. In this small adventure I learned the
OpenVMS mount command with a few options. Furthermore, it's not only between
Windows and Linux that line-endings cause issues, even in OpenVMS.

  [1]: https://raymii.org/s/inc/img/ovmsdec.png
  [2]: https://raymii.org/s/tags/openvms.html
  [3]: https://raymii.org/s/blog/The_sad_state_of_Alpha_emulators_for_OpenVMS.html
  [4]: https://www.digitalocean.com/?refcode=7435ae6b8212
  [5]: https://raymii.org/s/blog/Installing_the_es40_AlphaServer_emulator_0.18_on_Ubuntu_16.04_and_trying_to_install_openVMS_8.4_on_es40.html
  [6]: https://books.google.nl/books?id=y0qhFDfU0iUC&lpg=PA97&ots=Ay0-FB1rD7&dq=%5B000000%5D%20openvms&hl=nl&pg=PA97#v=onepage&q=%5B000000%5D%20openvms&f=false
  [7]: also%20denoted%20%5B000,000%5D
  [8]: https://web.archive.org/web/20180507185324/http://h41379.www4.hpe.com/doc/84final/9996/9996pro_18.html
  [9]: https://raymii.org/s/inc/img/openvms-license.png
  [10]: https://web.archive.org/web/20180507190424/http://h41379.www4.hpe.com/wizard/wiz_3707.html
  [11]: https://raymii.org/s/inc/img/openvms-license2.png

---

License:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.

This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.

All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.

See https://raymii.org/s/static/About.html for details.