=;The OpenVMS Frequently Asked Questions (FAQ)D

The OpenVMS Frequently Asked Questions (FAQ)



 r \ ^  
PreviousContentsIndex




@

Chapter 6
Information on Mail


A

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

}

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



Aif you see the %MAIL-W-NONEWMAIL, no new messages error Greported when MAIL indicates you have messages, then the NEWMAIL count has become skewed from reality.

AThe count of new mail messages is kept separately from your mail Dfolder, and is stored in VMSMAIL_PROFILE.DATA. It sometimes happens Dthat this count differs from what is stored in your mail folder. If Gthis arises, invoke MAIL and repeatedly enter the READ/NEW command (or Hpress the keypad hyphen key on an LK-compatible keyboard) until you see Fno 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 Ginconsistent across cluster members, your customer is likely missing a Fdefinition of the VMSMAIL_PROFILE logical name---and is probably also Hmissing definitions of other logical names associated with other shared Gfiles---or has one or more inconsistent definitions of this and likely of other logical names.

GFor details on the configuration data files that must be shared within Ha cluster, please see SYS$STARTUP:SYLOGICALS.TEMPLATE on V7.2 and later.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


A

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

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

7.4 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.5 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


A

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

b

8.1 DCL Symbols and OpenVMS Logical Names?



DCL symbolsCare programming-style variables implemented within the DCL command Dinterpreter, and these are used both for programming and to provide Dcommand verb synonyms. Symbols are local to the command interpreter Doperating within a particular process, and are not shared. Lists of Esymbols can be copied into subprocesses during a subprocess creation Eoperation, but these symbols are neither copied back into the parent Fprocess when the subprocess exits, nor are symbols ever shared across processes.

?Symbols can be specified in and utilized in basic mathematical Goperations, and bit-level operations are available with the f$cvsi and Ff$cvui bit extraction lexical functions, and with the square-brackets knotation for bit insertion (see Section 8.13 for an example), and with Gbitwise operators. Symbols are of two basic types, STRING and INTEGER, Band these (or an undefined symbol) can be differentiated with the Hf$type lexical function. DCL symbols can also be used as a mechanism to Fabbreviate a DCL command verb, or an easy way to invoke a DCL command procedure.

FSymbols can have local or global scope within a process, and scope is Gaffected by nested procedure calls and DCL constructs such as CALL and ESET SCOPE, but such discussions are beyond the scope of this section.

COpenVMS Logical names can store device names, device and directory >specifications, rooted or searchlist specifications, and full Ffilenames. Logical names can also store arbitrary data, but there are Hno native mathematical or bitwise operators available. Analogous to DCL Esymbols, process-local logical names can be copied into subprocesses Hduring a subprocess creation operation, but these process-local logical ?names are neither copied back into the parent process when the :subprocess exits, nor are these logical names ever shared.

Logical namesEare implemented deep within the OpenVMS executive, and are organized Hinto logical name tables. Logical names can be stored in tables private to a process(HLNM$PROCESS, the process-local logical name table) , that can be shared &among processes in the same job tree (HLNM$JOB, the job logical name table) or in logical name tables that are ,shared among larger groups of processes (eg:/LNM$GROUP, the UIC group logical name table andCLNM$SYSTEM, the system-wide logical name table). Logical names are @centrally intended to provide various I/O-related capabilities, 0including device independence and configuration Gcustomization---correctly-written application programs can use logical Anames to avoid embedding specific device or device and directory Gspecifications, and to allow filename and configuration customizations.

BOne of the most powerful capabilities of logical names beyond the Gdevice independence provided involves the defaulting capabilities; you =can use RMS parsing (directly, or with mechanisms such as theI f$parse lexical function) to provide a filename and a default filename. A To provide the mechanism that allows SYSUAF to be located in an G arbitrary position or even an arbitrary filename, a construct similar  to the following is used:

 

"
,$ UAF = F$PARSE("SYSUAF","SYS$SYSTEM:.DAT") 




EThis design allows the logical name SYSUAF to be optionally defined, Eand -- when present---to specify the particular location and name of Gthe file. Portions of the full file specification that are omitted are Dretrieved using the default translation of SYS$SYSTEM: and the file type of .DAT.

GLogical names also have assigned processor modes, as some translations Gmust be trustworthy. In the example above, only trusted and privileged Asystem users should be able to redirect the SYSUAF authorization Gdatabase, so any definition of the SYSUAF logical name must be made in /EXECUTIVE mode in a trusted logical name table.

5As for common OpenVMS terminology, logical names are C"defined" and the associated processing is refered to as G"translation", while symbols are "equated" and the @associated processing is refered to as "substitution".F"Lexical functions" are processing routines built into DCL, Hand typically prefixed with f$. Many of the lexical functions are built ;upon correspondingly-named system services, though not all.

DSymbol substitution occurs only when the DCL command interpreter is Hreading and processing the command input; for information on DCL symbol esubstitution, see Section 8.10. For program access, see the RTL ,routines lib$set_symbol and lib$get_symbol.)

@For information on logical name translation, please see f$trnlnm%lexical function and the DCL commandsC DEFINE and DEASSIGN, as well as underlying system services such asG sys$trnlnm. Logical name translation occurs when requested, or as the " file or I/O operation is started.

EPlease see the OpenVMS User's Guide in the OpenVMS documentation set 8for a far more detailed description of these constructs.

‰For related materials, please see Section 8.10 and Section 8.11.`

8.2 How do I run a program with arguments?



BThe RUN command does not accept arguments. To pass arguments to a program,Fyou must use what is called a "foreign command", and either Han explicit command as shown here, or an automatic 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 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: 




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.12.\

8.3 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.4 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.5 How do I generate a random number in DCL?



HWith V7.3-2 and later, f$unique can be useful here. Alternatively, here Bis a pseudo-random number generator, just do a GOSUB RAND and the Gglobal symbol RANDOM will contain a randomly generated number. You can Cfeed 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 







 r Y \ ^  
PreviousNextContentsIndex