From - Tue Aug 10 21:03:27 1999 Path: reader2.news.rcn.net!feed1.news.rcn.net!rcn!netnews.com!newsfeed.berkeley.edu!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news1.digital.com!pa.dec.com!xdelta!hoffman From: hoffman@xdelta.zko.dec.nospam (Hoff Hoffman) Newsgroups: comp.os.vms,comp.sys.dec,vmsnet.alpha,vmsnet.misc,comp.answers,news.answers Subject: OpenVMS Frequently Asked Questions (FAQ), Part 2/3 Supersedes: <72q2ot$hhq@usenet.pa.dec.com> Followup-To: poster Date: 6 Aug 1999 20:56:45 GMT Organization: Compaq Computer Corporation Lines: 2204 Approved: news-answers-request@mit.edu Distribution: world Expires: 06 February 2000 00:00:00 GMT Message-ID: <7ofi6d$gko@usenet.pa.dec.com> Reply-To: hoffman@xdelta.zko.dec.nospam NNTP-Posting-Host: xdelta.zko.dec.com Summary: This posting contains answers to frequently asked questions about the OpenVMS operating system from Compaq Computer Corporation, and the computer systems on which it runs. X-Newsreader: mxrn 6.18-32 Xref: reader2.news.rcn.net comp.os.vms:239419 comp.sys.dec:80391 vmsnet.alpha:9490 vmsnet.misc:6424 comp.answers:38026 news.answers:167145 Archive-name: dec-faq/vms/part1 Posting-Frequency: bi-monthly Last-modified: 06 August 1999 Subject: OpenVMS Frequently Asked Questions (FAQ), Part 2/3 Newsgroups: comp.os.vms,comp.sys.dec,vmsnet.alpha,vmsnet.misc,comp.answers,news.answers Approved: news-answers-request@mit.edu Followup-to: poster Expires: 31 March 1998 00:00:00 GMT Supersedes: <6pte58$fom@usenet.pa.dec.com> Summary: This posting contains answers to frequently asked questions about the OpenVMS operating system from Digital Equipment Corporation, and the computer systems on which it runs. Archive-name: dec-faq/vms/part2 Posting-Frequency: bi-monthly Last-modified: November 16, 1998 Overview ======== This is part 2/3 of the Frequently Asked Questions (FAQ) posting for the comp.os.vms and vmsnet.misc newsgroups. (comp.os.vms is bidirectionally-gatewayed to the INFO-VAX mailing list - see INTRO3 in part 1 for further details.) It contains answers to frequently asked questions about Digital's OpenVMS operating system and the computer systems on which it runs. This FAQ is archived in the following locations: comp.answers and news.answers newsgroups ftp://ftp.digital.com/pub/Digital/dec-faq/vms ftp://rtfm.mit.edu/pub/usenet/news.answers/dec-faq/vms CompuServe VAXFORUM, Library 0, VMSFAQ.TXT To make suggestions for changes or additions to this Frequently Asked Questions list, send mail to the editor at Steve.Lionel@digital.com. Answers are especially appreciated. Table of Contents - Part 2/3 ____________________________ System Management ======================================== MGMT1. What is an installed image? MGMT2. Are there any known viruses for OpenVMS? MGMT3. How do I mount an ISO-9660 CD on OpenVMS? MGMT4. How do I extract the contents of a PCSI kit? MGMT5. I've forgotten the SYSTEM password - what can I do? MGMT6. How do I connect a PostScript printer via TCP/IP? MGMT7. Why can't I do a SET TIME command? MGMT8. How do I change the timezone differential and time in batch? MGMT9. How do I change the node name of an OpenVMS System? MGMT10. What is the correct value for EXPECTED_VOTES in a VMScluster? MGMT11. Why doesn't OpenVMS see the new memory I just added? MGMT12. How do I write a BACKUP saveset to a remote tape? MGMT13. Tell me about SET HOST/DUP and SET HOST/HSC MGMT14. How do I install DECnet Phase IV on VMS 7.1? MGMT15. How do I change the text in a user's UIC identifier? MGMT16. What are the OpenVMS version upgrade paths? MGMT17. Why do I have negative number in the pagefile reservable pages? MGMT18. Do I have to update layered products when updating OpenVMS? MGMT19. How do I change the volume label of a disk? MGMT20. How do I fix a corrupt BACKUP saveset? MGMT21. How can I set up a shared directory? MAIL ======================================== MAIL1. How do I send Internet mail? MAIL2. How do I get IN% or MX% added automatically to Internet addresses? MAIL3. How do I automatically append a signature file to my mail messages? MAIL4. Do I have to use VMS MAIL? I like my Unix mailer better. MAIL5. How can I forward my mail? Can I forward it to an Internet address? MAIL6. How can I forward my mail to a list of addresses? MAIL7. MAIL keeps saying I have new messages, but I don't. What do I do? MAIL8. How do I extract all of my mail messages to a file? MAIL9. How do I send or read attachments in VMS MAIL? Other Utilities ======================================== UTIL1. How do I play an audio CD on my workstation? UTIL2. How do I access a MS-DOS floppy disk from OpenVMS? UTIL3. How do I play sound files on an AlphaStation? DECsound doesn't work DCL and command usage ======================================== DCL1. How do I run a program with arguments? DCL2. How can I redefine control keys in DCL? DCL3. How can I clear the screen in DCL? DCL4. How do I do a REPLY/LOG in a batch stream? DCL5. How do I generate a random number in DCL? DCL6. What does the MCR command do? DCL7. How do I change the OpenVMS system prompt? DCL8. Can I do DECnet task-to-task communication with DCL? File System and RMS ======================================== FILE1. How can I undelete a file? FILE2. Why does SHOW QUOTA give a different answer than DIR/SIZE? FILE3. How do I make sure that my data is safely written to disk? FILE4. What are the limits on file specifications and directories? FILE5. What is the largest disk volume size OpenVMS can access? FILE6. What is the maximum file size, and the RMS record size limit? FILE7. How do I write recordable CDs on OpenVMS? Programming ======================================== PROG1. How do I call from ? PROG2. How do I get the arguments from the command line? PROG3. How do I get a formatted error message in a variable? PROG4. How do I link against SYS$SYSTEM:SYS.STB on an Alpha system? PROG5. How do I do a SET DEFAULT from inside a program? PROG6. How do I create a shareable image transfer vector on an Alpha system? PROG7. How do I turn my Fortran COMMON into a shareable image on Alpha? PROG8. How do I convert between IEEE and VAX floating data? PROG9. How do I get the argument count in a Fortran routine? PROG10. How do I get a unique system ID for licensing purposes? PROG11. What is an executable, shareable, system or UWSS image? PROG12. How do I do a file copy from a program? PROG13. What is a descriptor? PROG14. How many bytes are in a disk block? PROG15. How many bytes are in a memory page? PROG16. How do I create a process under another username? PROG17. Why do lib$spawn, lib$set_symbol fail in detached processes? PROG18. Where can I obtain Bliss, and the libraries and supporting files? ------------------------------------------------------------ MGMT1. What is an installed image? The term "install" has two distinct meanings in OpenVMS. The first relates to "installing a product", which is done with either the SYS$UPDATE:VMSINSTAL.COM command procedure or the POLYCENTER Software Installation (PCSI) utility (PRODUCT command). The second meaning relates to the use of the INSTALL utility, which is what concerns us here. The INSTALL utility is used to identify to OpenVMS a specific copy of an image, either executable or shareable, which is to be given some set of enhanced properties. For example, when you issue the SET PASSWORD command, the image SYS$SYSTEM:SETP0.EXE is run. That image needs to have elevated privileges to perform its function. The other important attribute is /SHARED. This means that shareable parts of the image (typically read-only code and data) are loaded into memory only once and are shared among all users on a system. Executable images can be installed /SHARED as well as shareable library images. (The term "shareable" has dual meanings here, too. See the OpenVMS Programming Concepts Manual for further details.) It's important to note that there is no such thing as "installing a shareable image with privileges". The INSTALL utility will let you do it, but the privileges you specify will be ignored. To have a callable routine run with enhanced privileges that are not available to its caller, you must construct your routines as "user-written system services" and install the shareable image with the /PROTECT qualifier. See the OpenVMS Programming Concepts Manual for more information on user-written system services. Note also that in many cases the need to grant privileges to an image can be replaced with the use of the "Protected Subsystems" feature that grants a rights identifier to an image. See the OpenVMS Guide to System Security for information on Protected Subsystems. ------------------------------------------------------------ MGMT2. Are there any known viruses for OpenVMS? Viruses are very common on PCs because the PC operating systems such as MS-DOS and MacOS do not implement any sort of scheme to protect the operating system or the file system against hostile action by programs. On these operating systems, any running program can subvert the operating system and take over the hardware, at which point it can do anything it wishes, including hiding copies of itself in other programs or in the file system. This is unlikely on OpenVMS, Unix, and MVS for three reasons. First, the operating system runs in a privileged mode in memory that is protected against modification by normal user programs. Any old program cannot take over the hardware as it can on PC operating systems. Secondly, OpenVMS, Unix, and MVS have file systems that can be set up so that non-privileged programs cannot modify system programs and files on disk. Both of these protection schemes mean that traditional PC virus schemes don't work on these OSes. Third, typical applications and configurations tend to prevent the uncontrolled execution of untrusted code as part of email messages or web access. It is possible for OpenVMS, etc., to be infected by viruses, but to do so, the program containing the virus must be run from a user account that has amplified privileges. As long as the system administrator is careful that only trusted applications are run from such accounts (and this is generally the case), there is no danger from viruses. [Paul Winalski] [Stephen Hoffman] To protect against viruses and other attempts at system interference or misuse, follow the recommendations in the "OpenVMS Guide to System Security". You may also want to consider optional software products which can monitor your system for intrusion or infection attempts. Digital offers the following products in this area: DECinspect Intrusion Detector POLYCENTER Security Reporting Facility POLYCENTER Security Compliance Manager Rocksoft offers the Veracity data integrity tool (for info, send mail to demo@rocksoft.com). [Contributions to this list welcomed] ------------------------------------------------------------ MGMT3. How do I mount an ISO-9660 CD on OpenVMS? ISO-9660 support was added in the following releases: OpenVMS VAX V6.0 OpenVMS AXP V1.5 OpenVMS VAX V5.5, use F11CD kit from InfoServer CD, or Consolidated Distribution CD under InfoServer, or Digital Customer Support - CSCPAT #1071012 Here's how to do it: $ MOUNT/MEDIA_FORMAT=CDROM device-name[:] [volume-label] Please refer to the OpenVMS MOUNT Utility Manual, especially the section regarding the MOUNT qualifier /UNDEFINED_FAT. >From the OpenVMS release notes: Because ISO-9660 media can be mastered from platforms that do not support semantics of files containing predefined record formats, you may encounter ISO-9660 CD-ROMs with files that contain records for which no record format was specified. An example which works for most CD-ROMs is: $ MOUNT/MEDIA_FORMAT=CDROM/UNDEFINED_FAT=STREAM:2048 DUA0: FREEWARE This /UNDEFINED_FAT qualifier states, "For any file whose file attributes are 'undefined', return file attributes of 'stream', maximum record length 2048". [dunham@star.enet.dec.com] ------------------------------------------------------------ MGMT4. How do I extract the contents of a PCSI kit? A growing number of OpenVMS products are being provided in PCSI (POLYCENTER Software Installation) kits which are installed using the PRODUCT INSTALL command. These are alternatives to or replacement for VMSINSTAL kits which were BACKUP savesets. PCSI kits are not BACKUP savesets and are structured differently from VMSINSTAL kits. If you want to extract product files from a PCSI kit, create a directory into which the kit should be expanded and use the following command: $ PRODUCT COPY prodname /SOURCE=[where-the-kit-is] - /DEST=[destination-directory] /FORMAT=REFERENCE A PCSI kit file has a file specification of the following form: DEC-VAXVMS-FORTRAN-V0603-141-1.PCSI In this example, "FORTRAN" is the "prodname". PCSI will expand the kit files into the directory you specify and subdirectories beneath such as [SYSEXE], [SYSLIB], etc., reflecting the eventual destination of files found there. Most of the actual product files (images, etc.) will be in the subdirectories. In the top-level directory will be a file with the file type PCSI$DESCRIPTION that specifies where various files should go. For more details, see the POLYCENTER Software Installation Developer's Guide for OpenVMS, which can be found in the OpenVMS documentation on the Consolidated Online Documentation CD-ROM. ------------------------------------------------------------ MGMT5. I've forgotten the SYSTEM password - what can I do? If you need to break into an OpenVMS system because you do not have access to any privileged passwords, such as the password to the SYSTEM username, you will need physical access to the system console, and you will need to perform a conversational reboot. Here are the steps: 1. Halt the system. Exactly how this is done depends on the specific system model: Depending on the model, this can involve pressing the button, entering on the console, or pressing the key on the console. 2. At the >>> console prompt, use a console command to boot into the SYSBOOT> utility. (SYSBOOT allows conversational changes to system parameters.) The syntax for the conversational bootstrap varies by system model -- this typically involves specifying a flag of 1, for example: VAX: B/1 B/R5:1 @GENBOO Alpha: b -flags 0,1 If your system has a non-zero system root (such as root SYSE, shown here), you will have to use a console command such as the following: VAX: B/E0000001 B/R5:E0000001 @ Alpha: b -flags e,1 If your system has a hardware password (various systems support a password that prevents unauthorized access to the console), you will need to know theis password and will need to enter it using the LOGIN command at the console. If you get an "Inv Cmd" error trying to perform a conversational bootstrap, and you do not have the hardware console password for the console LOGIN command, you are stuck -- you will need to call for hardware service in order to reset the hardware console password. The syntax used for the console password mechanism varies. 3. Once at the SYSBOOT> prompt, request that OpenVMS read the system startup commands directly from the system console, and that OpenVMS not record these parameter changes for subsequent system reboots: SET/STARTUP OPA0: SET WRITESYSPARAMS 0 CONTINUE 4. At the $ prompt, the system will now be accepting startup commands directly from the console. Type the following two DCL commands: SPAWN @SYS$SYSTEM:STARTUP The result of these two commands will be the normal system startup, but you will be left logged in on the console, running under a privileged username. Without the use of the SPAWN command, you would be logged out when the startup completes. 5. Use the following commands to reset the SYSTEM password: SET DEFAULT SYS$SYSTEM: ! or wherever SYSUAF.DAT resides RUN SYS$SYSTEM:AUTHORIZE MODIFY SYSTEM /PASSWORD=newpassword EXIT These steps will change the SYSTEM password to the specified new newpassword password value. Reboot the system normally -- the SYSTEM password should now be set to the value you specified in Step 5. Some people will suggest a method using the UAFALTERNATE SYSGEN parameter. This approach is not always reliable and is not recommended, as there can easily be an alternate user authorization file configured on the system. For further information on emergency startup and shutdown, as well as for the official OpenVMS documentation on how to change the SYSTEM password from the console in an emergency, please see the OpenVMS System Manager's Manual in the OpenVMS documentation set. You can also use the conversational bootstrap technique shown above (the steps through Step 3) to alter various system parameters. At the SYSBOOT> prompt, you can enter new parameters values: SHOW MAXPROCESSCNT SET . 64 CONTINUE The "." is a shorthand notation used for the last parameter examined. [Stephen Hoffman] ------------------------------------------------------------ MGMT6. How do I connect a PostScript printer via TCP/IP? Using UCX as the TCP/IP stack, it is possible to setup queues using the UCX$TELNETSYM in order to print to postscript printers. This assumes however that the printer itself can convert whatever is passed to it into something intelligible. As an example, if the printer has an IP address of 123.456.789.101 and jobs should be passed to port 9100 then : $ INITIALIZE/QUEUE/ON="123.456.789.101:9100"/PROCESSOR=UCX$TELNETSYM - my_ip_queue The port number of 9100 is typical of HP JetDirect cards but may be different for other manufacturers cards. As a better alternative, DCPS Version 1.4 and later support IP queues using either Digital TCP/IP Services for OpenVMS software or Cisco Multinet for OpenVMS. The usage of this type of interface is documented in the Release Notes and the DCPS$STARTUP.TEMPLATE file. [Steve Reece] [Arne Vajhøj] ------------------------------------------------------------ MGMT7. Why can't I do a SET TIME command? Q: Trying to set the time with SET TIME on my system returns one of these messages: %SET-E-NOTSET, error modifying time -SYSTEM-F-IVSSRQ, invalid system service request %SET-E-NOTSET, error modifying time -SYSTEM-E-TIMENOTSET, time service enabled; enter a time service command to update the time A: This occurs if the time on the local system is controlled by a time service software, for example the distributed time service software (DTSS) provided as part of the DECnet/OSI installation. The DTSS software communicates with one or more time servers to obtain the current time. It entirely controls the local system time (for DECnet/OSI, there is a process named DTSS$CLERK for this); therefore, the usage of the SET TIME command (and the underlying $SETTIM system service) is disabled. The first message is displayed on systems running DECnet/OSI V6.1 and earlier. On systems with newer DECnet/OSI (DECnet-Plus) software, the second (and more informative) message is given. You shouldn't have to change the time manually - you should be doing this through the time server - but if you insist... you'll have to shutdown DTSS: $ MCR NCL NCL> DISABLE DTSS NCL> DELETE DTSS This will shutdown DTSS$CLERK. You may then change the system time as usual. To restart the DTSS software, type @SYS$STARTUP:DTSS$STARTUP You'll need a lot of privs : (CMKRNL,SYSPRV,OPER,SYSNAM,PRMMBX,NETMBX,LOG_IO, ALTPRI) and must be granted the NET$MANAGE identifer to shutdown and restart DTSS. [bol@adv.magwien.gv.at] ------------------------------------------------------------ MGMT8. How do I change the timezone differential and time in batch? To change the timezone differential and the time when the change to/from Daylight Saving Time (DST) occurs, use SYS$MANAGER:UTC$CONFIGURE_TDF.COM. To use this as batch job, please note: P1 = SET, set the time. P2 = signed timezone differential from UTC in minutes. -360 for standard time (for Chicago) -300 for DST (for Chicago) P3 = signed time change in minutes. If +, enclose in quotes. -60 to go from DST to standard time "+60" to go from standard time to DST Going from standard time to DST (for Chicago): $ SUBMIT/AFTER="+02:00" SYS$MANAGER:UTC$CONFIGURE_TDF - /PAR=(SET,-300,"+60") Going from DST to standard time (for Chicago): $ SUBMIT/AFTER="+02:00" SYS$MANAGER:UTC$CONFIGURE_TDF - /PAR=(SET,-360,-60) If you use this com file interactively, the times are given as signed hour:minute, so that -360 minutes is given as -6:00. Before and after the com file runs, check the system time and the logical SYS$TIMEZONE_DIFFERENTIAL. The logical has the offset from UTC in seconds. Current DST rules for some countries: 1. United States and Canada: DST begins on the first Sunday of April (2am => 3am) DST ends on the last Sunday of October (2am => 1am) 2. UK, France, Germany, Spain: DST begins on the last Sunday of March (2am => 3am) DST ends on the last Sunday of October (3am => 2am) 3. Australia: DST begins on the last Sunday of October (2am => 3am) DST ends on the last Sunday of March (2am => 1am) 4. Singapore: No DST change [Dale Dellutri] ------------------------------------------------------------ MGMT9. How do I change the node name of an OpenVMS System? The first step is to get a BACKUP of the system disk before making any changes -- use the system disk backup procedures as documented in the OpenVMS System Management Manual, making sure to use the procedures and commands appropriate for the system disk. Changing the node name involves a number of steps -- the node name tends to be imbedded in a number of different data files around the system. Update the SCSNODE in MODPARAMS.DAT, and then run AUTOGEN as far as the SETPARAMS phase. (Do not reboot yet.) Modify the DECnet node name. (NETCONFIG is the DECnet Phase IV tool, and NET$CONFIGURE is the DECnet-Plus tool.) Modify the IP node name. (The UCX tool is UCX$CONFIG.) Modify the host node name on the various queues in the queue database. (each queue has a host name, and it defaults to the SCS node name of the queue's host system. See the command INIT/QUEUE/ON=node for information.) Modify the node name saved in any application databases, or any local node-conditional operations present in the site-specific system startup, etc. (SEARCH for the node name, specifying all types of files.) Rename the SYS$NODE_oldnodename rightslist identifier to match the new name. (Do not change the binary value of this identifier.) Reset any license PAKs that are restricted to the old node name to the new node name. If the node name is part of a disk volume label, see MGMT19. Reboot the node or -- if in a VMScluster -- reboot the whole VMScluster. (This tends to catch any errors immediately.) There are likely a few other areas where the nodename will be stored. If the system is configured in a VMScluster and you change *either* the SCSNODE or the SCSSYSTEMID -- but *not* both values -- then you will have to reboot the entire VMScluster. (The VMScluster remembers the mapping between these two values, and will assume that a configuration problem has occured if a mismatched pair appears, and will refuse to let a node with a mismatched pair join the VMScluster.) I expect I may have missed one or two configuration tools (or more!) that are needed at your site -- the node name tends to get stored all over the place, in layered products, and in local software... [Stephen Hoffman] ------------------------------------------------------------ MGMT10. What is the correct value for EXPECTED_VOTES in a VMScluster? The VMScluster connection manager uses the concept of votes and quorum to prevent disk and memory data corruptions -- when sufficient votes are present for quorum, then access to resources is permitted. When sufficient votes are not present, user activity will be blocked. The act of blocking user activity is called a "quorum hang", and is better thought of as a "user data integrity interlock". This mechanism is designed to prevent a partitioned VMScluster, and the resultant massive disk data corruptions. On each OpenVMS node in a VMScluster, one sets two values in SYSGEN: VOTES, and EXPECTED_VOTES. The former is how many votes the node contributes to the VMScluster. The latter is the total number of votes expected when the full VMScluster is bootstrapped. Some sites erroneously attempt to set EXPECTED_VOTES too low, believing this will allow when only a subset of voting nodes are present in a VMScluster. It does not. Further, an erroneous setting in EXPECTED_VOTES is automatically corrected once VMScluster connections to other nodes are established, meaning user data is at risk of severe corruption only during the initial system bootstrap. One can operate a VMScluster with one, two, or many voting nodes. With any but the two-node configuration, keeping a subset of the nodes active when some nodes fail can be easily configured. With the two-node configuration, one must use a primary-secondary configuration (where the primary has all the votes), a peer configuration (where when either node is down, the other hangs), or (preferable) a shared quorum disk. Use of a quorum disk does slow down VMScluster transitions somewhat -- the addition of a third voting node that contributes the vote(s) that would be assigned to the quorum disk makes for faster transitions -- but the use of a quorum disk does mean that either node in a two-node VMScluster configuration can operate when the other node is down. In a two-node VMScluster with a shared storage interconnect, typically each node has one vote, and the quorum disk also has one vote. EXPECTED_VOTES is set to three. Using a quorum disk on a non-shared interconnect is unnecessary -- the use of a quorum disk does not provide any value, and the votes assigned to the quorum disk should be assigned to the OpenVMS host serving access to the disk. For information on quorum hangs, see the OpenVMS documentation. For information on changing the EXPECTED_VOTES value on a running system, see the SET CLUSTER/EXPECTED_VOTES command, and see the OpenVMS system console documentation for the processor-specific console commands used to trigger the IPC (Interrrupt Priority Level %x0C; IPL C) handler. The IPC handler can be used to clear a quorum hang, and to clear disk mount verification hangs. [Stephen Hoffman] ------------------------------------------------------------ MGMT11. Why doesn't OpenVMS see the new memory I just added? When adding memory to an OpenVMS system, one should check for an existing definition of the PHYSICALPAGES (OpenVMS VAX) or PHYSICAL_MEMORY (OpenVMS Alpha) parameter in the SYS$SYSTEM:MODPARAMS.DAT parameter database, use a text editor to reset the value in the file to the new correct value as required, and then perform the following command: $ @SYS$UPDATE:AUTOGEN GETDATA REBOOT FEEDBACK This AUTOGEN command will reset various system parameters based on recent system usage (FEEDBACK), and it will reset the value for the PHYSICALPAGES parameter to the new value. It will also reboot the OpenVMS system. PHYSICALPAGES and PHYSICAL_MEMORY can also be used to deliberately lower the amount of memory available for use by OpenVMS. This ability can be useful in a few specific circumstances, such as testing the behaviour of an application in a system environment with a particular (lower) amount of system memory available. PHYSICALPAGES and PHYSICAL_MEMORY can be set to -1, to indicate that all available memory should be used. [Stephen Hoffman] ------------------------------------------------------------ MGMT12. How do I write a BACKUP saveset to a remote tape? How to do this correctly was described at DECUS a long time ago. On the node with the tape drive, create SAVE-SET.FDL: RECORD FORMAT fixed SIZE 8192 Then create BACKUP_SERVER.COM: $ ! $ ! BACKUP_SERVER.COM - provide remote tape service for BACKUP. $ ! $ set verify $ set noon $ define mu $90$mua93: ! or whatever your real tape drive is $ set rms/network=16 $ mount/nounl/over:id/block=8192 mu: $ convert/fdl=SAVE-SET sys$net mu:save-set. $ dismount/unl mu: $ set noverify On the node where you want to do the backup, do: $ BACKUP input-spec node::"TASK=BACKUP_SERVER" /BLOCK=8192 The only thing that doesn't completely work here is multi-reel savesets. Since the tape is being written through RMS and the magtape ACP, BACKUP won't see the reel switch and will split an XOR group across the reel boundary. As far as I remember, BACKUP will be willing to read such a multi-reel save set (directly, not over the net) since the XOR blocks are simply ignored on read, but it definitely wouldn't be able to do a recovery across the reel boundary. Unfortunately BACKUP can't read tapes over the network because the RMS file attributes on a network task access look wrong (variable length records). [Stephen Hoffman] ------------------------------------------------------------ MGMT13. Tell me about SET HOST/DUP and SET HOST/HSC The OpenVMS DCL commands SET HOST/DUP and SET HOST/HSC are used to connect to storage controllers via the Diagnostics and Utility Protocol (DUP). These commands require that the FYDRIVER device driver be connected. This device driver connection is typically performed by adding the following command(s) into the system startup command procedure: On OpenVMS Alpha: $ RUN SYS$SYSTEM:SYSMAN SYSMAN> IO CONNECT FYA0/NOADAPTER/DRIVER=SYS$FYDRIVER On OpenVMS VAX: $ RUN SYS$SYSTEM:SYSGEN SYSGEN> CONNECT FYA0/NOADAPTER Alternatives to the DCL SET HOST/DUP command include the console >>> SET HOST command available on various mid- to recent-vintage VAX consoles: Access to Parameters on an Embedded DSSI controller: >>> SET HOST/DUP/DSSI[/BUS:{0:1}] dssi_node_number PARAMS Access to Directory of tools on an Embedded DSSI controller: >>> SET HOST/DUP/DSSI[/BUS:{0:1}] dssi_node_number DIRECT Access to Parameters on a KFQSA DSSI controller: >>> SHOW UQSSP ! to get port_controller_number PARAMS >>> SET HOST/DUP/UQSSP port_controller_number PARAMS These console commands are available on most MicroVAX and VAXstation 3xxx series systems, and most (all?) VAX 4xxx series systems. For further information, see the system documentation and -- on most VAX systems -- see the console HELP text. EK-410AB-MG, _DSSI VAXcluster Installation and Troubleshooting_, is a good resource for setting up a DSSI VMScluster on OpenVMS VAX nodes. (This manual predates coverage of OpenVMS Alpha systems, but gives good coverage to all hardware and software aspects of setting up a DSSI-based VMScluster -- and most of the concepts covered are directly applicable to OpenVMS Alpha systems. This manual specifically covers the hardware, which is something not covered by the standard OpenVMS VMScluster documentation.) [Stephen Hoffman] ------------------------------------------------------------ MGMT14. How do I install DECnet Phase IV on VMS 7.1? On OpenVMS V7.1, all DECnet binaries were relocated into separate installation kits -- you can selectively install the appropriate network: DECnet-Plus (formerly known as DECnet OSI), DECnet Phase IV, and DIGITAL TCP/IP Services (often known as UCX). On OpenVMS versions prior to V7.1, DECnet Phase IV was integrated, and there was no installation question. You had to install the DECnet-Plus (DECnet OSI) package on the system, after the OpenVMS upgrade or installation completed. During an OpenVMS V7.1 installation or upgrade, the installation procedure will query you to learn if DECnet-Plus should be installed. If you are upgrading to V7.1 from an earlier release or are installing V7.1 from a distribution kit, simply answer "NO" to the question asking you if you want DECnet-Plus. Then -- after the OpenVMS upgrade or installation completes -- use the PCSI PRODUCT INSTALL command to install the DECnet Phase IV binaries from the kit provided on the OpenVMS software distribution kit. If you already have DECnet-Plus installed and wish to revert, you must reconfigure OpenVMS. You cannot reconfigure the "live" system, hence you must reboot the system using the V7.1 distribution CD-ROM. Then select the DCL ($$$ prompt) option. Then issue the commands: $$$ DEFINE/SYSTEM PCSI$SYSDEVICE DKA0: $$$ DEVINE/STSTEM PCSI$SPECIFIC DKA0:[SYS0.] $$$ PRODUCT RECONFIGURE VMS /REMOTE/SOURCE=DKA0:[VMS$COMMON] The above commands assume that the target system device and system root are "DKA0:[SYS0.]". Replace this with the actual target device and root, as appropriate. The RECONFIGURE command will then issue a series of prompts. You will want to reconfigure DECnet-Plus off the system, obviously. You will then want to use the PCSI command PRODUCT INSTALL to install the DECnet Phase IV kit from the OpenVMS distribution media. Information on DECnet support, and on the kit names, is included in the OpenVMS V7.1 installation and upgrade documentation. [Stephen Hoffman] ------------------------------------------------------------ MGMT15. How do I change the text in a user's UIC identifier? The text translations of the numeric User Identification Code (UIC) are based on identifiers present in the OpenVMS rightslist. Documentation on this area is included in the _Guide to OpenVMS System Security_ manual. To control the identifiers shown for a user's UIC, you use AUTHORIZE. Each user has an associated group identifier, and an identifier specific to the user. And each user should have a unique UIC. To alter the text of a user or group identifier, use commands such as: $ RUN SYS$SYSTEM:AUTHORIZE UAF> rename/ident oldgroupid newgroupid UAF> rename/ident olduserid newuserid If you should find yourself missing an identifier for a particular user, you can add one for the user's UIC using a command such as: UAF> add/ident/value=uic=[group,user] newuserid The UIC user identifier text is assigned when the username is created, and is the text of the username. The UIC group group identifier is assigned when the first username is created in the UIC group, and the text is based on the account name specified for the first user created in the group. The value of this identifier is [groupnumber, 177777]. To add a missing group identifier, use an asterisk as follows: UAF> add/ident/value=uic=[group,*] newgroupid You may find cases where an identifier is missing from time to time, as there are cases where the creation of a UIC group name identifier might conflict with an existing username, or a user identifier might conflict with an existing group identifier. When these conflicts arise, the AUTHORIZE utility will not create the conflicting group and/or user identifier when the username is created. You can can add and remove user-specified identifiers, but you should avoid changing the numeric values associated with any existing identifiers. You should also avoid reusing UICs or identifiers when you add new users, as any existing identifiers that might be present on objects in the system from the old user will grant the same access to the new user. Please see the security manual for details. ------------------------------------------------------------ MGMT16. What are the OpenVMS version upgrade paths? Note: See "OpenVMS Alpha Terminology" section, below. OpenVMS Alpha release upgrade (or update) paths: From V1.0, one can upgrade to V1.5. From V1.5, or V1.5-1H1, one can upgrade to V6.1. From V6.1, one can upgrade to V6.2. From V6.2, one can update to V6.2-1H1, V6.2-1H2, or V6.2-1H3. From V6.1, or V6.2, one can upgrade to V7.0. From V6.1, V6.2, V6.2-1H(1,2,3), or V7.0, one can upgrade to V7.1. From V7.1, one can update to V7.1-1H(1,2), V7.1-2, V7.2, V7.2-1 Some typical OpenVMS Alpha upgrade (or update) paths are: V1.0 -> V1.5 -> V6.1 -> (V6.2, V7.0, V7.1, V7.2) V6.1 -> V7.2 V6.2 -> V6.2-1H3 V1.5-1H1 -> V6.1 -> (V6.2, V7.0, V7.1, V7.2) V6.2-1H(1,2,3) -> V7.1 V7.1 -> V7.1-1H(1,2) V7.1 -> V7.1-2 V7.1 -> V7.2-1 Note that OpenVMS Alpha V7.0 does not include support for hardware and/or configurations first supported in OpenVMS Alpha V6.2-1H1, V6.2-1H2, or V6.2-1H3; one must upgrade to OpenVMS VAX V7.1. One cannot update directly to a V6.2-1Hx Limited Hardware Release (LHR) from any release prior to the baseline V6.2 release. The same prohibition holds for performing updates directly to V7.1-1Hx from any release prior to V7.1 -- this is not supported, and does not produce the expected results. The LHR kits can, however, be directly booted and can be directly installed, without regard to any operating system that might be present on the target disk. OpenVMS Alpha updates for LHRs (through V7.1-1Hx) require the use of VMSINSTAL for the update. These LHR releases use PCSI for the installation, but not for the update. Non-LHR releases use PCSI for installs and upgrades. OpenVMS Alpha V7.1-2 and later use PCSI for LHRs and for OpenVMS upgrades and for all OpenVMS ECO kit installations. VMSINSTAL OpenVMS ECO kits are not used on OpenVMS Alpha V7.1-2 and later. Prior to V7.1-2, VMSINSTAL-based ECO kits are used for OpenVMS. OpenVMS VAX release upgrade paths: From V5.0 through V5.4-3 inclusive, one can upgrade to V5.5. From V5.5, V5.5-1, or V5.5-2HW, one can upgrade to V5.5-2. From V5.5, V5.5-1, or V5.5-2, one can upgrade to V6.0. From V5.5-2, V5.5-2H4, or V6.0, one can upgrade to V6.1. From V6.0, or V6.1, one can upgrade to V6.2. From V6.1, or V6.2, one can upgrade to V7.0. From V6.1, V6.2, or V7.0, one can upgrade to V7.1. From V6.1, one can upgrade to V7.2 (with VAXBACK ECO for V6.1). Some typical OpenVMS VAX upgrade paths are: V5.x -> V5.5 -> V6.0 -> V6.2 -> (V7.0, or V7.1) V5.5-2, or V5.5-2H4 -> V6.1 -> (V6.2, V7.0, or V7.1) V6.1 -> VAXBACK V6.1 ECO -> V7.2 V6.2 -> V7.2 Note that OpenVMS VAX V6.0 does not include support for hardware and/or configurations first added in OpenVMS VAX V5.5-2H4, one must upgrade to OpenVMS VAX V6.1. OpenVMS Cluster Rolling Upgrades: Rolling Upgrades require multiple system disks. Rolling upgrades permit the OpenVMS Cluster to remain available while individual systems are being upgraded to a new OpenVMS release. OpenVMS Cluster rolling upgrades for both OpenVMS VAX and OpenVMS Alpha may (will) have different, or additional upgrade requirements, and have requirements around which versions of OpenVMS can coexist in a OpenVMS Cluster than what is listed here. See the _OpenVMS Version Upgrade and Installation Manual_, and the OpenVMS Software Product Descriptions (http://www.openvms.digital.com/openvms/spd/list.html) for further details on the rolling upgrade, and for support information. The documentation for older releases of OpenVMS VAX includes various platform-specific manuals, manuals that include instructions that are specific to installing and upgrading on the platform. Layered Product and Support Information: For information on Prior Version support, see: http://www.compaq.com/services/software/ss_mature.html For information on supported versions of layered products, and minimum required layered product versions, see: http://www.openvms.digital.com/openvms/os/swroll/index.html For information on the release history of OpenVMS, including information on the code names of various releases and the major features: http://www.openvms.digital.com/openvms/os/openvms-release-history.html Additional release history information, as well as a variety of other trivia, is available in the VAX 20th anniversary book: http://www.openvms.digital.com/openvms/20th/vmsbook.pdf OpenVMS Alpha Terminology: update: Typically used for Limited Hardware Releases (LHR) releases. Performed via VMSINSTAL. Applies only to the OpenVMS release that the LHR is based on, or to an intermediate LHR. (eg: V7.1-1H2 applies only to V7.1-1H1 and to V7.1, not to any other releases.) LHRs within a series are cumulative, containing all files and features of previous LHRs in the same series. upgrade: Performed via PCSI. Upgrades can typically be applied to a release-specific (and documented) range of prior OpenVMS releases. install: Performed via PCSI. With an installation, no existing version of the operating system is assumed present, nor are any files from any copy of the operating system might be present preserved, and the entire contents of the target disk are destroyed via a disk initialization. preserve: Performed via PCSI. Otherwise similar to an installation, this option skips the disk reinitialization. User files on the target disk are preserved. Any existing operating system files on the target disk are clobbered. LHR: Limited Hardware Release. LHRs are specific to and are targeted at new hardware configurations, and are not shipped to customers with support contracts. At least one LHR kit must be specifically acquired when purchasing new hardware, new hardware that is not (yet) supported by any mainline (non-LHR) release. LHRs have an "H" in the OpenVMS version string, indicating a "Hardware" release. ------------------------------------------------------------ MGMT17. Why do I have negative number in the pagefile reservable pages? Seeing a negative number in the reservable pages portion of the SHOW MEMORY/FULL command can be normal and expected, and is (even) documented behaviour. A pagefile with a negative number of reservable pages is overcommitted, which is generally goodness assuming that every process with reserved pages does not try to occupy all of the reserved pagefile space at the same time. To understand how the pagefile reservation process works, think about how a traditional bank operates when accepting customer deposits and making loans. It's the same idea with the pagefile space. There is less money in the bank vault than the total deposits, because much of the money has been loaned out to other customers of the bank. And the behaviour parallels that of the pagefile down to the problems that a "run on the bank" can cause for banking customers. (Though there is no deposit insurance available for pagefile users.) If all of the running applications try to use the reserved space, the system manager will need to enlarge the pagefile or add one or more additional pagefules. To determine if the pagefile is excessively overcommitted, watch for "double overcommitment" -- when the reservable space approaches the negatation of the available total space -- and watch that the total amount of free space available in the pagefile remains adequate. If either of these situations arises, additional pagefile storage is required. Additional pagefile information: Additional pagefiles can typically be created and connected on a running OpenVMS system. New processes and new applications will tend to use the new pagefile, and existing applications can be restarted to migrate out of the more congested pagefiles. Pagefiles are generally named PAGEFILE.SYS, and multiple pagefiles are generally configured on separate disk spindles to spread the paging I/O load across the available disk storage. When multiple pagefiles are present on recent OpenVMS versions, each pagefile file should be configured to be approximately the same total size as the other pagefiles. For additional information on pagefile operations and related commands, see the system management and performance management manuals in the OpenVMS documentation set. [Stephen Hoffman] ------------------------------------------------------------ MGMT18. Do I have to update layered products when updating OpenVMS? The Software Public Rollout Reports for OpenVMS list the current and future availability of Compaq's software products shipping on the Software Products Library kits (CDROM consolidations) for OpenVMS Alpha and OpenVMS VAX. Specifically, the required minimum versions for product support are listed. Comprehensive Public Rollout Information, listing previous product versions as well as currently shipping versions, has been compiled into a separate set of reports. The product information is grouped to show Operating System support. You may or may not be able to use older versions of local applications, third-party products, and various Compaq layered products with more recent versions of OpenVMS. User-mode code is expected to be upward compatible. Code executing in a privileged processor mode -- typically either executive or kernel mode -- may or may not be compatible with more recent OpenVMS versions. These reports are updated monthly. Please see: http://www.openvms.digital.com/openvms/os/swroll/index.html [Stephen Hoffman] ------------------------------------------------------------ MGMT19. How do I change the volume label of a disk? Dismount the disk, and mount it privately. If the disk is mounted by more than one node in an OpenVMS Cluster, dismount it from all other nodes. If this disk is an OpenVMS system disk, shut down all other nodes that are bootstrapped from this disk. Issue the SET VOLUME/LABEL command, specifying the new label. On OpenVMS V6.0 and later, issue the following PCSI command: $ PRODUCT REGISTER VOLUME To reset the label information stored in the PCSI database to reflect the new disk volume label. Locate any references in the system startup (typically including the disk MOUNT commands) and any DISK$label references in application files, and change the references appropriately. Remount the disk appropriately. [Stephen Hoffman] ------------------------------------------------------------ MGMT20. How do I fix a corrupt BACKUP saveset? BACKUP savesets can be corrupted by FTP file transfers and by tools such as zip (particularly when the zip tool has not been asked to save and restore OpenVMS file attributes or when it does not support OpenVMS file attributes), as well as via other means of corruptions. If you have problems with the BACKUP savesets after unzipping them or after an FTP file transfer, you can try restoring the appropriate saveset attributes using the tool: $ @RESET_BACKUP_SAVESET_ATTRIBUTES.COM This tool is available on the OpenVMS Freeware (in the [000TOOLS] directory). The Freeware is available at various sites -- see the Freeware location listings elsewhere in the FAQ -- and other similar tools are also available from various sources. In various cases, the following command might work: $ SET FILE/ATTRIBUTES=(RFM:FIX,MRS:32256,LRL:32256,RAT:NONE) file.bck [Stephen Hoffman] ------------------------------------------------------------ MGMT21. How can I set up a shared directory? To set up a shared directory -- where all files created in the directory are accessable to the members of specified group of users -- you can use an access control list (ACL) and an identifier. The following also shows how to set up a resource identifier, which further allows the disk resources to be charged to the specified identifier rather than each individual user. (If you don't want this, then omit the attributes option on the identifier creation and omit the entry added in the disk quota database. Add an identifier using AUTHORIZE: ADD/IDENTIFER/ATTRIBUTES=RESOURCE groupidentifier Grant the identifier to each user in the group using AUTHORIZE: GRANT/IDENTIFIER groupidentifier username If disk quotas are in use, add an entry via SYSMAN for each disk: DISKQUOTA ADD groupidentifier/PERMQUOTA=pq/OVERDRAFT=od/DEVICE=ddcu: Set the shared directory to have an ACL similar to the following using the SET SECURITY (V6.0 and later) or SET ACL (versions prior to V6.0) command: (DEFAULT_PROTECTION,S:RWED,O:RWED,G,W) (IDENTIFIER=groupidentifier,OPTIONS=DEFAULT,ACCESS=READ+WRITE+EXECUTE+DELETE) (IDENTIFIER=groupidentifier,ACCESS=READ+WRITE+EXECUTE+DELETE) (CREATOR,ACCESS=READ+WRITE+ACCESS+DELETE) If there are files already resident in the directory, set their protections similarly. (The OPTIONS=DEFAULT, DEFAULT_PROTECTION, and CREATOR ACEs apply to directories.) The default protection mask is used to establish the default file protection mask, this mask does not prevent the users holding the specified groupidentifier from accessing the file(s), as they can access the file via the explicit identifier granting access that is present in the ACL. For further information, see the OpenVMS Guide to System Security Manual, specifically the sections on ACLs and identifiers, and resource identifiers. ------------------------------------------------------------ MGMT22. Why does my system halt when I powercycle the console terminal? ------------------------------------------------------------ MAIL1. How do I send Internet mail? There is no one answer to this question. Internet mail is built upon the TCP/IP protocols, which are not directly supported by VMS. A number of implementations of TCP/IP for VMS are available, from Digital, from a number of other vendors, and even in a free "support it yourself" form. The MAIL program that comes with VMS does not directly support the mail format used on the Internet, but various programs have been written that use MAIL's "foreign protocol" facility to provide such support. To send mail through a foreign protocol by using an address syntax like IN%"fred@fred-host.xxx.com". You *must* include the quotation marks Between them is the address in the format used by mail programs that support the Internet directly. The IN% - short for INternet - names the foreign protocol. On some systems, you use MX% or SMTP% instead. (MX is a widely used, free, mail handler; see question SOFT1. SMTP% is used by Digital's UCX TCP/IP product) Other systems may use some other name. If none of these prefixes work, ask your system manager for assistance. [leichter@lrw.com] See also MAIL2. ------------------------------------------------------------ MAIL2. How do I get IN% or MX% added automatically to Internet addresses? Get the MAILSHR_PATCH package (there's one each for VAX and Alpha) from the WKU FILESERV server (see question SOFT1.) As of OpenVMS V6.2, this is not necessary - if the address has an @ in it (not in a quoted string), MAIL will look to see if the logical name MAIL$INTERNET_TRANSPORT is defined. If it is, it will use the translation as the transport protocol, otherwise it will use SMTP (as is used by UCX). For example, if you wanted IN% added, you'd define MAIL$INTERNET_TRANSPORT as "IN". ------------------------------------------------------------ MAIL3. How do I automatically append a signature file to my mail messages? OpenVMS 7.0 adds the ability to automatically append signature files - in MAIL, use the SET SIGNATURE command to specify a signature file name. For earlier versions, see the following paragraphs. The basic MAIL utility which is shipped with VMS does not have an intrinsic mechanism for adding signature files. If you're using an enhanced mail handling package (e.g PMDF), however, it may have provisions for adding signature files to all messages it handles - check the documentation for details. In addition, it's common practice to use an editor to handle addition of `quotation marks' (e.g. >) and signature files to mail messages and news postings. There are several implementations of this for different editors available on the net; for one example, see the MAIL_EDIT package available at ftp://narnia.memst.edu/mail_edit_v1-4.zip [bailey@genetics.upenn.edu] Define the logical MAIL$EDIT to a COM-file, which looks something like the following: $ IF P1 .NES. "" $ THEN $ COPY 'P1', 'P2' $ ELSE $ COPY 'P2' $ ENDIF $ DEFINE/NOLOG SYS$INPUT SYS$COMMAND $ 'P2' $ EXIT Where is the name of the signature-file (including directory and disk) and is EDIT/EDT or EDIT/TPU (or your favorite editor). [Arne Vajhøj] ------------------------------------------------------------ MAIL4. Do I have to use VMS MAIL? I like my Unix mailer better. Several Unix mailers have been ported to VMS, some by the vendors of specific TCP/IP packages, some by users who have made them freely available. See the documentation for your TCP/IP package, and refer to question SOFT1 for information about the availability of the free ports. [Jerry Leichter] ------------------------------------------------------------ MAIL5. How can I forward my mail? Can I forward it to an Internet address? You can use the SET FORWARD command within MAIL to specify where you want all your mail forwarded to. Use SHOW FORWARD to see your current forwarding. To cancel all forwarding, type SET NOFORWARD. You can forward your mail to an Internet address, but you have to be careful because of the way MAIL handles special characters, such as quotation marks. First, determine the address you would use to send mail to the place you want to forward to - say, IN%"fred@fred-host.xxx.com". Take that string and *double all the quotation marks*, producing IN%""fred@fred-host.xxx.com"". Finally, wrap quotation marks around the outside and use the the result with SET FORWARD: MAIL>SET FORWARD "IN%""fred@fred-host.xxx.com""" If you do SHOW FORWARD, you should now see: Your mail is being forwarded to IN%"fred@fred-host.xxx.com". [leichter@lrw.com] Note that the MAIL$INTERNET_TRANSPORT feature doesn't yet work with SET FORWARD in that you'll still have to use the syntax above with the quotation marks. ------------------------------------------------------------ MAIL6. How can I forward my mail to a list of addresses? VMS MAIL does not support forwarding a message to more than one address. (Older versions of MAIL allowed you to specify such forwarding, but it never worked correctly.) Many of the TCP/IP mail packages support forwarding to mailing lists, as does the free MX mail handling system and the DELIVER mail "extender". See the documentation of your TCP/IP package and question SOFT1. [leichter@lrw.com] ------------------------------------------------------------ MAIL7. MAIL keeps saying I have new messages, but I don't. What do I do? The count of new mail messages is kept separately from your mail folder in SYS$SYSTEM:VMSMAIL_PROFILE.DATA. It sometimes happens that this count differs from what's in your mail folder. If this happens, go into MAIL and repeat the READ/NEW command until you see no new mail messages. Then enter the command one more time. This will resynchronize the counters. ------------------------------------------------------------ MAIL8. How do I move all of my mail messages to another system? If you are moving to another OpenVMS system, perhaps the best way is to select each folder and do (in MAIL) a: EXTRACT/APPEND/ALL/MAIL mymail.mai Move MYMAIL.MAI to the other system, then do this (in MAIL): SET FILE mymail.mai COPY/ALL foldername MAIL.MAI This will place a copy of all of your messages in the given folder. If you wanted to maintain the separate folders, do separate EXTRACT commands (above) specifying different .mai files, then repeat the SET FILE, COPY for each one. If you are moving to a non-OpenVMS system, the EXTRACT command above can be used to create a file which you can then copy - how you import it into your mailer is an exercise left to the reader. ------------------------------------------------------------ MAIL9. How do I send or read attachments in VMS MAIL? Is there any way to send or read mail with files as attachments from VMS? Not directly with the OpenVMS MAIL facility, but there are several other options: 1. Install PINE, available commercially from Innosoft (www.innosoft.com) or free from Andy Harper (ftp://ftp2.kcl.ac.uk/zip). With PINE you can both send and read,if you have the appropriate viewers, MIME mail. 2. If you're working from an X11 server use the OpenVMS version of Netscape Navigator. This option is ok for sending mail, but is not optimal for reading it, since Netscape will use POP and remove messages entirely the OpenVMS MAIL system, which is not generally what you want. 3. MPACK/MUNPACK. To send a MIME mail, construct the message with attachments manually using MPACK. You cannot send the resulting file directly through MAIL because an extra blank header line will be inserted between your message and the OpenVMS MAIL headers, which will cause the message to appear as plain text in most mail programs. Some TCP/IP stacks provide a work around for this problem, and if that doesn't work, you should generally be able to force the message directly into the SMTP port of your mail machine. Examples of both methods are in: http://seqaxp.bio.caltech.edu/pub/SOFTWARE/mmail.com To read a MIME mail message, open it in MAIL, extract it to a file, then use MUNPACK to break out and decode the attachments. [David Mathog] ------------------------------------------------------------ UTIL1. How do I play an audio CD on my workstation? If you've installed the DECwindows examples, you'll find DECW$CDPLAYER.C, .DAT, .EXE, .UIL, and .UID. Copy the .UID and .DAT files to DECW$USER_DEFAULTS: (typically SYS$LOGIN:), define the logical name DECW$CD_PLAYER to be the device name of your CD-ROM drive (eg. DKA400:), give yourself PHY_IO and DIAGNOSE privileges, and run the .EXE. You can also install the image with these privileges. See the source for additional details - note that the comments regarding the need for SYSGEN CONNECT are no longer applicable (at least as of VMS V5.5-2). There's also SYS$EXAMPLES:CDROM_AUDIO.C and .EXE, a non-Motif program. ------------------------------------------------------------ UTIL2. How do I access a MS-DOS floppy disk from OpenVMS? The Digital Pathworks for OpenVMS product includes a utility called PCDISK that can read and write MS-DOS format diskette. A license for Pathworks is as little as US$99 (QM-2CLAA-AA, File and Print Access license). ProGIS in Germany sells a product called VMove which supports DOS files on many different device types. For more information, send mail to info@progis.rmi.de. Engineering Software has a product called VAKSAT which will read/write/erase files on DOS diskettes. Available for both VAX and Alpha. Contact ed@cityscape.co.uk for more information. MadGoat PC Exchange (PCX) is a utility for copying files to and from MS-DOS format diskettes under VMS, using an RX23 (3.5"), RX26 (3.5"), or RX33 (5.25") diskette drive. For 3.5" diskettes, high-density disks can be read or written; double-density disks are read-only. Only high-density disks are supported on the RX33. http://www.wku.edu/www/madgoat/madgoat.html ------------------------------------------------------------ UTIL3. How do I play sound files on an AlphaStation? DECsound doesn't work The new AlphaStation systems use a different sound board (Microsoft Sound System) than the earlier DEC 3000 AXP systems, and DECsound, as supplied by DECwindows Motif, doesn't support this board. Digital offers an optional product, Multimedia Services for OpenVMS (SPD 64.24.00), which provides a replacement DECsound for this card as well as many other features (an AVI and MPEG player, video capture support, etc.) ------------------------------------------------------------ DCL1. How do I run a program with arguments? The RUN command does not accept arguments. To pass arguments to a program, you must use what is called a "foreign command". For example: $ uudecode :== $disk:[dir]uudecode.exe $ uudecode filespec The leading $ in the symbol definition is what makes it a foreign command. If the device and directory is omitted, SYS$SYSTEM: is assumed. Under OpenVMS V6.2 and later, DCL supports automatic foreign command definition via the logical name DCL$PATH:. An example of a definition of this logical name is: $ DEFINE DCL$PATH SYS$DISK:[],ddcu:[mytooldir],SYS$SYSTEM: DCL will first look for a command in the DCL command table, and if no match is found and if DCL$PATH is defined, it will then look for command procedures and executable images with filenames matching the command specified, in the directories specified via DCL$PATH. The first match found is invoked, and under OpenVMS, the DCL$PATH support will cause a command procedure to be activated in preference to an executable image. For more information on foreign commands or on automatic foreign command support, see the OpenVMS User's Manual. See also question PROG2. If you want to create a detached process that takes arguments from a command line, it must be run under the control of a command line interpreter (CLI) (typically DCL). This is done by placing the command line in a file, specifying SYS$SYSTEM:LOGINOUT.EXE as the image to run and the command file as the input. For example: $ OPEN/WRITE CMD TEMP_INPUT.COM $ WRITE CMD "$ MYCOMMAND arguments" $ CLOSE CMD $ RUN/DETACHED SYS$SYSTEM:LOGINOUT /INPUT=TEMP_INPUT.COM Various OpenVMS library calls (such as lib$spawn(), cli$dcl_parse(), and the C library system() call) require access to a command line interpreter such as DCL to perform requested actions, and will not operate if a CLI is not available. When a CLI is not available, these calls typically return the error status SS$_NOCLI. And as mentioned above, invoke the image LOGINOUT to cause a CLI (such as DCL) to be mapped into and made available in the context of the target process. [Stephen Hoffman] ------------------------------------------------------------ DCL2. How can I redefine control keys in DCL? The DCL DEFINE/KEY command allows you to define function and keypad keys, but not control keys. Also, keys you define with DEFINE/KEY are not recognized inside applications. Many applications which use the SMG$ routines for input have a similar DEFINE/KEY feature. The terminal driver line-editing control keys, including the use of DEL for delete, are not modifiable. ------------------------------------------------------------ DCL3. How can I clear the screen in DCL? The simplest way is the TYPE/PAGE NLA0: command. You can set up a symbol to clear the screen in your LOGIN.COM: $ CLS :== TYPE/PAGE NLA0: ------------------------------------------------------------ DCL4. How do I do a REPLY/LOG in a batch stream? Your terminal must be enabled as an operator terminal before doing the REPLY/LOG, but a batch stream doesn't have a terminal. To make this work, use the following sequence to enable the console as the operator terminal; then the REPLY/LOG will be accepted: $ DEFINE SYS$COMMAND _OPA0: $ REPLY/ENABLE $ REPLY/LOG [Arne Vajhøj] ------------------------------------------------------------ DCL5. How do I generate a random number in DCL? Here's my random number generator for inclusion into the OVMS FAQ; just do a GOSUB RAND and the global symbol RANDOM will contain a randomly generated number. The user/programmer can feed the generator a ceiling value (__CEIL) or a new seed (__SEED). $! RAND - returns a positive random number ("RANDOM") between 0 and $! __CEIL - 1. $ RAND: $ $ IF F$TYPE(__SEED) .EQS. "" $ THEN $ ! seed the random number generator, ... $ __NOW = F$CVTIME() $ __HOUR = 'F$EXTRACT(11,2,__NOW)' $ __MINUTE = 'F$EXTRACT(14,2,__NOW)' $ __SECOND = 'F$EXTRACT(17,2,__NOW)' $ __TICK = 'F$EXTRACT(20,2,__NOW)' $ $ __SEED == __TICK + (100 * __SECOND) + (6000 * __MINUTE) + - (360000 * __HOUR) $ ! the generator tends to do better with a large, odd seed, ... $ __SEED == (__SEED .OR. 1) $ ! clean up, ... $ DELETEX/SYMBOL __NOW $ DELETEX/SYMBOL __HOUR $ DELETEX/SYMBOL __MINUTE $ DELETEX/SYMBOL __SECOND $ DELETEX/SYMBOL __TICK $ ENDIF $ $ IF F$TYPE(__CEIL) .EQS. "" THEN __CEIL = %X3FFFFFFF $ $ __SEED == __SEED * 69069 + 1 $ $ RANDOM == (__SEED.AND.%X3FFFFFFF)/(%X40000000/__CEIL) $ $ RETURN [sharris@sdsdmvax.fb3.noaa.gov] ------------------------------------------------------------ DCL6. What does the MCR command do? The MCR command runs the specified image, with a default filespec of SYS$SYSTEM:.EXE, and passes any (optional) command line arguments in the same manner as a foreign command. In other words: $ MCR FOO BAR is equivalent to: $ FOO :== $FOO $ FOO BAR It derives from the RSX operating system from which VMS evolved and is still often used as a shortcut for activating images. The MCR command is different from the MCR command line interpreter, which is provided as part of the optional VAX-11 RSX product that provides RSX emulation under VMS. ------------------------------------------------------------ DCL7. How do I change the OpenVMS system prompt? You can use the SET PROMPT command for this purpose. SET PROMPT sets the DCL prompt to the specified string. When you want to display variable information, you will need to establish a tie-in that provides the information to the SET PROMPT command as required. If you wish to display the default directory for instance, you will have to establish a tie between the SET DEFAULT command and the SET PROMPT commands, as there is no direct way to get the default directory as the DCL prompt. You can easily acquire or create a set of DCL command procedures that perform the SET DEFAULT and SET PROMPT for you. These DCL command procedures often use a command such as: $ set prompt='f$env("default")' More advanced users could implement a system service or other intercept, and use these tools to intercept the directory change and reset the prompt accordingly. (This approach likely involves some kernel-mode programming, and requires write access to various undocumented OpenVMS data structures.) There are related tools available from various sources, including the following web sites: o ftp://ftp.hhs.dk/pub/vms/setpmt/ o ftp://ftp.tmesis.com/sys_service_hook.src o James F. Duff has also made available a Macro32 tool known as TIME_PROMPT, a tool that sets the prompt to the current system time. o Many folks have contributed DCL procedures to perform this task. Visit the newsgroup archives for information and examples. Information in this section has been acquired from various postings that have discussed this topic in the comp.os.vms newsgroup in the past, and examples from Arne Vajhoej, Brian Schenkenberger, James Duff, and others. [Stephen Hoffman] ------------------------------------------------------------ DCL8. Can I do DECnet task-to-task communication with DCL? Yes, you can do this with DCL. The OpenVMS DECnet documentation shows various simple examples using the task object and the TYPE command to trigger the execution of a DCL command procedure on a remote node. A slightly more advanced example of using DCL for DECnet task-to-task -- a procedure that acts as both the client and as the server as appropriate, and that uses a basic form of half-duplex communications -- is included: $! x.com $ $! This procedure must be in the user's login directory. $! Requires a self-referential (not reverential :-) proxy: $! UAF> add/prox :: /default $! Author: Stephen Hoffman, OpenVMS Engineering, Compaq $ $ goto 'f$mode()' $INTERACTIVE: $ open/read/write chan 0::"task=x" $ write chan "Hello" $ read chan parameter $ close chan $ write sys$output parameter $ exit $BATCH: $OTHER: $NETWORK: $ open/read/write chan sys$net $ read chan parameter $ write chan "''parameter' yourself!" $ close chan $ exit An example of a run of the above procedure: $ @x Hello yourself! $ DCL does not include support asynchronous I/O, thus a predetermined protocol or a predetermined "turn-around" command sequence must be implemented in order to avoid protocol deadlocks -- cases where both tasks are trying to write or both tasks are trying to read. The task that is writing messages to the network must write (or write and read) a predetermined sequence of messages, or it must write a message that tells the reader that it can now start writing messages. (This is the essence of a basic half-duplex network protocol scheme.) [Stephen Hoffman] ------------------------------------------------------------ FILE1. How can I undelete a file? OpenVMS doesn't have an "undelete" function. However, if you are quick to write-protect the disk (or if you can guarantee that no new files get created or existing files extended), your data is still on the disk and it may be possible to retrieve it. The FLORIAN tool available from the WKU Fileserver claims to be able to do this (see question SOFT1.) Other alternatives here include the DFU tool, available on the OpenVMS Freeware CD-ROM distribution. If you are setting up a user environment for yourself or for others, it is quite easy to use DCL to intercept the DELETE command, using a symbol: $ DEL*ETE :== @SYS$LOGIN:MYDELETE.COM The DELETE symbol will cause the procedure to be invoked whenever the user enters the DELETE command, and it can copy the file(s) to a "trashcan" subdirectory before issuing a "real" DELETE on the files. Other procedures can retrieve the file(s) from the "trashcan" subdirectory, and can (and should) clean out the "trashcan" as appropriate. (Realize that this DELETE symbol can interfere with DELETE/GLOBAL and other similar DCL commands.) [Stephen Hoffman] ------------------------------------------------------------ FILE2. Why does SHOW QUOTA give a different answer than DIR/SIZE? DIR/SIZE doesn't take into account the size of file headers which are charged to your quota. Also, unless you use DIR/SIZE:ALL, you'll see only the "used" size of the file, not the allocated size which is what gets charged against your quota. Also, you may have files in other directories. [Steve Lionel] $ DIR/SIZ=ALL/GRAND [username...] Grand total of D1 directories, F1 files, B1/B2 blocks. $ DIR/SIZ=ALL/GRAND [-]username.DIR Grand total of 1 directory, 1 file, B3/B4 blocks. $ SHOW QUOTA User [username] has B5 blocks used, B6 available, of B7 authorized and permitted overdraft of B8 blocks on disk If the user has no files in other directories and all file-headers are only 1 block, then the following should apply: B5=B2+B4+F1+1 If the diskquota is out of synch, then the system-manager can make a rebuild. [Arne Vajhøj] ------------------------------------------------------------ FILE3. How do I make sure that my data is safely written to disk? If your application must absolutely guarantee that data is available, no matter what, there's really no substitute for RMS Journalling. However, you can achieve a good degree of data integrity by issuing a SYS$FLUSH RMS call at appropriate times (if you're using RMS, that is.) If you're using a high-level language's I/O system, check that language's documentation to see if you can access the RMS control blocks for the open file. In C you can use fflush followed by fsync. Note that fsync, which was undocumented for VAX C but is documented for DEC C, takes a file descriptor as an argument, not a *FILE. ------------------------------------------------------------ FILE4. What are the limits on file specifications and directories? A file specification has an aggregate maximum size of 255 characters at present. The node and device specification may be up to 255 characters each - file name and file types may be up to 39 characters each. File versions are from 1 through 32767, though 0 (latest version), -0 (oldest version) and -n (n'th previous version) can be used in most contexts. A file specification may not have more than 8 directories and subdirectories - while it is possible to create subdirectories of greater depth, accessing them is problematic in most cases and this should be avoided. Application developers should use OpenVMS-supplied routines for parsing file specifications - this ensures that changes in what is allowable will not tend to break your application. Consider that various parts of the file specification may contain quoted strings with embedded spaces and other punctuation! Some routines of interest are SYS$FILESCAN, SYS$PARSE and LIB$TRIM_FILESPEC. For further information, see the OpenVMS Guide to File Applications. ------------------------------------------------------------ FILE5. What is the largest disk volume size OpenVMS can access? One Terabyte (2**31 blocks of 2**9 bytes). Prior to the release of V6.0, the OpenVMS file system was limited to disk volumes of 8.5 GB (2**24 blocks) or less. On some systems, there are restrictions in the console program that limit the size of the OpenVMS system disk. Note that data disks are not affected by console program limits. For example, all members of the VAXstation 3100 series are limited to a system disk to 1.073 GB or less due to the console, though larger data disks are possible. [Stephen Hoffman] ------------------------------------------------------------ FILE6. What is the maximum file size, and the RMS record size limit? RMS can store individual files of a size up to the maximum supported volume size. Under OpenVMS V6.0 and later, the volume size and the RMS maximum file size limit is 2**31 * 512 bytes -- one terabyte (1 TB). The RMS formats -- sequential, relative, and indexed -- are limited by the one terabyte maximum volume size. RMS relative files are further limited to a number of records that will fit in 32 bits -- 4 billion records. Sequential and indexed formats do not have a record limit. [Stephen Hoffman] ------------------------------------------------------------ FILE7. How do I write recordable CDs on OpenVMS? Creation of CD-ROMs using recordable CD media (CD-R) under OpenVMS typically involves one of two approaches: the use of the optional CD-R (`Scribe') capabilities available for the InfoServer or other "offline" hardware packages, or the use of a host-based package such as the CDWRITE13_VMS utility, an OpenVMS port of a Linux tool. OpenVMS has no integrated support for recording CD-R media. OpenVMS can read both ODS2 and ISO9960 format CD-ROMs. InfoServer hardware configurations are no longer availble from DIGITAL, but may potentially be acquired through other means. The CDWRITE13_VMS package is one example of a host-based package that can be used to create CD-R media. The contact for CDWRITE13_VMS is Dr. Eberhard Heuser-Hofmann. One website that discusses this package is located at: http://www.geocities.com/SiliconValley/Lakes/9999/vmscdwri.html Also see the newest linux-cdwrite package, XCDROAST. [Stephen Hoffman] ------------------------------------------------------------ PROG1. How do I call from ? Most OpenVMS system services and RTL routines pass string arguments by descriptor. Languages which support native string data types create descriptors automatically; those which do not (eg., C) require that you set them up explicitly. [eric@tardis.HQ.ileaf.com] There is a lot of information available on how to call system services and Run-Time Library routines, including examples in numerous languages. The best references are: Your language's User Manual OpenVMS Programming Environment Manual OpenVMS Programming Concepts Manual OpenVMS Programming Interfaces: Calling a System Routine OpenVMS Calling Standard In addition, if you are a subscriber to the Digital Software Information Network (available to those with a software support contract), the DSIN database contains hundreds of worked examples of calling system services and RTL routines, including the one that seems to trip up almost everyone, SMG$CREATE_MENU. [Steve Lionel] Arne Vajhøj has put together a collection of OpenVMS example programs. It can be found at: ftp://ftp.hhs.dk/pub/vms/ [Arne Vajhøj] Additional information and examples for OpenVMS (as well as for UNIX and Windows NT) are available via: http://www.partner.digital.com/www-swdev/pages/Home/TECH/techsupport.html http://www.partner.digital.com/www-swdev/pages/Home/TECH/faqs/dunix/dunix.html http://www.partner.digital.com/www-swdev/pages/Home/TECH/faqs/ovms/ovms.html http://www.partner.digital.com/www-swdev/pages/Home/TECH/faqs/wnt/wnt.html [Stephen Hoffman] ------------------------------------------------------------ PROG2. How do I get the arguments from the command line? If you're writing a program and want to accept arguments from a foreign command, you can use LIB$GET_FOREIGN to get the command line and parse it yourself, or if you're programming in C, use the normal argc/argv method. To write an application which uses the normal DCL verb/qualifier/parameter syntax for invocation, see the description of the CLI$ routines in the OpenVMS Callable Utility Routines Reference Manual. It is possible to write an application which can be used both ways; if a DCL verb isn't used to invoke the image, the application parses the command line itself. One way to do this is to call CLI$GET_VALUE for a required parameter. If it is not present (or you get an error), call LIB$GET_FOREIGN to get the command line and do the manual parse. See also question DCL1. ------------------------------------------------------------ PROG3. How do I get a formatted error message in a variable? Use the SYS$PUTMSG system service with an action routine that stores the message line(s) in the variable of your choice. Be sure the action routine returns a "false" (low bit clear) function value so that SYS$PUTMSG doesn't then try to display the message (unless you want it to.) See the description of $PUTMSG in the System Services Reference Manual for an example of using an action routine. ------------------------------------------------------------ PROG4. How do I link against SYS$SYSTEM:SYS.STB on an Alpha system? LINK/SYSEXE is the OpenVMS Alpha equivalent of linking against SYS.STB. ------------------------------------------------------------ PROG5. How do I do a SET DEFAULT from inside a program? The problem is that SYS$SETDDIR only changes the default directory - NOT the default disk. The default disk is determined by the logical SYS$DISK. If you want to change the default disk within a program, then call LIB$SET_LOGICAL to change the logical SYS$DISK. You will need to call both LIB$SET_LOGICAL and SYS$SETDDIR to change both default disk and the default directory! [Arne Vajhøj] ------------------------------------------------------------ PROG6. How do I create a shareable image transfer vector on an Alpha system? This is something that was greatly simplified for OpenVMS Alpha. You don't need to create a separate transfer vector module; just use the SYMBOL_VECTOR statement in a linker options file. For example, if your shareable image has two routines named FOO and BAR, the linker options file should contain the following line: SYMBOL_VECTOR=(FOO=PROCEDURE, BAR=PROCEDURE) The Linker manual has more details on this. ------------------------------------------------------------ PROG7. How do I turn my Fortran COMMON into a shareable image on Alpha? You need to add SYMBOL_VECTOR=(=PSECT) to your options file. On OpenVMS VAX all OVR/REL/GBL psects were automatically exported into the shareable image's Global Symbol Table. On OpenVMS Alpha you have to tell the linker that you want this done by means of the PSECT keyword in the SYMBOL_VECTOR options file statement. This has several advantages over OpenVMS VAX. First, you don't have to worry about the address of the psect when you try to create a new, upwardly compatible version of the shareable image. Second, you can control which psects, if any, are made visible outside the shareable image. By default, COMMON PSECTs in DEC Fortran for OpenVMS Alpha (as well as most other OpenVMS Alpha compilers) are NOSHR. On VAX, the default was SHR which required you to change the attribute to NOSHR if you wanted your COMMON to be in a shareable image but not write-shared by all processes on the system. If you do want write-sharing, use: CDEC$ PSECT common-name=SHR in the Fortran source code (the CDEC$ must be begin in column 1) or a linker options file PSECT_ATTR statement to set the COMMON PSECT attribute to SHR. For further information, see the Linker manual. ------------------------------------------------------------ PROG8. How do I convert between IEEE and VAX floating data? In OpenVMS V6.1 there is a routine CVT$CONVERT_FLOAT, documented in the LIB$ Run-Time Library Reference Manual, which can perform conversions between any two of the following floating datatypes: VAX (F,D,G,H), little-endian IEEE (single, double, quad), big-endian IEEE (single, double, quad), CRAY and IBM System\370. DEC Fortran (all platforms) has a feature which will perform automatic conversion of unformatted data during input or output. See the DEC Fortran documentation for information on "non-native data in I/O" and the CONVERT= OPEN statement keyword. ------------------------------------------------------------ PROG9. How do I get the argument count in a Fortran routine? On VAX, many programmers would use a MACRO routine which accessed the AP register of the caller to get the address of the argument list and hence the argument count. This was not guaranteed to work on VAX, but usually did. However, it doesn't work at all on OpenVMS Alpha, as there is no AP register. On Alpha systems, you must use a language's built-in function to retrieve the argument count, if any. In Fortran this is IARGCOUNT, which is also available in DEC Fortran on OpenVMS VAX. Note that omitting arguments to Fortran routines is non-standard and is unsupported. It will work in many cases - read the DEC Fortran release notes for additional information. ------------------------------------------------------------ PROG10. How do I get a unique system ID for licensing purposes? Many software developers desire to use a unique hardware ID to "lock" a given copy of their product to a specific system. Most Digital VAX and Alpha systems do not have a unique hardware-set "system ID" that can be used for this purpose. Digital does not use hardware IDs in its licensing methods and many users consider a hardware-based licensing scheme to be a negative attribute when considering software purchases. Digital uses a software-based system called the License Management Facility or LMF. This provides for software keys (Product Authorization Keys or PAKS) which support capacity and user-based license checking. Digital sells the DEC LMF PAK Generator for OpenVMS (SPD 31.68.03) for use by software vendors. However, if a hardware-based method is required, the most common method is based on an Ethernet adaptor hardware address. Sample source code for implementing this is available at: http://www.partner.digital.com/www-swdev/pages/Home/TECH/faqs/ovms/ovms.html ------------------------------------------------------------ PROG11. What is an executable, shareable, system or UWSS image? Executable code in OpenVMS typically resides in an image -- an image is a file -- the file extension is typically .EXE -- that contains this code. Common types of images include executable images, shareable images, system images, and protected (UWSS) images. Executable images are programs that can be directly executed. These images can grant enhanced privileges, with an INSTALL of the image with /PRIVILEGE, or can grant enhanced access with the specification of a subsystem identifier on the ACL associated with the image. Shareable images contain code executed indirectly, these images are referenced from executable images and/or from other shareable images. These images can not grant enhanced privileges, even with the use of INSTALL with /PRIVILEGE or a subsystem identifier. These shareable images can be dynamically activated (a LINK that occurs at run-time) via the LIB$FIND_IMAGE_SYMBOL run-time library (RTL) routine. (See `protected images' for information on `privileged shareable images'.) System images are intended to run directly on the VAX or Alpha hardware -- these are normally used for the kernel code that comprises an operating system. Protected images -- also refered to as User-Written System Services (UWSS), or as privileged shareable images -- are similiar in some ways to a standard shareable images, but these images include a `change mode' handler, and execute in an `inner' processor mode (privileged mode; executive or kernel), and code executing in inner modes has implicit SETPRV privilege. Must be INSTALLed with /PROTECT. Note that inner-mode code has restrictions around calling library routines, around calling various system services, and around calling code located in other protected or shareable images. Loadable images and device drivers are images that can be used to add code into the OpenVMS kernel. Pseudo-device drivers are a particularly convenient way to add executable code, with associated driver-defined data structures, into the kernel. The pseudo-device driver includes the UCB and DDB data structures, and a calling interface with support for both privileged and unprivileged access to the driver code via sys$qio[w] calls. A cookbook approach to creating OpenVMS shareable images is available at the (admittedly overly long) URL: http://www.partner.digital.com/www-swdev/pages/Home /TECH/faqs/ovms/ovms-shexe-cook.html [Stephen Hoffman] ------------------------------------------------------------ PROG12. How do I do a file copy from a program? There are several options available for copying files from within a program. Obvious choices include using lib$spawn(), system(), sys$sndjbc() or sys$creprc() to invoke a DCL COPY command. Other common alternatives include using the callable convert routines and the BACKUP application programming interface (V7.1 and later). [Stephen Hoffman] ------------------------------------------------------------ PROG13. What is a descriptor? A descriptor is a data structure that describes a string or an array. Each descriptor contains information that describes the type of the data being referenced, the size of the data, and the address of the data. It also includes a description of the storage used for the data, typically static or dynamic. Descriptors are passed by reference. The following are examples of creating and using descriptors in C: #include #include #include int RetStat; char TxtBuf[TXTSIZ] struct dsc$descriptor StaticDsc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL }; struct dsc$descriptor DynDsc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_D, NULL }; int DynDscLen = 255; $DESCRIPTOR( ConstDsc, "This is a string" ); /* finish setting up a static descriptor */ StaticDsc.dsc$w_length = TXTSIZ; StaticDsc.dsc$a_pointer = (void *) TxtBuf; /* finish setting up a dynamic descriptor */ RetStat = lib$sget1_dd( &DynDscLen, &DynDsc ); if ( !$VMS_STATUS_SUCCESS( RetStat ) ) return RetStat; /* release the dynamic storage */ RetStat = lib$sfree1_dd( &DynDsc ); if (!$VMS_STATUS_SUCCESS( RetStat )) return RetStat; Static descriptors reference storage entirely under application program control, and the contents of the descriptor data structure can be modified as required (by the application). OpenVMS routines do not modify the contents of a static descriptor, nor do they alter the address or length values stored in the static descriptor. (The term "static" refers to the descriptor data structure, and not necessarily to the storage referenced by the descriptor.) Dynamic descriptors reference storage under the control of the run-time library, and the contents of a dynamic descriptor data structure -- once initialized -- can only be modified under control of run-time library routines. The dynamic storage referenced by the dynamic descriptor is allocated and maintained by the run-time library routines. Various OpenVMS routines do alter the contents of the descriptor data structure, changing the value for the amount and the address of the storage associated with the dynamic descriptor, as required. Routines can obviously access and alter the contents of the storage referenced by the descriptor. OpenVMS languages that include support for strings or arrays are expected to use descriptors for the particular structure. Most OpenVMS languages, such as Fortran and BASIC, use descriptors entirely transparently. Some, like DEC C, require the programmer to explicitly create and maintain the descriptor. For further information on string descriptors, see the _OpenVMS Programming Concepts_ manual, part of the OpenVMS documentation set. [Stephen Hoffman] ------------------------------------------------------------ PROG14. How many bytes are in a disk block? A disk block is the minimum unit of disk storage allocation in OpenVMS. Under OpenVMS VAX and OpenVMS Alpha, the disk volume block size is consistent, with each block containing 512 bytes. The minimum disk allocation granularity actually permissible (in the ODS-2 and ODS-5 volume structures commonly used on OpenVMS) is determined on a per-volume basis, and is typically based on a combination of the total number blocks on the disk volume and the total size of the volume storage bitmap. The allocation granularity is known as the volume cluster factor -- the cluster factor is the number of blocks in a disk cluster, and it is the smallest number of blocks that can be allocated on a particular disk volume. Prior to OpenVMS V7.2, the maximum permissible size of the bitmap requires larger cluster factors as volume sizes increase. Starting with V7.2, the bitmap can be larger, and cluster factors as small as one block can be used. The number of bytes in a file can be determined by multiplying the number of blocks allocated for the file times the number of bytes in a block. For sequential files (only), the FFB (XAB$W_FFB, in the File Header XAB) value can be used to find out how much of the last (XAB$L_EBK) block is used. FFB and EBK are meaningful only for sequential files, and only in a limited context -- partial block allocations are not permitted. For other file formats, the EOF marker is not meaningful. Disk allocations always occur only in units of the cluster factors, which can be from one block up to (potentially) clusters of eighteen blocks or more, depending on the volume cluster factor. OpenVMS assumes that the device driver and the underlying storage device will present the file system with addressable units of storage of 512 bytes in size, or the appearance of same. Various third-party CD-ROM devices, for instance, support only 2048 byte blocks, and such devices are incompatible with the standard OpenVMS device drivers. To determine the number of bytes required for a file from DCL, one option uses the f$file_attributes item EOF, multiplied by the size of a block in bytes (512). This does not account for the unused space in the last block of a sequential file, but it also does not have to differentiate sequential files from other files. [Stephen Hoffman] ------------------------------------------------------------ PROG15. How many bytes are in a memory page? A memory page is the minimum unit of memory allocation in OpenVMS. With OpenVMS VAX, the memory page size matches the disk block size: it is always 512 bytes. With OpenVMS Alpha, the memory page size is variable, and it can range from 8192 bytes (8 kilobytes) up to 64 kilobytes. The current system page size can be determined using the sys$getsyi or f$getsyi PAGE_SIZE item. Programs with hardcoded constants for the memory page size (or page alignment) should always assume a page size of 64 kilobytes. On OpenVMS Alpha, a 512 byte area of memory -- equivilent in size to an OpenVMS VAX memory page -- is refered to as a pagelet. [Stephen Hoffman] ------------------------------------------------------------ PROG16. How do I create a process under another username? Many server processes can operate within the context of the target user using privileges, using calls such as sys$chkpro and (more commonly in this context) sys$check_access as needed to determine if access would be permitted for the specified user within the current security model. With OpenVMS V6.2 and later, the persona system services (SYS$PERSONA_*) can be used to assume the persona of the specified user -- these allow the server to operate as the specified user, in a controlled fashion. The persona services can be used as a "wrapper" around a sys$creprc process creation call, as well -- this will create a seperate process entirely under the assumed persona. Information on the persona system services is included in the OpenVMS V6.2 new features documentation, and in the OpenVMS V7.1 and later system services documentation. These system services exist and are supported in OpenVMS V6.2 and later releases. Typical mechanisms for creating a process under another username include: o personna services around a sys$creprc call. See above. o via DECnet task-to-task, using explicit specification of username and password, or using a DECnet proxy. This creates a network-mode job under the target user. The network-mode job might do little more than a RUN/DETACH of an image passed in via task-to-task -- task-to-task communications are fully available using strictly DCL-to-DCL processing, or using a compiled language and DCL, etc.) o SUBMIT/USER, or the username argument on the sys$sndjbc call. This creates a batch-mode job under the specified username. The batch-mode job might do little more than a RUN/DETACH of an image passed in via a parameter. o the UIC argument on the sys$creprc call. This mimics the UIC of the target user, and is certainly not the prefered mechanism for this task. o Via pseudo-terminals... There are likely a few other mechanisms around... There are various tools available from DECUS and other sources that allow various forms of user impersonation, as well. These tools will require version-dependent kernel code and enhanced privileges for some of (or all of) their operations. [Stephen Hoffman] ------------------------------------------------------------ PROG17. Why do lib$spawn, lib$set_symbol fail in detached processes? The processing within run-time library (RTL) calls such as lib$attach, lib$disable_ctrl, lib$do_command, lib$enable_ctrl, lib$get_symbol, lib$run_program, lib$set_symbol, lib$set_logical, and lib$spawn, is dependent on and requires the presence of a command language interpreter (CLI), such as DCL. Without a CLI present in the current process, these calls will fail with a "NOCLI, no CLI present to perform function" error. Detached processes typically do not have a CLI present. In place of lib$spawn, sys$creprc can often be used. The context of the parent process (symbols and logical names) will not be propogated into the subprocess when sys$creprc is used, though when there is no CLI present in the process this (lack of) propogation is moot. To create a detached process with a CLI, you must specify LOGINOUT as the target image as discussed elsewhere in the FAQ, or only use these calls (and any other calls requiring a CLI) from images that are running in an "interactive", "batch", or "other" mode process. [Stephen Hoffman] ------------------------------------------------------------ PROG17. Where can I obtain Bliss, and the libraries and supporting files? The Bliss language compilers and documentation are available on the OpenVMS Freeware distributions. Bliss language source code that contains the following statement: LIBRARY 'SYS$LIBRARY:STARLET.L32'; or similar requires the presence of the Bliss libraries. These libraries are created on the target system using the Bliss require files, and are built using the following Bliss commands: STARLET.L32 contains the public interfaces to OpenVMS: $ BLISS /LIBRARY=SYS$COMMON:[SYSLIB]STARLET.L32 - SYS$LIBRARY:STARLET.REQ LIB.L32 contains both the public and private interfaces to OpenVMS: $ BLISS /LIBRARY=SYS$COMMON:[SYSLIB]LIB.L32 - SYS$LIBRARY:LIB.REQ+SYS$LIBRARY:STARLET.REQ The equivilent files for Bliss64 are created with: $ BLISS/A64/LIBRARY==SYS$COMMON:[SYSLIB]LIB.L64 - SYS$LIBRARY:LIB.R64+STARLET.REQ+STARLET.R64 $ BLISS/A64/LIBRARY==SYS$COMMON:[SYSLIB]STARLET.L64 - SYS$LIBRARY:STARLET.R64 Some Bliss code may also require the OpenVMS VAX architecture flags. The following is the equivilent of the Alpha ARCH_DEFS.BLI module: ! ! This is the OpenVMS VAX version of ARCH_DEFS.BLI, and ! contains the architectural definitions for conditionally ! compiling OpenVMS Bliss sources for use on VAX systems. ! MACRO VAXPAGE = 1%; MACRO BIGPAGE = 0%; MACRO VAX = ! = 1 if compiled BLISS/VAX %BLISS(BLISS32V)%; ! = 0 if not compiled BLISS/VAX MACRO EVAX = ! = 1 if compiled BLISS/E* ! ! A more appropriate definition can only be used with versions ! of the Bliss compilers that understand the 32E/64E flags. ! %BLISS(BLISS32E) OR %BLISS(BLISS64E)%; ! = 0 if compiled /VAX NOT %BLISS(BLISS32V)%; ! = 0 if compiled /VAX MACRO ADDRESSBITS = %BPADDR%; ! = 32 or 64 based on compiler used [Stephen Hoffman] [End of Part 2/3]