Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!CITHEX.CALTECH.EDU!carl From: carl@CITHEX.CALTECH.EDU.UUCP Newsgroups: mod.computers.vax Subject: Re: reassignment in VMS Message-ID: <870203130348.017@CitHex.Caltech.Edu> Date: Tue, 3-Feb-87 16:04:02 EST Article-I.D.: CitHex.870203130348.017 Posted: Tue Feb 3 16:04:02 1987 Date-Received: Thu, 5-Feb-87 03:19:41 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 30 Approved: info-vax@sri-kl.arpa >My (FORTRAN) program writes graphics to the tektronics terminal. >It does so by assigning a channel to something and QIOW to this channel: > int2 = sys$assign('ugdevice',ddacn,,) ! hook for file output > if(.not. int2) int2 = sys$assign('tt',ddacn,,) ! if not file, terminal >......... > sys$qiow(,%val(ddacn),.....) >Now, when I 'assign a.a ugdevice', it bypasses first sys$assign (int2 is appa- >rently non-zero, second assign takes place, with the effect that output goes >to the terminal (tt)). If I 'assign dua0:[pzk]a.a ugdevice', the ddacn channel >is assigned to (probably) dua0:[pzk]a.a , but now the sys$qiow returns non-zero >status. >Could anybody explain this to me? >My goal is to redirect the output of the program to the file. >I am relatively new to VMS, so please don't say it should be obvious :^) But it IS obvious: SYS$ASSIGN assigns a channel to a DEVICE, not to a FILE. When you 'assign a.a ugdevice', the first call to SYS$ASSIGN returns the error code SS$_IVDEVNAM, which has the associated message text: "%SYSTEM-F-IVDEVNAM, invalid device name": i.e., A.A is not a device. When you 'assign dua0:[pzk]a.a ugdevice', SYS$ASSIGN assigns a channel to DUA0:. However, when you try to write to the device using SYS$QIOW, it turns out that you don't have the privs to write directly to the disk (and a good thing, too; if you had, the file structure on the disk would have become unreadable). You've got three choices: 1) You can use the QIO disk ACP interface (not recommended for a neophyte); 2) You can use calls to RMS (somewhat easier for a neophyte, but also somewhat complex and probably not necessary); or 3) You can use the FORTRAN OPEN and WRITE statements to do the I/O (probably your best bet).