=:The OpenVMS Frequently Asked Questions(FAQ)C

The OpenVMS Frequently Asked Questions(FAQ)



 r \ ^  
PreviousContentsIndex




@

Chapter 6
Information on Mail


}

6.1 MAIL keeps saying I have new messages, but I don't. What do I do?



HThe count of new mail messages is kept separately from your mail folder Cin SYS$SYSTEM:VMSMAIL_PROFILE.DATA. It sometimes happens that this Hcount differs from what's in your mail folder. If this happens, go into ?MAIL and repeat the READ/NEW command until you see no new mail Hmessages. Then enter the command one more time. This will resynchronize the counters.i

6.2 How do I send or read attachments in VMS MAIL?



EIs there any way to send or read mail with files as attachments from VMS?

CNot directly with the OpenVMS MAIL facility, but there are several other options:

a

6.3 How can I block SMTP mail relay spam?



GUse the anti-spam capabilities present in the TCP/IP Services V5.1 and later SMTP servers.

Use a firewall.

DOn earlier TCP/IP Services releases, some simple DCL can reportedly Gprevent relay SMTP spam. Use the UCX command SHOW SERVICE SMTP/FULL to Ffind the directory containing the UCX$SMTP_RECV_STARTUP.COM file, and insert the following DCL:

 

"
$       ! $       ! Block spam. 
$       ! G$       MY_ADDRESS_LONG[0,32]=F$INTEGER(F$TRNLNM("SYS$REM_NODE")-"::") I$       MY_ADDRESS=F$FAO("!UB.!UB.!UB.!UB",F$CVUI(0,8,MY_ADDRESS_LONG),- D         F$CVUI(8,8,MY_ADDRESS_LONG),F$CVUI(16,8,MY_ADDRESS_LONG),- )         F$CVUI(24,8,MY_ADDRESS_LONG))'" 5$       MY_ADDRESS_REVERSE=F$FAO("!UB.!UB.!UB.!UB",- E         F$CVUI(24,8,MY_ADDRESS_LONG),F$CVUI(16,8,MY_ADDRESS_LONG),- D         F$CVUI(8,8,MY_ADDRESS_LONG),F$CVUI(0,8,MY_ADDRESS_LONG))'" J$       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 6$         WRITE SYS$OUTPUT "SPAM from relay rejected" $         EXIT $       ENDIF @$       UCX SHOW HOST 'MY_ADDRESS_REVERSE'.SPAMSOURCES.ORBS.ORG $       IF $STATUS.EQ.1 
$       THEN 8$         WRITE SYS$OUTPUT "SPAM source relay rejected" $         EXIT $       ENDIF 
$       ! $       ! Run receiver. 
$       ! -$       run sys$system:ucx$smtp_receiver.exe $       goto exit 





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.

DThe standard OpenVMS IDE SYS$DQDRIVER does not support the necessaryBdoes not support the necessary IO$_DIAGNOSE function required for access to audio CD mediaH(on OpenVMS versions prior to V7.3), but an updated SYS$DQDRIVER device Fdriver (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 Gwebsite (www.openvms.compaq.com/freeware/dqdriver/), and these updates Aare also included on OpenVMS Freeware V5.0, and OpenVMS ECO kits 6containing newer versions of the driver are available.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.

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



DThe new AlphaStation systems use a different sound board (Microsoft FSound System) than the earlier DEC 3000 series systems, and DECsound, Gas supplied by DECwindows Motif, doesn't support this board. HP offers 5an optional product, Multimedia Services for OpenVMS:



Dwhich provides a replacement 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.

7See Section 13.11.e

7.5 How do I read IBM EBCDIC tapes on OpenVMS?



EIBM boxes can read ANSI-labeled ASCII magtapes. Fixed-length records Dand the DCL COPY command can be used to transfer text files around. (Check the IBM documentation for details.

FThere exists various freeware around (TAPECOPY, ETAPE, TCOPY, MTEXCH) Gthat can read and write EBCDIC tapes. Visit the DECUS website software Carchives search engine (via http://www.decus.org/), and search for "EBCDIC".

One source for ETAPE is:



8OpenVMS Freeware V5.0 includes 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.2.

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 




EAlso see SYLOGICALS.COM (and SYLOGICALS.TEMPLATE) for information on Gconfiguring the behaviour of OPCOM, including the (default) use of the Asystem 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 prefered. 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:



WFor additional information, please see Section 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 accessable (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.7, Section 12.1.




 r Y \ ^  
PreviousNextContentsIndex