From: Hoff Hoffman [hoffman@xdelta.zko.dec.nospam] Sent: Thursday, July 03, 2003 1:13 PM To: Info-VAX@Mvb.Saic.Com Subject: OpenVMS Frequently Asked Questions (FAQ), Part 4/9 System Management Information __________________________________________________________ 5.24 INITIALIZE ACCVIO and ANSI tape label support? A change was made (back in 1988) to (as it was then known) VAX/VMS V5.1-1 that added support for the then- new ANSI X3.27-1987 magnetic tape label standard. Prior to the ANSI X3.27-1987 standard, the date field in the ANSI HDR1 record permits dates only as far as the end of Year 1999. With ANSI X3.27-1987, dates through Year 1999 and dates from Years 2000 to 2099 are permitted. Versions of INIT.EXE and MTAACP.EXE from VAX/VMS releases prior to V5.1-1 will potentially have problems properly processing ANSI magnetic tapes when Y2K and later dates are involved-the DCL INITIALIZE command is known to encounter access violation (ACCVIO) errors. The available solutions include upgrades, or setting the date back. Direct initialization of the tape with the new headers (via $qio) is also clearly possible, though the limitation within the old MTAACP.EXE magtape ACP image is not nearly so easy to bypass. __________________________________________________________ 5.25 How do I recover from INSVIRMEM errors? Prior to OpenVMS Alpha V7.0 and on all OpenVMS VAX releases, VIRTUALPAGECNT and PGFLQUOTA limit the amount of virtual address space that is available to each process. Further limiting the amount of address space is the size of system space (S0 and S1 space). On OpenVMS Alpha versions prior to V7.0 and on all OpenVMS VAX releases, VIRTUALPAGECNT and MAXPROCESSCNT together determine the size of the page table data structures that occupy large tracts of system space. When no system virtual address space is available for the stuff that needs it-this includes the page tables, non-paged pool, and various other structures-then the values of VIRTUALPAGECNT and MAXPROCESSCNT cannot be increased. In OpenVMS Alpha V7.0 and later, the page table data structures have been moved out of S0 and S1 space and into page table space. In OpenVMS Alpha V7.2 and later, certain large data structures found in non-paged pool (eg: lock management structures) have been moved into 5-33 System Management Information 64-bit space, thus freeing up room in non-paged pool and in S0 and S1 space (where non-paged pool resides) while also permitting much larger data structures. __________________________________________________________ 5.26 How can I prevent a serial terminal line from initiating a login? In SYSTARTUP_VMS.COM, issue the command: $ SET TERMINAL/NOTYPEAHEAD/PERMANENT ddcu: This will prevent any unsolicited terminal input on ddcu:, and this unsolicited input is what triggers JOB_CONTROL to start up LOGINOUT on the terminal. Once LOGINOUT starts up on the serial line, you can see interesting behaviour (eg: audits, process creations, etc) as LOGINOUT tries to "chat" with whatever device is hooked onto the remote end of the serial terminal line. __________________________________________________________ 5.27 How does PCSI use the image BUILD_IDENT field? The (undocumented) build ident field in an OpenVMS Alpha image header is 16 bytes long, and is used as a counted string of 0-15 characters (ie, as an .ASCIC string, a string with the character count in byte 0) and was originally introduced to provide information for use by VMSINSTAL patch kits to determine whether an image should be replaced or not. Starting with OpenVMS Alpha V7.1-2, OpenVMS Engineering uses the PCSI utility to package and install ECO kits for OpenVMS. PCSI uses the generation attribute (a 32-bit unsigned integer) specified for files in the product description file (PDF) of a PCSI kit as the basis for performing file conflict detection and resolution. When a product is installed, PCSI modifies the build ident field of Alpha image headers to store an encoded form of the generation number. It also looks at the build ident field of previously installed images to obtain the generation information for those files as input to the file conflict processing algorithm. (Only images have this field, obviously.) 5-34 System Management Information PCSI interprets the build ident field of a previously installed image as follows: o if the string length is 15, the 5th character is a hyphen, and the last ten characters are a ten digit number with leading zeros, then the last ten characters are treated as a valid generation number. o for V7.1-2 through V7.2-1, inclusive, if the above test fails, the information is obtained from the PCSI product database. o in releases after V7.2-1 and with current PCSI ECO kits, if the above test fails, an invalid generation number is treated as 0000000000 so that the ECO kit will simply replace the image rather than assuming the PCSI database is in error. So, what will you see in the image identification displayed via the ANALYZE/IMAGE command? For an image that has been built as part of an OpenVMS Engineering system build, you will generally see a build ID string in the format "X6TE-SSB-0000"-X6TE is the build number for the OpenVMS Alpha V7.2-1 release. This id format is used within the OpenVMS system build, and can generally only be seen associated with images that have not yet been processed via PCSI. During the installation of V7.2-1, PCSI will modify the image header to have a build ident string of "X6TE-0050120000". During installation of an ECO kit containing this image with a generation number of 50130052, for example, PCSI would determine that 50130052 is greater than 50120000, and will replace the existing image on the target disk with the version of the image included in the ECO kit. 5-35 System Management Information __________________________________________________________ 5.28 How can I tell what software (and version) is installed? There is unfortunately no consistent nor single way to make this determination-this is one of the reasons that a move to PCSI installations is underway. On OpenVMS Alpha, you can use VMSINSTAL.HISTORY and PRODUCT SHOW PRODUCT to determine what packages have been installed via the VMSINSTAL and PCSI tools, respectively. To see which OpenVMS Alpha ECO kits have been applied, look in VMSINSTAL.HISTORY on OpenVMS Alpha prior to V7.1-2, and use PRODUCT SHOW PRODUCT/FULL on OpenVMS Alpha V7.1-2 and later. On OpenVMS VAX, you can use PRODUCT SHOW PRODUCT and (for software that is installed via VMSINSTAL on V7.3 and later) in VMSINSTAL.HISTORY. For products installed on OpenVMS VAX prior to V7.3 using VMSINSTAL, there is no reliable way to determine what products have been installed. If the product provides a RELEASE_NOTES file (as many do), you can look for the list of these files via DIRECTORY SYS$HELP:*.RELEASE_NOTES. Again, this approach is NOT reliable: some kits do not provide release notes, some system managers will install only the release notes, some system managers will delete release notes, and release notes for multiple versions can be present. On most packages, you can generally use ANALYZE/IMAGE on one of the core images, looking at the image identification area. Some of the product-specific mechanisms available are: o DQS DQS$VERSION logical name o C CC/VERSION o C++ CXX/VERSION o TCP/IP TCPIP SHOW VERSION command 5-36 System Management Information __________________________________________________________ 5.29 What file checksum tools are available for OpenVMS? The undocumented DCL command CHECKSUM is the usual means, and provides a rather simple-minded checksum suitable to detect basic file corruptions. For information and an OpenVMS version of the MD5 checksum tool, see: o http://www.support.compaq.com/svctools/md5- instructions.html The OpenVMS Alpha ECO (patch) kit checksums available at the ECO website are determined using the following DCL command sequence: $ CHECKSUM kitname.pcsi-dcx_axpexe $ SHOW SYMBOL CHECKSUM$CHECKSUM See Section 5.16 for information on acquiring OpenVMS ECO (patch) kits. __________________________________________________________ 5.30 What (and where) is the OpenVMS Management Station? For information and current kits for the OpenVMS Management Station (OMS), a PC-based tool that permits you to manage an OpenVMS system, please see: o http://www.openvms.compaq.com/openvms/products/argus/ __________________________________________________________ 5.31 How to determine current disk fragmentation level? The HP OpenVMS Disk File Optimizer (DFO) defragmentation package provides a fragmentation monitoring tool, and a DFO product authorization key (PAK) is not required for the fragmentation reporting tool: $ DEFRAG SHOW/VOLUME ddcu: The DFU tool available on the OpenVMS Freeware can generate a report on the disk fragmentation: DFU> REPORT ddcu: 5-37 System Management Information __________________________________________________________ 5.32 SYSBOOT-I-FILENOTLOC, Unable to locate SYS$CPU_ROUTINES? A message at the OpenVMS Alpha bootstrap such as the following: %SYSBOOT-I-FILENOTLOC, Unable to locate SYS$CPU_ROUTINES_1C02.EXE %SYSBOOT-E-LDFAIL, failed to load execlet, status = 00000910 indicates that the particular OpenVMS Alpha release does not contain support for the target platform. In this case, OpenVMS does not recognize Alpha family 1C member 02 as a supported platform. A later version of OpenVMS might support the platform, or there might be no support on any release. Ensure that you have the most current firmware, and review the minimum version requirements for the platform. The execlet load failure and other similar bootstrap status values can often be decoded using either of the following techniques: $ exit %x910 %SYSTEM-W-NOSUCHFILE, no such file $ $ x = f$message(%x910) $ show symbol x X = "%SYSTEM-W-NOSUCHFILE, no such file" $ Also see Section 14.4.4.1. __________________________________________________________ 5.33 How can I customize the DCPS device control for a new printer? To customize DCPS for an otherwise unsupported printer, you can try the following sequence: o Extract the most closely-associated setup modules from the existing device control library, DCPS$DEVCTL.TLB. (For instance, you can probably extract and use the HP LaserJet 4000 series definitions for the HP LaserJet 4050 series. Each printer will vary, please consult the printer documentation for specifics and requirements.) 5-38 System Management Information o rename each extracted setup module to a corresponding: LPS$$UNRECOGNIZED_* o Insert all of the above-renamed setup modules into a newly-created device control library specific to the new printer: $ LIBRARY/TEXT/CREATE - SYS$COMMON:[SYSLIB]HP4050_DEVCTL.TLB LPS$$UNRECOGNIZED* The above assumes the filename HP4050_DEVCTL.TLB, alter as required. o Set up your DCPS startup procedures to include a search-list logical name such as: $ DEFINE/SYSTEM/EXECUTIVE DCPS_HP4050_LIB - SYS$LIBRARY:HP4050_DEVCTL.TLB, - SYS$LIBRARY:DCPS$DEVCTL.TLB o Supply DCPS_HP4050_LIB as the library parameter in the queue startup for this printer, this is the P3 parameter to the command procedure SYS$STARTUP:DCPS$EXECUTION_QUEUE.COM. o The HP4050_DEVCTL library may/will need to be recreated and modules re-edited and replaced with each DCPS upgrade, particularly if any modules are updated in the original library. You will also want to determine if the upgraded version of DCPS directly supports the particular printer. o To customize the processing of file extensions within DCPS (to enable or disable graybar output, for instance), use the information available in: SYS$LIBRARY:DCPS$FILE_EXTENSION_DATA_TYPE.DAT_DEFAULT to create your own site-specific: SYS$LIBRARY:DCPS$FILE_EXTENSION_DATA_TYPE.DAT Also see Section 5.14. 5-39 System Management Information __________________________________________________________ 5.34 Why do $GETDEV MOUNTCNT and SHOW DEVICE mount counts differ? MOUNTCNT returns the local mount count, while SHOW DEVICE returns the cluster-wide mount count. __________________________________________________________ 5.35 What software is needed for Postscript printers? The NorthLake PrintKit (http://www.nls.com/) and DECprint Supervisor (DCPS; http://www.openvms.compaq.com/openvms/Print/print_ sw_prods.html) are common choices for support of Postscript printers on OpenVMS. You may also require the installation of an IP transport stack. Also please see Section 15.2.2 and Section 15.2.3. __________________________________________________________ 5.36 How do I remove a PCSI-installed patch (ECO) kit? You cannot PRODUCT REMOVE a PCSI patch (ECO) kit. In order to remove an ECO kit, PCSI would have to have copies of all the other version of the files from all other patches and products that previously were installed. This can clearly involve a large number of files and a large archive of old file versions and a substantial quantity of disk space. While removal is clearly theoretically possible, it is not currently implemented. The following is the supported mechanism to remove a PCSI patch kit. 1 Execute a PRODUCT SHOW PRODUCE SET CONF COMM/REMOTE=VIRTUAL 5-52 _______________________________________________________ 6 Information on Mail __________________________________________________________ 6.1 MAIL keeps saying I have new messages, but I don't. What do I do? if you see the %MAIL-W-NONEWMAIL, no new messages error reported when MAIL indicates you have messages, then the NEWMAIL count has become skewed from reality. The count of new mail messages is kept separately from your mail folder, and is stored in VMSMAIL_ PROFILE.DATA. It sometimes happens that this count differs from what is stored in your mail folder. If this arises, invoke MAIL and repeatedly enter the READ/NEW command (or press the keypad hyphen key on an LK-compatible keyboard) until you see no new mail messages. Then enter the command one more time. This will resynchronize the counters. If you are operating in a cluster and find your mail counts inconsistent across cluster members, your customer is likely missing a definition of the VMSMAIL_ PROFILE logical name-and is probably also missing definitions of other logical names associated with other shared files-or has one or more inconsistent definitions of this and likely of other logical names. For details on the configuration data files that must be shared within a cluster, please see SYS$STARTUP:SYLOGICALS.TEMPLATE on V7.2 and later. __________________________________________________________ 6.2 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? 6-1 Information on Mail Not directly with the OpenVMS MAIL facility, but there are several other options: o Install PINE, available commercially from Innosoft or free from Andy Harper. With PINE you can both send and receive MIME messages, if you have the appropriate viewers available. o http://www.process.com/ o http://www.agh.cc.kcl.ac.uk/files/vms/pine-vms/ o ftp://ftp2.kcl.ac.uk/pub/vms/pine-vms/ o If you are working from an X11 server, use the OpenVMS version of Netscape Navigator or Mozilla. The mail download protocol chosen to access the mail server from the Navigator or Mozilla mail client can be POP or IMAP, with the former causing messages to be downloaded while the latter permits messages to be retained on the mail server. Most folks prefer IMAP for this reason. o 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: o 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. MPACK/MUNPACK tools are also available on OpenVMS Freeware V5.0. o With OpenVMS V7.2 and later, use the MIME tool supplied with OpenVMS. 6-2 Information on Mail __________________________________________________________ 6.3 How can I block SMTP mail relay spam? Use the anti-spam capabilities present in the TCP/IP Services V5.1 and later SMTP servers. Use a firewall. On earlier TCP/IP Services releases, some simple DCL can reportedly prevent relay SMTP spam. Use the UCX command SHOW SERVICE SMTP/FULL to find the directory containing the UCX$SMTP_RECV_STARTUP.COM file, and insert the following DCL: $ ! $ ! Block spam. $ ! $ MY_ADDRESS_LONG[0,32]=F$INTEGER(F$TRNLNM("SYS$REM_NODE")-"::") $ MY_ADDRESS=F$FAO("!UB.!UB.!UB.!UB",F$CVUI(0,8,MY_ADDRESS_LONG),- F$CVUI(8,8,MY_ADDRESS_LONG),F$CVUI(16,8,MY_ADDRESS_LONG),- F$CVUI(24,8,MY_ADDRESS_LONG))'" $ MY_ADDRESS_REVERSE=F$FAO("!UB.!UB.!UB.!UB",- F$CVUI(24,8,MY_ADDRESS_LONG),F$CVUI(16,8,MY_ADDRESS_LONG),- F$CVUI(8,8,MY_ADDRESS_LONG),F$CVUI(0,8,MY_ADDRESS_LONG))'" $ WRITE SYS$OUTPUT F$TIME()+" "+F$TRNLNM("SYS$REM_NODE")+MY_ADDRESS $ UCX SHOW HOST 'MY_ADDRESS_REVERSE'.INPUTS.ORBS.ORG $ IF $STATUS.EQ.1 $ THEN $ WRITE SYS$OUTPUT "SPAM from relay rejected" $ EXIT $ ENDIF $ UCX SHOW HOST 'MY_ADDRESS_REVERSE'.SPAMSOURCES.ORBS.ORG $ IF $STATUS.EQ.1 $ THEN $ WRITE SYS$OUTPUT "SPAM source relay rejected" $ EXIT $ ENDIF $ ! $ ! Run receiver. $ ! $ run sys$system:ucx$smtp_receiver.exe $ goto exit 6-3 _______________________________________________________ 7 Information on Utilities __________________________________________________________ 7.1 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. (These privileges are required, as the access to the CD-related extensions will require the use of the privilege-protected IO$_ DIAGNOSE I/O function code.) 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, available on OpenVMS VAX, and DECW$EXAMPLES:DECW$CDPLAYER.* on OpenVMS VAX and OpenVMS Alpha. The standard OpenVMS ATA (IDE) SYS$DQDRIVER device driver does not support the necessary does not support the necessary IO$_DIAGNOSE function code that is required for access to audio CD media commands (on OpenVMS versions prior to V7.3), but an updated SYS$DQDRIVER device driver (source code and all) with this capability and with the source code of an updated DECW$CDPLAYER CD audio player is available on the OpenVMS Freeware website (www.openvms.compaq.com/freeware/dqdriver/), and these updates are also included on OpenVMS Freeware V5.0, and OpenVMS ECO kits containing newer versions of the driver are available. OpenVMS Alpha V7.3 and later include a version of SYS$DQDRIVER with the necessary IO$_DIAGNOSE support. 7-1 Information on Utilities __________________________________________________________ 7.2 How do I access a Microsoft Windows floppy disk from OpenVMS? The HP Advanced Server (formerly known as PATHWORKS) for OpenVMS product includes an unsupported and undocumented utility called PCDISK, and this tool can read and write various Microsoft MS-DOS and Microsoft Windows FAT-format diskettes. 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.de. Engineering Software has a product called VAKSAT which will read, write, and erase files on MS-DOS FAT 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 and Microsoft Windows (FAT) format diskettes under OpenVMS, 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. o http://www.madgoat.com/ __________________________________________________________ 7.3 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 series systems, and DECsound, as supplied by DECwindows Motif, doesn't support this board. HP offers an optional product, Multimedia Services for OpenVMS: o http://www.compaq.com/info/spd/ OpenVMS typically uses SPD 25.01.xx and/or SPD 41.87.xx. which provides a replacement DECsound for this card as well as many other features (an AVI and MPEG player, video capture support, etc.) Ensoniq sound support is also available. 7-2 Information on Utilities __________________________________________________________ 7.4 Why is DECmigrate not working with Fortran? %OTS-F-INDATCOR internal data corrupted in Run- time Library This error can arise with Fortran programs if you are running a recent version of OpenVMS Alpha, and are using DECmigrate to translate Fortran applications. The DECmigrate Run-Time Library attempts to support mixed translated-native I/O to the same unit by sharing the native Fortran RTL's internal data structures, and in OpenVMS 7.2 these structures changed and the translated RTL was not updated accordingly. You can copy DEC$FORRTL.EXE from OpenVMS 7.1, copying it to some spare directory, and then defining the logical name DEC$FORRTL to point to it before running your translated application. Or rebuilding the application to use the available native Fortran compiler. Or you can apply the current Fortran RTL kit, which has a fix for this. See Section 13.11. __________________________________________________________ 7.5 How do I read IBM EBCDIC tapes on OpenVMS? Most (all?) IBM EBCDIC-based systems can read and write ANSI-labeled ASCII magtapes. Fixed-length records (MOUNT /FOREIGN /BLOCKSIZE=512 /RECORDSIZE=512, for one-block records) and the DCL COPY command can be used to transfer fixed-record-size text files out onto tape media, or to read from fixed-record tape media. Please consult the IBM documentation for the details and command syntax needed when reading and writing ANSI media using IBM JCL or other applicable IBM command language. There exists various freeware around (TAPECOPY, ETAPE, TCOPY, MTEXCH) that can read and write EBCDIC tapes. Visit the Encompasserve (DECUS) website software archives search engine (via http://www.decus.org/), and search for "EBCDIC" for details. OpenVMS does not include an integrated tool for EBCDIC tape processing, but does provide a character conversion API useful within application programs. 7-3 Information on Utilities One source for ETAPE is: o http://www.ualr.edu/ftp/vms/ETAPE_SRC/ The OpenVMS Freeware V5.0 distribution included this ETAPE tool, as well. __________________________________________________________ 7.6 How can I patch an OpenVMS Alpha image? Using the OpenVMS Freeware tool ZAP: o www.openvms.compaq.com/freeware/freeware50/rms_ tools/ tell ZAP to read a block (bucket) of information based on the virtual block number (VBN), using X for hexadecimal. Dump yourself into the OpenVMS debugger with R2 pointing into the buffer, EXAMINE/INSTRUCTION as needed, alter the buffer as required, GO to get out of the debugger and back into ZAP, and use the ZAP W command to write the updated block. 7-4 _______________________________________________________ 8 DCL Details __________________________________________________________ 8.1 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: $ unzip :== $disk:[dir]unzip.exe $ unzip -? The leading $ in the equivilence name for the symbol definition is what makes the DCL symbol a foreign command. If the device and directory are 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 Section 10.3. 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 8-1 DCL Details 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. For examples of how TCP/IP Services sets up its foreign commands (which includes tools such as uuencode and uudecode), please see the DCL command procedure SYS$STARTUP:TCPIP$DEFINE_COMMANDS.COM. Also see Section 8.10. __________________________________________________________ 8.2 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: __________________________________________________________ 8.3 Using REPLY/LOG from DCL? Disabling Console OPCOMs? Your terminal must be enabled as an operator terminal before the REPLY/LOG command can be used, but a DCL procedure (batch command file, system startup, etc) does not have an associated terminal. To make this work, use the following sequence to enable the OPA0: console as the operator terminal, then the REPLY/LOG command will be accepted: 8-2 DCL Details $ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/LOG $ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/ENABLE To disable the system console terminal (OPA0:) as an operator terminal, use the following command: $ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/DISABLE Also see SYLOGICALS.COM (and SYLOGICALS.TEMPLATE) for information on configuring the behaviour of OPCOM, including the (default) use of the system console (OPA0:) as an operator terminial and the specific contents and behaviour of the system operator log file OPERATOR.LOG. __________________________________________________________ 8.4 How do I generate a random number in DCL? Here is a random number generator, just do a GOSUB RAND and the global symbol RANDOM will contain a randomly generated number. You can feed the generator a ceiling value (__CEIL) or a new seed (__SEED). 8-3 DCL Details $! RAND - returns a positive random number ("RANDOM") between 0 and $! __CEIL - 1. $! sharris-at-sdsdmvax.fb3.noaa.gov $ 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 __________________________________________________________ 8.5 What does the MCR command do? The MCR is an artifact of RSX compatibility mode, the operating system from which OpenVMS is descended. MCR is the Monitor Console Routine, and the command is intended to activate RSX compatibility mode utilities. When used on OpenVMS, the command is most commonly used to run the specified image and-because the tool 8-4 DCL Details detects the image is not a compatibility-mode image- it acts as a form of RUN command with the default file specification of SYS$SYSTEM:.EXE. MCR passes any (optional) command line arguments in a fashion similar to a foreign command. In other words: $ MCR FOO BAR is equivalent to: $ FOO :== $FOO $ FOO BAR MCR is not documented. Use of a foreign command or the DCL$PATH mechanism is preferred. For details on this, see Section 8.1. __________________________________________________________ 8.6 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$environment("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/ 8-5 DCL Details 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. __________________________________________________________ 8.7 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. An example DCL command procedure that is rather more advanced than using the TYPE command as a trigger is included in the Ask The Wizard area: o http://www.openvms.compaq.com/wizard/ o http://www.openvms.compaq.com/wizard/wizard.zip For additional information, please see Section 3.9. 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.) __________________________________________________________ 8.8 How can I get the width setting of a terminal? $ width = f$getdvi(terminal,"DEVBUFSIZ") 8-6 DCL Details __________________________________________________________ 8.9 How can I substitute symbols in a PIPE? Use DCL ampersand substitution, and not apostrophe substitution. $ pipe show system | search sys$input opcom | (read sys$input pid ; pid=f$element(0," ",pid) ; define/system opcom_pid &pid) $ show log opcom_pid "OPCOM_PID" = "0000020B" (LNM$SYSTEM_TABLE) __________________________________________________________ 8.10 Use of RUN/DETACH, LOGINOUT, and logical names? With a command to create a detached process such as: $ RUN/DETACHED SYS$SYSTEM:LOGINOUT /INPUT=TEMP_INPUT.COM If you are trying to use a logical name as the /INPUT, /OUTPUT or /ERROR on a RUN/DETACH command, then you must translate the logical name specifications to physical references before passing them, or the definitions must reside in a logical name table that is visible to the newly-created process. Also note that LOGINOUT only creates the SYS$LOGIN, SYS$LOGIN_DEVICE, and SYS$SCRATCH logical names if it is processing a login that is based on the contents of a SYSUAF record-without access to the associated SYSUAF record, this information is not available to LOGINOUT. (If you want to see these particular logical names created, then please specify the /AUTHORIZE qualifier on the RUN/DETACHED command.) If you do not specify LOGINOUT as the image, then there is no easy way to get these logical names. Also, any logical names that are used in the target image file specification must also be in a logical name table accessible (by default) by the newly-created detached process. Shared tables include the group (if the process is in the same UIC group) and the system table. (If the target process is to be in another UIC group, a suitablly privileged user or application can create the necessary logical name(s) directly in the other group logical name table.) 8-7 DCL Details When in doubt, create a short DCL command file as input, and use a SHOW LOGICAL and similar commands to examine the context. (And use physical device and directory references on the RUN/DETACH of the LOGINOUT image, when specifying this command file as /INPUT.) Also remember to check both security auditing and system accounting when troubleshooting problems with the RUN/DETACH. Also see Section 8.1. __________________________________________________________ 8.11 How to use escape and control characters in DCL? To write a message and then the bell character, use: $ bell[0,7] = 7 $ write sys$output "Hello''bell'" To write blinking text, use: $ esc[0,7] = 27 $ text = "Blinking Text" $ write sys$output "''esc'[5m''text'''esc'[m" Also see sections Section 11.7, Section 12.1. 8-8 _______________________________________________________ 9 Files __________________________________________________________ 9.1 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 various websites can potentially recover the file, see question Section 13.1 for pointers. 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.) __________________________________________________________ 9.2 Why does SHOW QUOTA give a different answer than DIR/SIZE? DIRECTORY/SIZE doesn't take into account the size of file headers which are charged to your quota. Also, unless you use DIRECTORY/SIZE:ALL, you will 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. 9-1 Files $ DIRECTORY/SIZE=ALL/GRAND [username...] Grand total of D1 directories, F1 files, B1/B2 blocks. $ DIRECTORY/SIZZ=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 has drifted out of synchronization, then the system-manager can force a quota rebuild-due to various factors, the quota file can potentially drift from the actual use over time, and a periodic rebuild can be performed at appropriate intervals. Also be aware that the DIRECTORY/SIZE command can report larger values than might otherwise be expected when used to evaluate files and/or directories that are alias links-such as the system roots on OpenVMS system disks-as the command reports a total that is cumulative over all of the files and directories examined, without regard for which ones might be alias entries and which are not. (In other words, a DIRECTORY/SIZE of an entire OpenVMS system disk will report a disk useage value larger than the (usually more accurate) value reported by the SHOW DEVICE command. This as a result of the alias entries linking each SYS$SYSDEVICE:[SYSCOMMON]SYS*.DIR directory file and the SYS$SYSDEVICE:[000000]VMS$COMMON.DIR file together.) __________________________________________________________ 9.3 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 Journaling and host- or controller- based shadowing. 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 9-2 Files 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. For details on disk bad block handling on MSCP and on SCSI disk devices, please see Ask The Wizard (ATW) topic (6926). o http://www.openvms.compaq.com/wizard/ o http://www.openvms.compaq.com/wizard/wizard.zip For additional information, please see Section 3.9. __________________________________________________________ 9.4 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. Performance of larger directory files improves (greatly) with OpenVMS V7.2 and later-operations on directory files of 128 blocks and larger were rather slower on earlier OpenVMS releases due to the smaller size of the directory cache and due to the directory I/O processing logic. 9-3 Files For fastest directory deletions, consider a reverse deletion-delete from the last file in the directory to the first. This reversal speeds the deletion operation by avoiding unnecessary directory I/O operations as the files are deleted. Tools such as the Freeware DFU can be used for this purpose, as can various available reverse-DELETE DCL command procedures. __________________________________________________________ 9.5 What is the largest disk volume size OpenVMS can access? One Terabyte (TB; 2**31 blocks of 2**9 bytes; 0x07FFFFFFF blocks). 255 volumes in a volume set. The largest contiguous allocation possible for any particular file is 0x03FFFFFFF blocks. Prior to the release of V6.0, the OpenVMS file system was limited to disk volumes of 8.38 GB (2**24 blocks, 16777216 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. This limit due to the SCSI drivers used by and built into the console ROM to read the OpenVMS bootstrap files, and these same drivers are also used by OpenVMS to write the system crashump. There are numerous discussions of this VAXstation 3100 in the comp.os.vms newsgroup archives. Please use Google newsgroup search to search the archives for further details, for discussions of the workarounds, and for details of the potential for a simple failed bootstrap and particularly for discussions of the potential for severe system disk corruptions on crashes. Some SCSI disks with capacities larger than 8.58 gigabytes (GB) will require the use of an OpenVMS ECO kit (eg: ALPSCSI04_062 or later; see Section 14.26 for details) for new SCSI device drivers. Failure to use this ECO can cause "rounding errors" on the SCSI disk device capacity-OpenVMS will not use nor display 9-4 Files the full capacity of the drive-and "%sysinit-e-error mounting system device status equals 000008C4" (8C4 -> "%SYSTEM-?-FILESTRUCT, unsupported file structure level") errors during bootstrap. (One workaround for the bootstrap when the bitmap is located far into the disk is the use of INIT/INDEX=BEGIN.) The problem here involves the particular extensions and fields used for larger capacity disks within the SCSI specifications and within the various intepretations of same. For ATA (IDE) disk drives: o Versions of SYS$DQDRIVER *BEFORE* X-15 topped out at 8.455 GB. Fixed drivers (equal or greater than "X-15") were shipped in: o OpenVMS Alpha V7.2-1, and later o V7.2 UPDATE V1.0 ECO, and later o V7.1-2 UPDATE V1.0 ECO, and later o V7.1-2 UPDATE V3.0 ECO, and later o The newer SYS$DQDRIVER driver operates to disks up to 33 GB without (known) problems, and effectively works with rather larger disks (up to circa 137 GB) but is known to report an incorrect number of "cylinders" with disks above 33 GB. See Section 14.4.4.2 for additional ATA SYS$DQDRIVER information. Be aware that a known restriction in certain older versions of the Alpha SRM Console prevents booting most ATA (IDE) drives larger than 8.455 GB, depending on exactly where the various files are located on the volume. Updated SRM consoles for systems with SRM and ATA (IDE) drive support are (will be) available. (OpenVMS Engineering has successfully bootstrapped 20GB ATA (IDE) disks using the appropriate SRM console version.) 9-5 ---------------------------- #include ----------------------------- For additional, please see the OpenVMS FAQ -- www.hp.com/go/openvms/faq --------------------------- pure personal opinion --------------------------- Hoff (Stephen) Hoffman OpenVMS Engineering hoff[at]hp.com