System Management Information o ftp://host/urlname.ext;type=a ! request ftp ascii/text transfer You can also often configure the particular web browser to choose the appropriate transfer mode by default, based on the particular file extensions, using a customization menu available in most web browsers. You can select that the specific file extentions involved use the FTP binary transfer mode, which will reduce the number of corruptions seen. _____________________________ 5.42.5 How do I write a BACKUP saveset to a remote tape? How to do this correctly was described at DECUS long ago. On the OpenVMS host with the tape drive, create the following SAVE-SET.FDL file: RECORD FORMAT fixed SIZE 8192 Then create BACKUP_SERVER.COM: $ ! $ ! BACKUP_SERVER.COM - provide remote tape service for BACKUP. $ ! $ set noon $ set rms/network=16 $ allocate mka500 tapedev $ mount/nounload/over:id/block=8192/assist tapedev $ convert/fdl=SAVE-SET sys$net tapedev:save-set. $ dismount/unload tapedev $ stop/id=0 On the node where you want to do the backup, use the DCL command: $ backup - srcfilespec - node"user pwd"::"task=backup_server"/block=8192/save 5-55 System Management Information One area which does not function here is the volume switch; multi-reel or multi-cartridge savesets. Since the tape is being written through DECnet and RMS and the magtape ACP, BACKUP won't see the media switch and will split an XOR group across the reel boundary. BACKUP might well be willing to read such a multi- reel or multi-cartridge saveset (directly, not over the net) as the XOR blocks are effectively ignored until and unless needed for error recovery operations. BACKUP likely will not be able to perform an XOR-based recovery across reel or cartridge boundaries. Unfortunately BACKUP can't read tapes over the network because the RMS file attributes on a network task access look wrong; the attributes reported include variable length records. _____________________________ 5.42.6 How to perform a DoD security disk erasure? Sometimes refered to as disk, tape, or media declassification, as formatting, as pattern erasure, or occasionally by the generic reference of data remanence. Various references to the US Deparment of Defence (DoD) or NCSC "Rainbow Books" documentation are also seen in this context. While this erasure task might initially appear quite easy, basic characteristics of the storage media and of the device error recovery and bad block handling can make this effort far more difficult than it might initially appear. Obviously, data security and sensitivity, the costs of exposure, applicable legal or administrative requirements (DoD, HIPPA or otherwise), and the intrinsic value of the data involved are all central factors in this discussion and in the decision of the appropriate resolution, as is the value of the storage hardware involved. With data of greater value or with data exposure (sometimes far) more costly than the residual value of the disk storage involved, the physical destruction of the platters may well be the most expedient, 5-56 System Management Information economical, and appropriate approach. The unintended exposure of a bad block containing customer healthcare data or of credit card numbers can quite be costly, of course, both in terms of the direct loss, and the longer-term and indirect costs of such exposures. Other potential options include the Freeware RZDISK package, the OpenVMS INITIALIZE/ERASE command (and potentially in conjunction with the $erapat system service) and OpenVMS Ask The Wizard (ATW) topics including (841), (3926), (4286), (4598), and (7320). For additional information on sys$erapat, see the OpenVMS Programming Concepts manual and the OpenVMS VAX examples module SYS$EXAMPLES:DOD_ERAPAT.MAR. Some disk controllers and even a few disks contain support for data erasure. Some DSSI Disk ISEs, for instance. For the prevention of casual disk data exposures, a generic INITIALIZE/ERASE operation is probably sufficient. This is not completely reliable, particularly if the data is valuable, or if legal, administrative or contractual restrictions are stringent-there may well be revectored blocks that are not overwritten or not completely overwritten by this erasure, as discussed above, and these blocks can obviously contain at least part of most any data that was stored on the disk - but this basic disk overwrite operation is likely sufficient to prevent the typical information disclosures. You will want to consult with your site security officer, your corporate security or legal office, with HP Services or your prefered service organization, or with a firm that specializes in erasure or data declassification tasks. HP Services does traditionally offer a secure disk declassification service. 5-57 System Management Information _____________________________ 5.42.7 How to enable telnet virtual terminals? To enable virtual terminal support for telnet and rlogin devices, add the following logical name definitions into SYLOGICALS.COM: $ DEFINE/SYSTEM/EXECUTIVE TCPIP$RLOGIN_VTA TRUE $ DEFINE/SYSTEM/EXECUTIVE TCPIP$TELNET_VTA TRUE See SYS$STARTUP:SYLOGICALS.TEMPLATE for details on the typical contents of SYLOGICALS.COM. In SYSTARTUP_VMS.COM, ensure that a command similar to the following is invoked: $ SYSMAN IO CONNECT VTA0/NOADAPTER/DRIVER=SYS$LOADABLE_IMAGES:SYS$TTDRIVER.EXE In MODPARAMS.DAT, add the following line or (if already present) mask the specified hexidecimal value into an existing TTY_DEFCHAR2, and perform a subsequent AUTOGEN with an eventual reboot: TTY_DEFCHAR2 = %X20000 This value is TT2$M_DISCONNECT. On older TCP/IP Services-versions prior to V5.0-you will have to perform the following UCX command: $ UCX UCX> SET CONF COMM/REMOTE=VIRTUAL _____________________________ 5.42.7.1 Volume Shadowing MiniCopy vs MiniMerge? MiniMerge support has been available for many years with OpenVMS host-based volume shadowing, so long as you had MSCP controllers (eg: HSC, HSJ, or HSD) which supported the Volume Shadowing Assist known as "Write History Logging". If you are interested in mini-merge and similar technologies, please see the Fibre Channel webpage and the information available there: o http://www.openvms.compaq.com/openvms/fibre/ 5-58 System Management Information Mini-Merge support was originally intended to be controller-based and was expected with HSG80 series storage controllers and was expected to require ACS 8.7 and OpenVMS Alpha V7.3-1. Host-based Mini-Merge (HBMM) is now available for specific OpenVMS releases via a shadowing ECO kit, and is also present in OpenVMS V8.2 and later. HBMM applies to the HSG80 series and-like host-based volume shadowing-to most other (all other?) supported storage devices. The following sections describe both Mini-Copy and Mini-Merge, and can provide a basis for discussions. _____________________________ 5.42.7.1.1 Mini-Copy? A Shadowing Full Copy occurs when you add a disk to an existing shadowset using a MOUNT command; the entire contents of the disk are effectively copied to the new member (using an algorithm that goes through in 127-block increments and reads one member, compares with the target disk, and if the data differs, writes the data to the target disk and loops back to the read step, until the data is equal for that 127- block section). (This is one of the reasons why the traditional recommendation for adding new volumes to a shadowset was to use a BACKUP/PHYSICAL copy of an existing shadowset volume, simply because the reads then usually matched and thus shadowing usually avoided the need for the writes.) If you warn OpenVMS ahead of time (at dismount time) that you're planning to remove a disk from a shadowset but re-add it later, OpenVMS will keep a bitmap tracking what areas of the disk have been modified while the disk was out of the shadowset, and when you re-add it later with a MOUNT command OpenVMS only has to update the areas of the returned disk that the bit- map indicates are now out-of-date. OpenVMS does this with a read source / write target algorithm, which is much faster than the shenanigans the Full Copy does, so even if all of the disk has changed, a Mini-Copy is faster than a Full Copy. 5-59 System Management Information _____________________________ 5.42.7.1.2 Mini-Merge? A Shadowing Merge is initiated when an OpenVMS node in the cluster (which had a shadowset mounted) crashes or otherwise leaves unexpectedly, without dismounting the shadowset first. In this case, OpenVMS must ensure that the data is identical, since Shadowing guarantees that the data on the disks in a shadowset will be identical. In a regular Merge operation, Shadowing uses an algorithm similar to the Full Copy algorithm (except that it can choose either of the members' contents as the source data, since both are considered equally valid), and scans the entire disk. Also, to make things worse, for any read operations in the area ahead of what has been merged, Shadowing will first merge the area containing the read data, then allow the read to occur. A Merge can be very time-consuming and very I/O intensive. If a node crashes, the surviving nodes can query to determine what exact areas of the disk the departed node was writing to just before the crash, and thus Shadowing only needs to merge just those few areas, so this tends to take seconds, as opposed to potentially requiring many minutes or even hours for a regular full Merge. __________________________________________________________ 5.43 Please explain DELETE/ERASE and File Locks? DELETE/ERASE holds the file lock and also holds a lock on the parent directory for the duration of the erasure. This locking can obviously cause an access conflict on either the file or on the directory- it might well pay to rename files into a temporary directory location before issuing the DELETE/ERASE, particularly for large files and/or for systems with multiple overwrite erase patterns in use; for any systems where the DELETE/ERASE erasure operation will take a while. 5-60 _______________________________________________________ 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.hp.com/go/openvms/freeware/, look for the directory /dqdriver/), and these updates are also included on OpenVMS Freeware V5.0, and OpenVMS ECO kits containing newer versions of the driver are available. Freeware V6.0 has a version of DQDRIVER that is newer than that of the OpenVMS Alpha V7.3-2 7-1 Information on Utilities release, with additional capabilities and with improved error diagnostics. OpenVMS Alpha V7.3 and later include a version of SYS$DQDRIVER with the necessary IO$_DIAGNOSE support. __________________________________________________________ 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/ The Freeware package WINFX is available on Freeware V6.0, and can read the FAT volume structure. o http://www.hp.com/go/openvms/freeware/ 7-2 Information on Utilities __________________________________________________________ 7.3 How do I play sound files on an AlphaStation? DECsound doesn't work. Various of the more recent 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 nor this interface. HP offers an optional product, Multimedia Services (MMOV) for OpenVMS: o http://h18000.www1.hp.com/info/spd/ OpenVMS typically uses SPD 25.01.xx, SPD 41.87.xx, and SPD 82.35.xx. which provides a replacement for 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.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. Also check for upgrades to DECmigrate (VEST and AEST) environments. See Section 13.12 for details. For DECmigrate-related PL/I information, see Section 13.3. 7-3 Information on Utilities __________________________________________________________ 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 and search for "EBCDIC" for details. o http://www.encompassus.org OpenVMS does not include an integrated tool for EBCDIC tape processing, but does provide a character conversion API useful within application programs. 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 Look for the RMS_TOOLS directory on Freeware V5.0: http://www.hp.com/go/openvms/freeware/ 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.hp.com/go/openvms/wizard/ For additional information on the OpenVMS Ask The Wizard (ATW) area and for a pointer to the available ATW Wizard.zip archive, 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.6, 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.hp.com/go/openvms/wizard/ For additional information on the OpenVMS Ask The Wizard (ATW) area and for a pointer to the available ATW Wizard.zip archive, 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 crashdump. 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.) Note All disk-related listed in this section are stated in units of "disk (base ten) gigabytes" 9-5 Files (1 GB = 10^9 bytes) and not in units of "software (base two) gigabytes" (1 GB = 2^30; 1 GB = 1073741824.) bytes. Please see Section 14.26 for details of the nomenclature and of the units. Be aware that larger disks that are using an extension of SCSI-2- disks that are using a mode page field that the SCSI-2 specifications normally reserved for tape devices-to permit a larger disk volume size will require a SCSI driver update for OpenVMS, and this change is part of V7.1-2 and later, and also part of ALPSCSI07_062 and later. (These larger disks disks will typically report a DRVERR, or will see the volume size "rounded down".) SCSI disks larger than 16777216 blocks cira 8.455 GB (base ten); 8GB (base two) require this ECO, or require the use of OpenVMS Alpha V7.1-2 or later. Applications written in C can be limited to file sizes of two gigabytes and less, as a result of the use of longword values within C file operations, and specifically off_t. This restriction is lifted in OpenVMS V7.3-1 and later, and with the application of the C ECO kits available for specific earlier releases. The use of a longword for off_t restricts applications using native C I/O to file sizes of two gigabytes or less, or these applications must use native RMS or XQP calls for specific operations. Also see Section 14.14, Section 14.26. __________________________________________________________ 9.6 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). "Use a volume set to provide a large, homogeneous public file space. You must use a volume set to create files that are larger than a single physical disk volume. (The file system attempts to balance the load on the volume sets, for example, by creating new files on the volume that is the least full at the time.)" 9-6 Files "You can add volumes to an existing volume set at any time. The maximum number of volumes in a volume set is 255." 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. Also see Section 2.17.1, Section 14.26. __________________________________________________________ 9.7 How do I write CD-Recordable or DVD media on OpenVMS? How to create CD-R, CD-RW, DVD-R, DVD+R, DVD-RW, or DVD+RW media on OpenVMS? o Acquire a comparatively recent SCSI-based or ATA (IDE) CD-R or DVD-R/RW or DVD+R/RW drive. Older drives can be very problematic, while newer drives are readily available, and are cheap and very fast. o Get LDDRIVER from the Freeware. Versions of LDDRIVER are latent in OpenVMS Alpha V7.3-1 and later. (Look within SYS$MANAGER:CDRECORD.COM for details.) Use of the current ECO kit for LDDRIVER (as available), or of the version of LD distributed with V8.2 (kitted on Freeware V7.0 as LD071), or later is prefered. (If you are not running the specified version, you will want to upgrade or you will want to use the DCL command SET FILE/CACHING_ ATTRIBUTES=NO_CACHING on the LD partition file. This is a workaround for an incompatibility found between older LDDRIVER versions and the XFC caching support.) Alternatively, you can acquire and load the VD64 package from the Freeware. o Get CDRECORD or CDWRITE or other similar recording tool. CDRECORD (part of CDRTOOLS), CDWRITE, and DVDRECORD (part of DVDRTOOLS) packages (DVDRECORD is a fork of CDRECORD) are freely available, and versions of CDRECORD are available on the Freeware V6.0 distribution. ( 9-7 Files http://www.hp.com/go/openvms/freeware/ ) An OpenVMS port of the cmcd CD audio ripper is also reportedly available. http://www.amb.org/xmcd/ Versions of CDRECORD (non-DVD) are latent in OpenVMS Alpha V7.3-1 and later. Commercial versions of CDDRECORD-with DVD capabilities-are also available for various platforms, and particularly a variant of CDRECORD known as CDRECORD-ProDVD. Beware the tool chosen: some versions and configurations of CDRECORD can record DVD media, as can the DVDRECORD package, as can the commercial DVDwrite package. Many versions of CDRECORD cannot record DVD media, including the version of CDRECORD latent within OpenVMS and the version found on Freeware V6.0; these versions cannot record DVD media. o Build the contents of the disk on the LD or VD64 device partition. o Use the chosen recording tool to record the contents of the LD or VD64 partition directly onto the optical medium. Alternatively, consider the following command on OpenVMS Alpha V7.3-1 and later: @SYS$MANAGER:CDRECORD.COM HELP While folks have had success getting PC-based CD-R/RW or DVD-R/RW or DVD+R/RW tools to work with OpenVMS partitions, it is far easier and more reliable to use the OpenVMS-based versions of these tools and directly- attached devices. If you use a Windows-based tool, you will want to specifically select its raw mode, image mode, or block-copy mode, depending on the terminology within the particular tool. The transfer mode and selections is variously refered to as a disk-at-once (DAO) 2048-byte block ISO Mode 1 raw/image/block data disk recording mode. 9-8 Files More details: Creation of CD recordable or DVD recordable media 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 (PC-based packages will be included in this), or the use of a host-based package such as the CDRECORD or CDWRITE13_VMS or other utilities, including OpenVMS ports of common open- source tools made available by Dr. Eberhard Heuser- Hofmann and various others. Commercial packages and options are also available. Dr. Heuser-Hofmann has DVDwrite , a commercial package which can record DVD media. ( http://home.tiscali.de/dvd4openvms ) OpenVMS can read ODS-2, ODS-5, and ISO-9660 format CD-ROMs. (If you are very careful, you can create a dual-format CD-R; a CD-R with both ODS-2 and ISO-9660 or both ODS-5 and ISO-9660 or both.) InfoServer hardware configurations are no longer available from HP, but may potentially be acquired through other means; as used equipment. InfoServer support also has very specific CD-R recording device prerequisites, and these recording devices are no longer generally available. Packages related to the use of DVD archiving are also available, see the multi-volume capabilities of the DVDarchive/restore Freeware. http://www.geocities.com/SiliconValley/Lakes/9999/vmscdwri.html Additional information is available at the following sites: o http://www.djesys.com/vms/cdrom.html o http://www.cd-info.com/CDIC/Technology/CD-R/vms.html o http://www.faqs.org/faqs/cdrom/cd- recordable/part1/preamble.html o http://www.tmesis.com/CDrom/ o http://www.tditx.com/~odsiso/ 9-9 Files U.S. Design offers a package that includes the tools necessary to create a CD or DVD-R with either ISO-9660 or ODS-2 format, for standalone CD-R/RW, DVD-R, or DVD+R/RW drives, for recent OpenVMS versions. Details are available at: o http://www.usdesign.com/ Also see Section 9.7.2 for details on access to recorded media on older CD-ROM drives. _____________________________ 9.7.1 CD and DVD notation, terminology? CD-ROM is pre-recorded Compact Disk media, and is the original and oldest CD format. The original CD media was physically stamped, a recording process that is now largely reserved to the highest-volume media reproduction requirements. CD-R is CD Recordable, a write-once storage medium that can be read by all but the oldest of CD drives; a format which can be read and often even recorded by most CD-RW drives. CD-RW is CD ReWritable, a format which is readable by many CD drives and by most CD-R drives, and with media that can be recorded and re-recorded by CD-RW drives. CD media recording speeds are listed as multiples of 150 kilobytes per second, so a 10X drive records at 1500 kilobytes (1.5 megabytes) per second. 600 MB (70 minutes) and 700 MB (80 minutes) recording capacities are both widely available. The minutes designation is derived from the traditional audio-format recording capacity of the particular media. DVD-R/RW is the older of two common Digital Versatile Disk recording formats, and the DVD-R Recordable or DVD-RW ReWritable media can be read by many DVD drives. As with CD-R formats in older CD drives, older DVD and particularly first-generation DVD players may have problems reading this media format. 9-10 Files DVD+R/RW is the newer of the two common Digital Versatile Disk recording formats, and the DVD+R Recordable or DVD+RW ReWritable media can be read by many DVD drives. Akin to DVD-R/RW media, older and particularly first-generation DVD drives can have problems reading this media format. The DVD Plus-series drives and media tend to record faster than Minus drives, as (as of this writing) the Plus (+) drives do not require an initial media formatting pass and the Minus (-) drives do. While the appropriate Plus (+) or Minus (-) DVD raw media must be chosen for the particular DVD recorder (and DVD recording drives that are compatible with and capable of using both Plus and Minus media are available), the resulting recorded media is generally readable (playable) in all recent DVD drives and DVD players, regardless of type. (Compatibility is best within the same media-series devices of course, but be certain to verify compatibility across devices regardless of the particular device or particular recording media chosen.) Presently Plus (+) media is slightly more expensive than Minus (-), but with the prices of all CD and all DVD media continuing to consistently fall, the differences in DVD media costs are becoming irrelevent for all but the production of huge volumes of DVD media. The rated DVD recording speeds are in multiples of 1353 kilobytes per second, thus a DVD 1X drive is roughly equivalent to a CD 9X drive in I/O requirements and transfer speed. DVD drive recording speed can and does vary. DVD disk drive recording speed is limited by the rated recording speed of the media used, so the slower (and cheaper) DVD media will not record any more quickly in a faster drive. A 2.4X DVD drive loaded with 1X media will record at 1X. 9-11 Files _____________________________ 9.7.2 Use of RRD42 and other older (embossed-media) CD drives? The RRD42 series SCSI CD-ROM drive is sufficiently old that it can have problems processing CD-R and CD-RW media. Other very old CD drives can have equivalent media compatibility problems when attempting to read (much) newer CD media and newer CD media technologies. These older CD drives are generally intended for use with the so-called embossed media, rather than with non-embossed recorded (recordable) media now in common circulation. Please consider using a slightly-less-ancient CD-ROM or CD-R or CD-RW drive when working with non-embossed recorded CD media. To paraphrase one knowledgable-though deliberately nameless-storage engineer, "The RRD42 drive is just past the drooling idiot stage". _____________________________ 9.7.3 Creating Bootable OpenVMS I64 CD or DVD Media? SYS$SETBOOT? If you are creating a bootable CD or DVD media for use with OpenVMS I64, you will want to specify the SYS$SETBOOT block size of 2048, and you will also want a disk cluster factor that is a multiple of four via INITIALIZE/CLUSTER=4 (or 8, or...), or you will want to ensure that SYS$EFI.SYS and SYS$DIAGNOSTICS.SYS are aligned to a multiple of four blocks; to a 2048 byte boundary. This alignment and this blocking is only necessary for OpenVMS I64, and only when creating optical media OpenVMS I64 for bootstraps. The default 512-byte block setting used by SYS$SETBOOT is the correct and expected value for traditional disk bootstraps on OpenVMS I64 systems. Once the boot files are loaded, OpenVMS I64 operates with 512-byte blocks; as is the case with ATAPI disks on OpenVMS Alpha, all application code will only see 512-byte blocks on optical media on OpenVMS I64. 9-12 Files OpenVMS I64 V8.2 and later are expected to have a version of SYS$SETBOOT that will flag a misaligned SYS$EFI.SYS and (if present) a misaligned SYS$DIAGNOSTICS.SYS file. For information on SYS$SETBOOT and the SET BOOTBLOCK command, please see Section 14.3.9 and see the OpenVMS documentation. The purpose and intent of the SYS$SETBOOT.EXE image and the SET BOOTBLOCK command is analogous to the WRITEBOOT.EXE image on existing OpenVMS VAX and OpenVMS Alpha systems. For information on CD and DVD optical media drives on OpenVMS, please see Section 14.30. __________________________________________________________ 9.8 What I/O transfer size limits exist in OpenVMS? The maximum transfer size is an attribute of the particular I/O device, controller and driver combination; there is no inherent limit imposed by OpenVMS (other than the fact that, today, byte counts and LBNs are generally limited to 32 bits). The maximum size of a device I/O request is limited by the value in UCB$L_MAXBCNT, which is set by the device driver based on various factors. (Also check the setting of the MAXBUF system parameter for buffered I/O transfers, and check the process quotas.) Currently, SCSI drivers limit I/O transfers to FE00(16) bytes, 65024 bytes (decimal). The reasons for this transfer size limitation are largely historical. Similarly, DSSI devices are limited to the same value, this for hardware-specific reasons. Transfers to HSC and HSJ device controllers via the CI are limited to 1,048,576 bytes. Client MSCP-served devices are limited to 65535 bytes-to help ensure that the I/O fragmentation processing happens on the client and not on the server system. Parts of the OpenVMS I/O subsystem are optimized for data transfers less than 64KB, because (obviously) most I/O operations are (substantially) less than that. OpenVMS can handle larger transfers, if the driver and the device can handle it. 9-13 Files Also see Section 9.4, Section 9.5. __________________________________________________________ 9.9 Can I use ODBC to connect to OpenVMS database files? Yes, you can use various available third-party packages that permit remote ODBC clients to access RMS files and various commercial databases via the network. For RMS, consider acquiring one of the packages available from EasySoft, Attunity Connect (formerly known as ISG Navigator), Oracle (DB Integrator), SolutionsIQ, OpenLink Software (OpenLink Universal Data Access), and Synergex. The unixODBC package available at http://www.unixodbc.org has variously been found to operate on OpenVMS, as well. For specific commercial databases (other than RMS, of course), contact the database vendor directly for assistance. __________________________________________________________ 9.10 If my disks are shown as VIOC Compatible, am I using XFC? Yes, you are using XFC caching. Disks that are using XFC caching use communication and coordination protocols that are compatible with the older VIOC caching implementation. With the initial implementation of XFC on OpenVMS, you can use the command SHOW MEMORY/CACHE to see no disks reported in full XFC mode; all disks shown will be listed in "VIOC Compatable Mode". If you have the OpenVMS system parameter VCC_FLAGS set to 2 and are using OpenVMS Alpha V7.3-1 or later, or are using OpenVMS Alpha V7.3 with the VMS73_XFC V2.0 ECO kit or later or with the UPDATE kits, you are using XFC. Another confusion: the XFC product version is and remains V1.0 in all released configurations, please do not confuse the internal XFC product version (displayed by various commands) with the version number associated with the various ECO kit(s). XFC V1.0 does not permit volumes to enter full XFC caching, as displayed by the 9-14 Files "Vols in Full XFC mode" portion of the DCL command SHOW MEMORY/CACHE output. __________________________________________________________ 9.11 RMS Sequential Files and Platform Portability? When working with mixed platforms, you will want to become familiar with the various RMS sequential record formats, including Variable with Fixed Control (VFC), stream, stream LF, and stream CR, among other record formats. Switching formats uses CONVERT/FDL or SET FILE/ATTRIBUTES. The former converts files, the latter resets attributes. Text editors tend to select attributes when creating new files that may or may not meet requirements. If the default attributes do not match your requirements, create a stub file, SET FILE/ATTR, then edit the existing file. (Most editors will preserve attributes on an existing file.) When working with Windows, stream is usually the best choice for sequential file operations. Stream LF is most commonly used with UNIX and C applications. Windows and UNIX tend not to be able to directly read files of "unexpected" sequential RMS record formats. VFC is a common OpenVMS format, encoding the record length into the record. It is this extra data that can cause corruption-like problems when viewed without RMS; either directly via $qio or via the file system API on other operating system platforms. You will want to look at the low-level record formats, and at the RMS and the Files and Applications documentation in the OpenVMS manuals. If transfering through other platforms, use of a current version of Zip (with the "-Vv" or "- Vv9" option) and unzip, or use of a BACKUP saveset will contain and maintain the RMS file and record attributes. (For BACKUP and its own attributes requirements, see the restoration tool.) 9-15 _______________________________________________________ 10 OpenVMS Programming Information __________________________________________________________ 10.1 Modular Programming, Facility Prefixes and Symbol Naming? Please first review the OpenVMS Programming Concepts Manual and the Guide to Modular Programming manuals. Both are available within the OpenVMS documentation set, and provide details of the expected norms for OpenVMS programs. o Learn about the facility prefix, and use a the appropriate prefix uniformly throughout all external symbols, all logical names, and all files located in shared directories. The prefix and the use of the dollar sign (<$>) and the underscore (<_>) help avoid collisions with other products. Use of the dollar sign is reserved to registered products. o Please consider use of tools such as the Freeware SDL package, and the GNM package. These permit you to generate include files and message documentation akin to that of OpenVMS, providing users of your product with a familiar environment. o For product installations, consider use of the PCSI installation utility, and provide a product-specific configuration DCL command procedure (usually SYS$MANAGER:prefix$CONFIG.COM) if configuration is required. o The product startup file is usually named SYS$STARTUP:prefix$STARTUP.COM, and the shutdown file (if needed) is usually SYS$STARTUP:prefix$SHUTDOWN.COM. OpenVMS provides a registry for facility prefixes and for MESSAGE message compiler codes. To request a prefix and a message facility code for a product you distributinng to other customer sites, send your 10-1 OpenVMS Programming Information request in a mail message addressed to product[-at- sign-]hylndr.sqp.zko.dec.com, requesting the submission form and details of the registration process. Note Please do not request facility prefixes for products that local to your business, your site, or your system. Facility prefixes and message codes and the facility registration process are intended solely for HP products and Partner Products (and yes, even OpenVMS Freeware packages) that will be distributed across multiple OpenVMS customer sites. For a list of common coding bugs, please see the remainder of this section of the FAQ and specifically Section 10.22, please also see the Ask The Wizard topic (1661), and for information on debugging an OpenVMS application, please see topic (7552). o http://www.hp.com/go/openvms/wizard/ For additional information on the OpenVMS Ask The Wizard (ATW) area and for a pointer to the available ATW Wizard.zip archive, please see Section 3.9. __________________________________________________________ 10.2 Can I have a source code example of calling...? Please use the available SEARCH command on OpenVMS, and please remember to search the available resources, including the support databases and the newsgroup archives. Please also realize that most OpenVMS system services use similar calling sequences, meaning that an example of calling sys$getjpi can be used as an example for sys$getsyi and sys$getdvi. Students: please do not expect folks to write your homework for you. As for search resources: o SEARCH SYS$EXAMPLES:*.* target o SEARCH TCPIP$EXAMPLES:*.* target o http://askq.compaq.com/ o http://www.openvms.compaq.com/freeware/ 10-2 OpenVMS Programming Information o http://www.google.com/ OpenVMS programming documentation, including the numerous example programs found in recent versions of the OpenVMS Programming Concepts manual, is available: o http://www.hp.com/go/openvms/doc/ As for details of argument passing, 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. For further details on using descriptors and particularly for using descriptors from C, please see Section 10.13. There is extensive information available on how to call OpenVMS system services and OpenVMS Run-Time Library routines, including examples in numerous languages. Among the best available references are: o Your language's User Manual o OpenVMS Programming Environment Manual o OpenVMS Programming Concepts Manual o OpenVMS Programming Interfaces: Calling a System Routine o OpenVMS Calling Standard In addition, if you are a subscriber to the HP Software Information Network (available to those with a software support contract), the support 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. Arne Vajhøj has put together a collection of OpenVMS example programs. It can be found at: o ftp://ftp.hhs.dk/pub/vms/ 10-3