f. OpenVMS FAQ -&- page 13)b @5z

HP OpenVMS Systems Documentation

 q> $"b,
Content starts here"D

The OpenVMS Frequently Asked Questions (FAQ)


 l n  
PreviousContentsIndex

W

8.6 What does the MCR command do?



FThe MCR is an artifact of RSX compatibility mode, the operating systemDfrom which OpenVMS is descended. MCR is the Monitor Console Routine,>and the command is intended to activate RSX compatibility modeEutilities. When used on OpenVMS, the command is most commonly used toGrun the specified image and---because the tool detects the image is notFa compatibility-mode image---it acts as a form of RUN command with the=default file specification of SYS$SYSTEM:.EXE. MCR passes anyC(optional) command line arguments in a fashion similar to a foreigncommand. 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$PATHpmechanism is preferred. For details on this, see Section 8.2.d

8.7 How do I change the OpenVMS system prompt?



DYou 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 toBestablish a tie-in that provides the information to the SET PROMPTcommand as required.

CIf you wish to display the default directory for instance, you willChave to establish a tie between the SET DEFAULT command and the SETGPROMPT 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 DCLGcommand procedures that perform the SET DEFAULT and SET PROMPT for you.9These DCL command procedures often use a command such as:

 

"
'$ set prompt='f$environment("default")'




=More advanced users could implement a system service or otherDintercept, and use these tools to intercept the directory change andAreset the prompt accordingly. (This approach likely involves some=kernel-mode programming, and requires write access to various&undocumented OpenVMS data structures.)

EThere are related tools available from various sources, including thefollowing web sites:

    &
  • ftp://ftp.hhs.dk/pub/vms/setpmt//
  • ftp://ftp.tmesis.com/sys_service_hook.srcC
  • James F. Duff has also made available a Macro32 tool known asF TIME_PROMPT, a tool that sets the prompt to the current system time.F
  • Many folks have contributed DCL procedures to perform this task.< Visit the newsgroup archives for information and examples.
n

8.8 Can I do DECnet task-to-task communication with DCL?



Yes, you can do this with DCL.

DThe OpenVMS DECnet documentation shows various simple examples usingFthe task object and the TYPE command to trigger the execution of a DCLDcommand procedure on a remote node. An example DCL command procedureEthat is rather more advanced than using the TYPE command as a trigger'is included in the Ask The Wizard area:



GFor additional information on the OpenVMS Ask The Wizard (ATW) area andAfor a pointer to the available ATW Wizard.zip archive, please see@Section 3.8.

CDCL does not include support asynchronous I/O, thus a predeterminedBprotocol or a predetermined "turn-around" command sequence must beCimplemented in order to avoid protocol deadlocks---cases where bothDtasks are trying to write or both tasks are trying to read. The taskFthat is writing messages to the network must write (or write and read)Ea predetermined sequence of messages, or it must write a message thatEtells the reader that it can now start writing messages. (This is the8essence of a basic half-duplex network protocol scheme.)h

8.9 How can I get the width setting of a terminal?



 

"
($ width = f$getdvi(terminal,"DEVBUFSIZ")


f

8.10 Why doesn't DCL symbol substitution work?



EThe DCL symbol substitution processing occurs only at the DCL prompt,Cnot within data and not within files. If you wish to perform symbolBsubstitution in this environment, you typically write a small fileGcontaining the command(s) and data to be invoked---potentially only theAdata---and you then invoke the created procedure or reference thespecified data.

CIn this case, use of a file containing nolinemode commands or otherBtechniques might be useful---you will want to ensure that the textFeditor you use does not attempt to use screen mode or similar, as thisDis not generally considered adventageous within a command procedure.

.Tools such as FTP have alternatives: COPY/FTP.

EDCL symbol substitution occurs in two passes, using the ampersand andEthe apostrophe. In most cases, only the apostrophe is necessary. In aGfew cases---such as the DCL PIPE command---you will may need to use theEampersand to get the substitution to work. The following example usesDampersand substitution to transfer the contents of the header into a logical name:

 

"
H$ PIPE CC/VERSION | (READ SYS$PIPE hdr ; DEFINE/JOB/NOLOG hdr &hdr )




FA logical name (in the job logical name table; shared by all processesGin the current job) was used as DCL symbols cannot be returned back out,from a DCL PIPE or other spawned subprocess.

For related materials, please see Section 8.1 and Section 8.11.c

8.11 How can I substitute symbols in a PIPE?



@Use DCL ampersand substitution, and not apostrophe substitution.

 

"
C$ 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)


k

8.12 Use of RUN/DETACH, LOGINOUT, and logical names?



4With a command to create a detached process such as:

 

"
8$ RUN/DETACHED SYS$SYSTEM:LOGINOUT /INPUT=TEMP_INPUT.COM




AIf you are trying to use a logical name as the /INPUT, /OUTPUT orC/ERROR on a RUN/DETACH command, then you must translate the logicalFname specifications to physical references before passing them, or theFdefinitions must reside in a logical name table that is visible to thenewly-created process.

EAlso note that LOGINOUT only creates the SYS$LOGIN, SYS$LOGIN_DEVICE,and SYS$SCRATCHI logical names if it is processing a login that is based on the contentsF of a SYSUAF record---without access to the associated SYSUAF record,D this information is not available to LOGINOUT. (If you want to seeA these particular logical names created, then please specify the4 /AUTHORIZE qualifier on the RUN/DETACHED command.)

FIf you do not specify LOGINOUT as the image, then there is no easy wayDto get these logical names. Also, any logical names that are used inBthe target image file specification must also be in a logical nameDtable accessible (by default) by the newly-created detached process.BShared tables include the group (if the process is in the same UICGgroup) and the system table. (If the target process is to be in anotherDUIC group, a suitablly privileged user or application can create theBnecessary logical name(s) directly in the other group logical nametable.)

GWhen in doubt, create a short DCL command file as input, and use a SHOWFLOGICAL and similar commands to examine the context. (And use physicalAdevice and directory references on the RUN/DETACH of the LOGINOUTEimage, when specifying this command file as /INPUT.) Also remember toGcheck both security auditing and system accounting when troubleshootingproblems with the RUN/DETACH.

HAlso see Section 8.2.l

8.13 How to use escape and control characters in DCL?



4To 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.


3

Chapter 9
Files


@

If you are searching for something here, please(consider using the text-format FAQ.

U

9.1 How can I undelete a file?



FOpenVMS doesn't have an "undelete" function. However, if youGare quick to write-protect the disk or if you can guarantee that no newGfiles get created or existing files extended, your data is still on theFdisk and it may be possible to retrieve it. The FLORIAN tool availableDfrom various websites can potentially recover the file, see questionvSection 13.1 for pointers. Other alternatives here include the DFU<tool, available on the OpenVMS Freeware CD-ROM distribution.

GIf you are setting up a user environment for yourself or for others, itAis quite easy to use DCL to intercept the DELETE command, using asymbol:

 

"
%$ DEL*ETE :== @SYS$LOGIN:MYDELETE.COM




EThe DELETE symbol will cause the procedure to be invoked whenever the@user enters the DELETE command, and it can copy the file(s) to aC"trashcan" subdirectory before issuing a "real"GDELETE on the files. Other procedures can retrieve the file(s) from theE"trashcan" subdirectory, and can (and should) clean out theE"trashcan" as appropriate. (Realize that this DELETE symbolAcan interfere with DELETE/GLOBAL and other similar DCL commands.)u

9.2 Why does SHOW QUOTA give a different answer than DIR/SIZE?



GDIRECTORY/SIZE doesn't take into account the size of file headers whichGare charged to your quota. Also, unless you use DIRECTORY/SIZE:ALL, youFwill see only the "used" size of the file, not the allocatedFsize which is what gets charged against your quota. Also, you may havefiles in other directories.

 

"
($ DIRECTORY/SIZE=ALL/GRAND [username...]6Grand total of D1 directories, F1 files, B1/B2 blocks.*$ DIRECTORY/SIZZ=ALL/GRAND [-]username.DIR1Grand total of 1 directory, 1 file, B3/B4 blocks.$ SHOW QUOTA0User [username] has B5 blocks used, B6 available=of B7 authorized and permitted overdraft of B8 blocks on disk




FIf 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 theFsystem-manager can force a quota rebuild---due to various factors, theEquota file can potentially drift from the actual use over time, and a;periodic rebuild can be performed at appropriate intervals.

FAlso be aware that the DIRECTORY/SIZE command can report larger valuesCthan might otherwise be expected when used to evaluate files and/orFdirectories that are alias links---such as the system roots on OpenVMSEsystem disks---as the command reports a total that is cumulative overCall of the files and directories examined, without regard for whichAones might be alias entries and which are not. (In other words, aBDIRECTORY/SIZE of an entire OpenVMS system disk will report a diskFuseage value larger than the (usually more accurate) value reported byFthe SHOW DEVICE command. This as a result of the alias entries linking=each SYS$SYSDEVICE:[SYSCOMMON]SYS*.DIR directory file and thew4SYS$SYSDEVICE:[000000]VMS$COMMON.DIR file together.)u

9.3 How do I make sure that my data is safely written to disk?

/

rEIf your application must absolutely guarantee that data is available,iCno matter what, there's really no substitute for RMS Journaling andrDhost- or controller-based shadowing. However, you can achieve a goodGdegree of data integrity by issuing a SYS$FLUSH RMS call at appropriatemBtimes (if you're using RMS, that is.) If you're using a high-levelDlanguage's I/O system, check that language's documentation to see ifEyou can access the RMS control blocks for the open file. In C you cansuse fflush followed by fsync.=

t?For details on disk bad block handling on MSCP and on SCSI disk-6devices, please see Ask The Wizard (ATW) topic (6926).

r

GFor additional information on the OpenVMS Ask The Wizard (ATW) area andaAfor a pointer to the available ATW Wizard.zip archive, please see @Section 3.8.v

9.4 What are the limits on file specifications and directories?



rDA file specification has an aggregate maximum size of 255 characters(NAM$C_MAXRSS) at present, assuming ODS-2e8limits and traditional DCL process parsing settings (SETPROCESS/PARSE_STYLE). =The node and device specification may be up to 255 charactersdEeach---file name and file types may be up to 39 characters each. Fileo@versions are from 1 through 32767, though 0 (latest version), -0C(oldest version) and -n (n'th previous version) can be used in most$Gcontexts. A file specification may not have more than 8 directories andiBsubdirectories or---with a rooted directory, two sets of eight areGpossible---and while it is possible to create subdirectories of greaternAdepth, accessing them under ODS-2 is somewhat problematic in most>"cases, and thus should be avoided.

e Under ODS-5 5 with extended DCL parsing (SET PROCESS/PARSE_STYLE),r? the filename length limits are up around 4,095 (NAML$C_MAXRSS)t; characters, and directories can be around 255 levels deep.m

2GApplication developers should use OpenVMS-supplied routines for parsing Dfile specifications - this ensures that changes in what is allowableGwill not tend to break your application. Consider that various parts ofpFthe file specification may contain quoted strings with embedded spacesBand other punctuation! Some routines of interest are SYS$FILESCAN,ASYS$PARSE and LIB$TRIM_FILESPEC. For further information, see theo#OpenVMS Guide to File Applications.s

aEPerformance of larger directory files improves (greatly) with OpenVMSpGV7.2 and later---operations on directory files of 128 blocks and larger Fwere rather slower on earlier OpenVMS releases due to the smaller sizeEof the directory cache and due to the directory I/O processing logic.

EFor fastest directory deletions, consider a reverse deletion---delete>Ffrom the last file in the directory to the first. This reversal speedsGthe deletion operation by avoiding unnecessary directory I/O operationsnDas the files are deleted. Tools such as the Freeware DFU can be usedfor this purpose,r?as can various available reverse-DELETE DCL command procedures.d

SQAlso see Section 5.44. s

9.5 What is the largest disk volume size OpenVMS can access?

r

FOne Terabyte (TB; 2**31 blocks of 2**9 bytes; 0x07FFFFFFF blocks). 255Gvolumes in a volume set. The largest contiguous allocation possible foro*any particular file is 0x03FFFFFFF blocks.

iDPrior 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.

uCOn some systems, there are restrictions in the console program thatGlimit the size of the OpenVMS system disk. Note that data disks are notnCaffected by console program limits. For example, all members of themVAXstation 3100hBseries are limited to a system disk to 1.073 GB or less due to theEconsole, though larger data disks are possible. This limit due to the/GSCSI drivers used by and built into the console ROM to read the OpenVMS/Cbootstrap 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"Ecomp.os.vms newsgroup archives. Please use Google newsgroup search tox?search the archives for further details, for discussions of theuAworkarounds, and for details of the potential for a simple failedrFbootstrap and particularly for discussions of the potential for severe#system disk corruptions on crashes.w

tDSome SCSI disks with capacities larger than 8.58 gigabytes (GB) willFrequire the use of an OpenVMS ECO kit (eg: ALPSCSI04_062 or later; see{Section 14.25 for details) for new SCSI device drivers. Failure to uses<this ECO can cause "rounding errors" on the SCSI disk deviceDcapacity---OpenVMS will not use nor display the full capacity of theBdrive---and "%sysinit-e-error mounting system device status equalsF000008C4" (8C4 -> "%SYSTEM-?-FILESTRUCT, unsupported file structureGlevel") errors during bootstrap. (One workaround for the bootstrap whene5the bitmap is located far into the disk is the use ofFINIT/INDEX=BEGIN.) The problem here involves the particular extensions9and fields used for larger capacity disks within the SCSI>=specifications and within the various intepretations of same. 

aFor ATA (IDE) disk drives:

    D
  • Versions of SYS$DQDRIVER *BEFORE* X-15 topped out at 8.455 GB.C
    Fixed drivers (equal or greater than "X-15") were shipped in:g
      '
    • OpenVMS Alpha V7.2-1, and latert'
    • V7.2 UPDATE V1.0 ECO, and laters)
    • V7.1-2 UPDATE V1.0 ECO, and laterr)
    • V7.1-2 UPDATE V3.0 ECO, and latern
    rI
  • The newer SYS$DQDRIVER driver operates to disks up to 33 GB withoutbI (known) problems, and effectively works with rather larger disks (up topI circa 137 GB) but is known to report an incorrect number of "cylinders"h with disks above 33 GB.y


dwSee Section 14.4.4.2 for additional ATA SYS$DQDRIVER information.t

eBBe aware that a known restriction in certain older versions of theDAlpha SRM Console prevents booting most ATA (IDE) drives larger thanE8.455 GB, depending on exactly where the various files are located onhCthe volume. Updated SRM consoles for systems with SRM and ATA (IDE)/?drive support are (will be) available. (OpenVMS Engineering has/Dsuccessfully bootstrapped 20GB ATA (IDE) disks using the appropriateSRM console version.)l

s

/e o d
Note

DAll disk-related listed in this section are stated in units of "diskF(base ten) gigabytes" (1 GB = 10^9 bytes) and not in units ofA"software (base two) gigabytes" (1 GB = 2^30; 1 GB = 1073741824.)1{bytes. Please see Section 14.25 for details of the nomenclature and ofbthe units.


fCBe aware that larger disks that are using an extension of SCSI-2---oEdisks that are using a mode page field that the SCSI-2 specificationsMCnormally reserved for tape devices---to permit a larger disk volumeoFsize will require a SCSI driver update for OpenVMS, and this change isCpart of V7.1-2 and later, and also part of ALPSCSI07_062 and later.aE(These larger disks disks will typically report a DRVERR, or will seegGthe volume size "rounded down".) SCSI disks larger than 16777216 blocks Ecira 8.455 GB (base ten); 8GB (base two) require this ECO, or require)the use of OpenVMS Alpha V7.1-2 or later.e

cGApplications written in C can be limited to file sizes of two gigabytesyAand less, as a result of the use of longword values within C fileeAoperations, and specifically off_t. This restriction is lifted ingDOpenVMS V7.3-1 and later, and with the application of the C ECO kitsBavailable for specific earlier releases. The use of a longword forDoff_t restricts applications using native C I/O to file sizes of twoCgigabytes or less, or these applications must use native RMS or XQPncalls for specific operations.

xAlso see Section 14.13, Section 14.25.x

9.6 What is the maximum file size, and the RMS record size limit?



TDRMS can store individual files of a size up to the maximum supportedFvolume size. Under OpenVMS V6.0 and later, the volume size and the RMSCmaximum file size limit is 2**31 * 512 bytes---one terabyte (1 TB).a

B"Use a volume set to provide a large, homogeneous public fileGspace. You must use a volume set to create files that are larger than a Esingle physical disk volume. (The file system attempts to balance the(Bload on the volume sets, for example, by creating new files on the1volume that is the least full at the time.)"s

iD"You can add volumes to an existing volume set at any time. The7maximum number of volumes in a volume set is 255.",

eDThe RMS formats---sequential, relative, and indexed---are limited byDthe one terabyte maximum volume size. RMS relative files are furtherClimited to a number of records that will fit in 32 bits---4 billionCrecords. Sequential and indexed formats do not have a record limit. 

mAlso see Section 2.17.1, Section 14.25.>p

9.7 How do I write CD-Recordable or DVD media on OpenVMS?



lCHow to create CD-R, CD-RW, DVD-R, DVD+R, DVD-RW, or DVD+RW media on OpenVMS?

rEFor information on CD and DVD optical media drives on OpenVMS, please~see Section 14.29. For information on the creation of OpenVMS media andEof OpenVMS bootable media, a full step-by-step sequence is documentednEin the OpenVMS Ask The Wizard topic (9820). An abbreviated version ofhthe sequence is included here.

GRecording (writing) of CD and DVD optical media requires a recording orm<media mastering application or tool, and both commercial andGnon-commercial options are available. Please see CDRECORD (both non-DVDaFand DVD versions are available, and at least one commercial version isAavailable), and also see DVDwrite (commercial) or DVDRECORD (openrCsource). A port of CDRECORD is present in OpenVMS V7.3-1 and later.d

    F
  • Acquire a comparatively recent SCSI-based or ATAPI (IDE) CD-R orG DVD-R/RW or DVD+R/RW drive. Older drives can be very problematic,aH while newer drives are readily available, and are cheap and very fast,I and tend to have better compliance with current standards. Use of olderxI drives is not recommended. Related device requirements informationrW is available in Section 14.29.bI
  • Get the most recent LDDRIVER available on the Freeware, or activate E and use the LD version latent in OpenVMS Alpha V7.3-1 and V7.3-2 byMG loading the LD command verb (look within SYS$MANAGER:CDRECORD.COM forcF related details), or use the integrated LD found in OpenVMS V8.2 andH later.
    In particular, you will want to use the current ECO kit forF LDDRIVER (as available), or the version of LD distributed with V8.2.G The OpenVMS V8.2 version of LDDRIVER was also kitted on Freeware V7.0,H as LD071.
    If you are not running OpenVMS V8.2, the specified LD071B kit or later, or a current ECO with the update, you will want to3 upgrade, or you will want to use the DCL command:>

    n 
    w
    "
    &SET FILE/CACHING_ATTRIBUTES=NO_CACHING
    
    a
    Eon the LD partition file. This is a workaround for an incompatibilityBfound between older LDDRIVER versions and the XFC caching support.F
    As an alternative to LD and LDDRIVER, you can acquire and load theVD64 package from the Freeware.>

  • Get CDRECORD or CDWRITE or other similar recording tool.B
    CDRECORD (part of CDRTOOLS), CDWRITE, and DVDRECORD (part ofB DVDRTOOLS) packages (DVDRECORD is a fork of CDRECORD) are freely: available, and versions of CDRECORD are available on theaFreeware V6.0 distribution. ( r,http://www.hp.com/go/openvms/freeware/ ) An OpenVMS port of the cmcd CD audio ripper is also reportedly available. bhttp://www.amb.org/xmcd/ I
    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.C
    Beware the tool chosen: some versions and configurations ofbK CDRECORD can record DVD media, as can the DVDRECORD package, as can thee commercial DVDwrite package.B Many versions of CDRECORD cannot record DVD media, including theD version of CDRECORD latent within OpenVMS and the version found on8 Freeware V6.0; these versions cannot record DVD media.H
  • Build the contents of the disk on the LD or VD64 device partition.G
  • Use the chosen recording tool to record the contents of the LD or 2 VD64 partition directly onto the optical medium.


EAlternatively, consider the following command on OpenVMS Alpha V7.3-1e and later:

l 
e
"
@SYS$MANAGER:CDRECORD.COM HELP

S


rDWhile folks have had success getting PC-based CD-R/RW or DVD-R/RW orDDVD+R/RW tools to work with OpenVMS partitions, it is far easier andBmore reliable to use the OpenVMS-based versions of these tools andDdirectly-attached devices. If you use a Windows-based tool, you willCwant to specifically select its raw mode, image mode, or block-copy Bmode, depending on the terminology within the particular tool. TheFtransfer mode and selections is variously refered to as a disk-at-onceD(DAO) 2048-byte block ISO Mode 1 raw/image/block data disk recordingmode.p

6EMore details: Creation of CD recordable or DVD recordable media underd@OpenVMS typically involves one of two approaches: the use of theoptional CD-R (`Scribe')Fcapabilities available for the InfoServer or other "offline"Fhardware packages (PC-based packages will be included in this), or theDuse of a host-based package such as the CDRECORD or CDWRITE13_VMS orDother utilities, including OpenVMS ports of common open-source toolsAmade available by Dr. Eberhard Heuser-Hofmann and various others.r3Commercial packages and options are also available./Dr. Heuser-Hofmann has DVDwritee<, a commercial package which can record DVD media. ( s




 i cl n  i
PreviousNextContentsIndex

 

e#e6c