=:The OpenVMS Frequently Asked Questions(FAQ)C

The OpenVMS Frequently Asked Questions(FAQ)



 r \ ^  
PreviousContentsIndex




J

Chapter 7
Information on Utilities


g

7.1 How do I play an audio CD on my workstation?



9If you've installed the DECwindows examples, you'll find DDECW$CDPLAYER.C, .DAT, .EXE, .UIL, and .UID. Copy the .UID and .DAT Hfiles to DECW$USER_DEFAULTS: (typically SYS$LOGIN:), define the logical Dname DECW$CD_PLAYER to be the device name of your CD-ROM drive (eg. DDKA400:), give yourself PHY_IO and DIAGNOSE privileges, and run the F.EXE. (These privileges are required, as the access to the CD-related Hextensions will require the use of the privilege-protected IO$_DIAGNOSE >I/O function code.) You can also install the image with these Bprivileges. See the source for additional details - note that the Hcomments regarding the need for SYSGEN CONNECT are no longer applicable (at least as of VMS V5.5-2).

GThere's also SYS$EXAMPLES:CDROM_AUDIO.C and .EXE, a non-Motif program, Gavailable on OpenVMS VAX, and DECW$EXAMPLES:DECW$CDPLAYER.* on OpenVMS VAX and OpenVMS Alpha.

CThe standard OpenVMS ATA (IDE) SYS$DQDRIVER device driver does not support the necessary+does not support the necessary IO$_DIAGNOSE6 function code that is required for access to audio CDCmedia commands (on OpenVMS versions prior to V7.3), but an updated FSYS$DQDRIVER device driver (source code and all) with this capability &and with the source code of an updatedCDECW$CDPLAYER CD audio player is available on the OpenVMS Freeware Awebsite (www.hp.com/go/openvms/freeware/, look for the directory E/dqdriver/), and these updates are also included on OpenVMS Freeware GV5.0, and OpenVMS ECO kits containing newer versions of the driver are Favailable. Freeware V6.0 has a version of DQDRIVER that is newer than Gthat of the OpenVMS Alpha V7.3-2 release, with additional capabilities $and with improved error diagnostics.

HOpenVMS Alpha V7.3 and later include a version of SYS$DQDRIVER with the necessary IO$_DIAGNOSE support.x

7.2 How do I access a Microsoft Windows floppy disk from OpenVMS?



AThe HP Advanced Server (formerly known as PATHWORKS) for OpenVMS Hproduct includes an unsupported and undocumented utility called PCDISK, Hand this tool can read and write various Microsoft MS-DOS and Microsoft Windows FAT-format diskettes.

HProGIS in Germany sells a product called VMove which supports DOS files Con many different device types. For more information, send mail to info@progis.de.

BEngineering Software has a product called VAKSAT which will read, Gwrite, and erase files on MS-DOS FAT diskettes. Available for both VAX ;and Alpha. Contact ed@cityscape.co.uk for more information.

DMadGoat PC Exchange (PCX) is a utility for copying files to and fromCMS-DOS and Microsoft Windows (FAT) format diskettes under OpenVMS, Gusing 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.



GThe Freeware package WINFX is available on Freeware V6.0, and can read the FAT volume structure.

7.3 How do I play sound files on an AlphaStation? DECsound doesn't work.



FVarious of the more recent AlphaStation systems use a different sound @board (Microsoft Sound System) than the earlier DEC 3000 series systems, andG DECsound, as supplied by DECwindows Motif, doesn't support this board H nor this interface. HP offers an optional product, Multimedia Services  (MMOV) for OpenVMS:



Hwhich provides a replacement for DECsound for this card as well as many Dother features (an AVI and MPEG player, video capture support, etc.)

(Ensoniq sound support is also available.f

7.4 Why is DECmigrate not working with Fortran?



 

"
<%OTS-F-INDATCOR internal data corrupted in Run-time Library 




GThis error can arise with Fortran programs if you are running a recent Hversion of OpenVMS Alpha, and are using DECmigrate to translate Fortran -applications. The DECmigrate Run-Time LibraryDattempts to support mixed translated-native I/O to the same unit by Bsharing the native Fortran RTL's internal data structures, and in DOpenVMS 7.2 these structures changed and the translated RTL was not updated accordingly.

GYou can copy DEC$FORRTL.EXE from OpenVMS 7.1, copying it to some spare Hdirectory, and then defining the logical name DEC$FORRTL to point to it >before running your translated application. Or rebuilding the Eapplication to use the available native Fortran compiler. Or you can <apply the current Fortran RTL kit, which has a fix for this.

HAlso check for upgrades to DECmigrate (VEST and AEST) environments. See mSection 13.12 for details. For DECmigrate-related PL/I information, see 3Section 13.3.e

7.5 How do I read IBM EBCDIC tapes on OpenVMS?



EMost (all?) IBM EBCDIC-based systems can read and write ANSI-labeled DASCII magtapes. Fixed-length records (MOUNT /FOREIGN /BLOCKSIZE=512 H/RECORDSIZE=512, for one-block records) and the DCL COPY command can be Fused to transfer fixed-record-size text files out onto tape media, or =to read from fixed-record tape media. Please consult the IBM Edocumentation for the details and command syntax needed when reading $and writing ANSI media using IBM JCL* or other applicable IBM command language.

FThere exists various freeware around (TAPECOPY, ETAPE, TCOPY, MTEXCH) Fthat can read and write EBCDIC tapes. Visit the Encompasserve (DECUS) 7website software archives search engine and search for "EBCDIC" for details.



HOpenVMS does not include an integrated tool for EBCDIC tape processing, Fbut does provide a character conversion API useful within application programs.

One source for ETAPE is:



DThe OpenVMS Freeware V5.0 distribution included this ETAPE tool, as well.b

7.6 How can I patch an OpenVMS Alpha image?



$Using the OpenVMS Freeware tool ZAP:



Ftell ZAP to read a block (bucket) of information based on the virtual Dblock number (VBN), using X for hexadecimal. Dump yourself into the GOpenVMS debugger with R2 pointing into the buffer, EXAMINE/INSTRUCTION Gas needed, alter the buffer as required, GO to get out of the debugger Hand back into ZAP, and use the ZAP W command to write the updated block.


7

Chapter 8
DCL Details


`

8.1 How do I run a program with arguments?



BThe RUN command does not accept arguments. To pass arguments to a Fprogram, you must use what is called a "foreign command". For example:

 

"
!$ unzip :== $disk:[dir]unzip.exe $ unzip -? 




HThe leading $ in the equivilence name for the symbol definition is what Hmakes the DCL symbol a foreign command. If the device and directory are omitted, SYS$SYSTEM: is assumed.

EUnder OpenVMS V6.2 and later, DCL supports automatic foreign command Fdefinition 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: 




FDCL will first look for a command in the DCL command table, and if no Amatch is found and if DCL$PATH is defined, it will then look for Ecommand procedures and executable images with filenames matching the Hcommand specified, in the directories specified via DCL$PATH. The first Ematch found is invoked, and under OpenVMS, the DCL$PATH support will >cause a command procedure to be activated in preference to an executable image.

AFor more information on foreign commands or on automatic foreign 8command support, see the OpenVMS User's Manual.

:See also Section 10.3.

EIf you want to create a detached process that takes arguments from a Acommand line, it must be run under the control of a command line Ginterpreter (CLI) (typically DCL). This is done by placing the command Gline in a file, specifying SYS$SYSTEM:LOGINOUT.EXE as the image to run /and the command file as the input. For example:

 

"
 $ OPEN/WRITE CMD TEMP_INPUT.COM $$ WRITE CMD "$ MYCOMMAND arguments" $ CLOSE CMD 9$ RUN/DETACHED SYS$SYSTEM:LOGINOUT /INPUT=TEMP_INPUT.COM 




EVarious OpenVMS library calls (such as lib$spawn(), cli$dcl_parse(), Band the C library system() call) require access to a command line Cinterpreter such as DCL to perform requested actions, and will not "operate if a CLI is not available.

DWhen a CLI is not available, these calls typically return the error status SS$_NOCLI.GAnd as mentioned above, invoke the image LOGINOUT to cause a CLI (such Cas DCL) to be mapped into and made available in the context of the target process.

HFor examples of how TCP/IP Services sets up its foreign commands (which Bincludes tools such as uuencode and uudecode), please see the DCL 8command procedure SYS$STARTUP:TCPIP$DEFINE_COMMANDS.COM.

:Also see Section 8.10.\

8.2 How can I clear the screen in DCL?



0The 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: 


n

8.3 Using REPLY/LOG from DCL? Disabling Console OPCOMs?



AYour terminal must be enabled as an operator terminal before the HREPLY/LOG command can be used, but a DCL procedure (batch command file, Hsystem startup, etc) does not have an associated terminal. To make this Dwork, use the following sequence to enable the OPA0: console as the ?operator terminal, then the REPLY/LOG command will be accepted:

 

"
!$ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/LOG !$ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/ENABLE 




HTo disable the system console terminal (OPA0:) as an operator terminal, use the following command:

 

"
!$ DEFINE/USER SYS$COMMAND _OPA0: $ REPLY/DISABLE 




AAlso see SYLOGICALS.COM (and SYLOGICALS.TEMPLATE) for informationFon configuring the behaviour of OPCOM, including the (default) use of Ethe system console (OPA0:) as an operator terminial and the specific Dcontents and behaviour of the system operator log file OPERATOR.LOG.c

8.4 How do I generate a random number in DCL?



GHere is a random number generator, just do a GOSUB RAND and the global Esymbol RANDOM will contain a randomly generated number. You can feed >the generator a ceiling value (__CEIL) or a new seed (__SEED).

 

"
D$! 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)' $ B$     __SEED == __TICK + (100 * __SECOND) + (6000 * __MINUTE) + -          (360000 * __HOUR) E$     ! 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 $ 6$ IF F$TYPE(__CEIL) .EQS. "" THEN __CEIL = %X3FFFFFFF $ $ __SEED == __SEED * 69069 + 1 $ 8$ RANDOM == (__SEED.AND.%X3FFFFFFF)/(%X40000000/__CEIL) $ 	$ RETURN 


W

8.5 What does the MCR command do?



GThe MCR is an artifact of RSX compatibility mode, the operating system Efrom which OpenVMS is descended. MCR is the Monitor Console Routine, ?and the command is intended to activate RSX compatibility mode Futilities. When used on OpenVMS, the command is most commonly used to Hrun the specified image and---because the tool detects the image is not Ga compatibility-mode image---it acts as a form of RUN command with the >default file specification of SYS$SYSTEM:.EXE. MCR passes any D(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.d

8.6 How do I change the OpenVMS system prompt?



EYou 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 Cestablish a tie-in that provides the information to the SET PROMPT command as required.

DIf you wish to display the default directory for instance, you will Dhave to establish a tie between the SET DEFAULT command and the SET HPROMPT commands, as there is no direct way to get the default directory Aas the DCL prompt. You can easily acquire or create a set of DCL Hcommand 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 other Eintercept, and use these tools to intercept the directory change and Breset the prompt accordingly. (This approach likely involves some >kernel-mode programming, and requires write access to various &undocumented OpenVMS data structures.)

FThere are related tools available from various sources, including the following web sites:

n

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



Yes, you can do this with DCL.

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



HFor additional information on the OpenVMS Ask The Wizard (ATW) area and Bfor a pointer to the available ATW Wizard.zip archive, please see 0Section 3.9.

DDCL does not include support asynchronous I/O, thus a predetermined Cprotocol or a predetermined "turn-around" command sequence must be Dimplemented in order to avoid protocol deadlocks---cases where both Etasks are trying to write or both tasks are trying to read. The task Gthat is writing messages to the network must write (or write and read) Fa predetermined sequence of messages, or it must write a message that Ftells the reader that it can now start writing messages. (This is the 8essence of a basic half-duplex network protocol scheme.)h

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



 

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


b

8.9 How can I substitute symbols in a PIPE?



@Use DCL ampersand substitution, and not apostrophe substitution.

 

"
D$ pipe show system | search sys$input opcom | (read sys$input pid ; A    pid=f$element(0," ",pid) ; define/system opcom_pid &pid) $ show log opcom_pid 0    "OPCOM_PID" = "0000020B" (LNM$SYSTEM_TABLE) 


k

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



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

 

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




BIf you are trying to use a logical name as the /INPUT, /OUTPUT or D/ERROR on a RUN/DETACH command, then you must translate the logical Gname specifications to physical references before passing them, or the Gdefinitions must reside in a logical name table that is visible to the newly-created process.

FAlso note that LOGINOUT only creates the SYS$LOGIN, SYS$LOGIN_DEVICE, and SYS$SCRATCHJ logical names if it is processing a login that is based on the contents G of a SYSUAF record---without access to the associated SYSUAF record, E this information is not available to LOGINOUT. (If you want to see B these particular logical names created, then please specify the 4 /AUTHORIZE qualifier on the RUN/DETACHED command.)

GIf you do not specify LOGINOUT as the image, then there is no easy way Eto get these logical names. Also, any logical names that are used in Cthe target image file specification must also be in a logical name Etable accessible (by default) by the newly-created detached process. CShared tables include the group (if the process is in the same UIC Hgroup) and the system table. (If the target process is to be in another EUIC group, a suitablly privileged user or application can create the Cnecessary logical name(s) directly in the other group logical name table.)

HWhen in doubt, create a short DCL command file as input, and use a SHOW GLOGICAL and similar commands to examine the context. (And use physical Bdevice and directory references on the RUN/DETACH of the LOGINOUT Fimage, when specifying this command file as /INPUT.) Also remember to Hcheck both security auditing and system accounting when troubleshooting problems with the RUN/DETACH.

8Also see Section 8.1.l

8.11 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" 




uAlso see sections Section 11.6, Section 12.1.




 r Y \ ^  
PreviousNextContentsIndex