From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 6-FEB-1993 23:12:05.79 To: info-vax@kl.sri.com CC: Subj: Story (long) about rewind. I have been having a lot of trouble with some simple concepts. One of them certainly is the positioning of a file. I may make a lot of mistakes, but I feel DEC has really missed the boat on a) giving the user the power to position a file, b) making that power conform to easy concepts and commands, c) communicating any info about a) and b) through help files. I was going to add some lines to a file I had already written, and published here and subsequently in vmsnet.sources . I first wrote the following snippet (if you can not bear to follow through my examples, you can jump to example 6): ************************************************************************ EXAMPLE 1. It does work! node.com.103 Incidentally I learned later that our system has a definition that the logical "scratch" be disk DUA2. $ say := write sys$output $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user scratch. sys$output $mcr ncp sho kno line $! $close scratch ! <<<<<<<<<<< note this line $! $open/read scratch scratch. $recno=0 $readloop: $read scratch rec $say rec $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like MNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: ************************************************************************ EXAMPLE 2. node.com.104 I then noticed that I had meant to say "close scratch." (with a period). I now see that this is wrong, because CLOSE, like OPEN, does want the logical name, not the absolute name. But adding the period makes it hang up after "close scratch." with the message "File has not been opened by DCL - check logical name. End of file detected." $ say := write sys$output $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user scratch. sys$output $mcr ncp sho kno line $! $close scratch. $! $open/read scratch scratch. $recno=0 $readloop: $read scratch rec $say rec $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like MNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: ************************************************************************ EXAMPLE 3. node.com.106 I tried adding the line "on error then continue". But this just makes it hang up after "read scratch rec" with the message that I was at the end of file. $ say := write sys$output $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user scratch. sys$output $mcr ncp sho kno line $! $on error then continue ! <<<<<<<<<<<<<<<<<<<<<<<<<< $close scratch. $! $open/read scratch scratch. $recno=0 $readloop: $read scratch rec ! <<<<<<<<<<<<<<<<<<<<<<<<< $say rec $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like MNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: ************************************************************************ EXAMPLE 4. node.com.100 Here is one that works. I was simultaneously proud that I had found the key, that opening and closing a file rewinds it, and angered at the stupid way DEC rewinds a file, and does not communicate that info to you [unless I am more stupid; and you will point out where it says so]. And, I realize I should be staying away from possibly reserved words like "scratch" or "scratch.". $ say := write sys$output $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user scratch. sys$output $mcr ncp sho kno line $! $open/read scratch scratch. !attempting to rewind the file <<<<<<<< $close scratch !attempting to rewind the file <<<<<<<< $! $open/read scratch scratch. $recno=0 $readloop: $read scratch rec $!say rec $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like MNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: $delete scratch..* $ say "=================================================================" ************************************************************************ EXAMPLE 5. node.com.109 Not being willing to leave well enough alone, and trying to check on what really was getting written, I added some lines. This does NOT work, because I am clobbering the assigned output with the "dir". $ say := write sys$output $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user scratch. sys$output $dir/sin/siz=all/out=a. scratch. ! <<<<<<<<<<<<<<<<<<<< $mcr ncp sho kno line $! $open/read scratch scratch. !attempting to rewind the file $close scratch !attempting to rewind the file $! $open/read scratch scratch. $recno=0 $readloop: $read scratch rec $say rec ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like MNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: $dir/sin/siz=all/out=b. scratch. ! <<<<<<<<<<< never reached $delete scratch..* $ say "=================================================================" ************************************************************************ EXAMPLE 6. nodeinfo.com.50 This is the final porduct, now changed to use better names, and including the snippet. Forgive me, but you have seen so much stuff here, I might as well put it here instead of vmsnet .sources. I have omitted Lionel's method of determining VAX vs. ALPHA. $ say := write sys$output $ say "You are on a ", f$getsyi("HW_NAME"), " named ", f$getsyi("NODENAME"), "." $ say "It was last booted on ", f$getsyi("boottime"),"." $ say "This system has ", f$getsyi("availcpu_cnt")," cpu(s);" - , " ", f$getsyi("activecpu_cnt")," is/are active." $ if .not f$getsyi("cluster_member") $ then $ say "It is not a member of a VAXCluster." $ else $ say "It is a member of a VAXcluster containing "- , f$getsyi("cluster_nodes")," nodes." $ say "This VAXcluster has a total cluster quorum of "- , f$getsyi("cluster_quorum")," votes, and " $ say " ",f$getsyi("cluster_votes"), " total cluster vote(s)." $ say "This node's quorum value is ", f$getsyi("node_quorum")- ," and it has ", f$getsyi("node_votes")," vote(s)." $ endif $ say " " $ say "We will now execute the equivalent of showing F$GETSYI(*)" $ say f$getsyi("activecpu_cnt"), " =activecpu_cnt" $ say f$getsyi("availcpu_cnt"), " =availcpu_cnt" $ say f$getsyi("archflag"), " =archflag" $ say f$getsyi("boottime"), " =boottime" $ say f$getsyi("character_emulated"), " =character_emulated" $ say f$getsyi("contig_gblpages"), " =contig_gblpages" $ say f$getsyi("cpu"), " =cpu" $ say f$getsyi("decimal_emulated"), " =decimal_emulated" $ say f$getsyi("d_float_emulated"), " =d_float_emulated" $ say f$getsyi("f_float_emulated"), " =f_float_emulated" $ say f$getsyi("free_gblpages"), " =free_gbl_pages" $ say f$getsyi("free_gblsects"), " =free_gbl_sects" $ say f$getsyi("g_float_emulated"), " =g_float_emulated" $ say f$getsyi("pagefile_free"), " =pagefile_free" $ say f$getsyi("pagefile_page"), " =pagefile_page" $ say f$getsyi("sid"), " =sid" $ say f$getsyi("swapfile_free"), " =swapfile_free" $ say f$getsyi("swapfile_page"), " =swapfile_page" $ say f$getsyi("version"), " =version" $ say " " $ say f$getsyi("cluster_fsysid"), " =cluster_fsysid" $ say f$getsyi("cluster_ftime"), " =cluster_ftime" $ say f$getsyi("cluster_member"), " =cluster_member" $ say f$getsyi("cluster_nodes"), " =cluster_nodes" $ say f$getsyi("cluster_quorum"), " =cluster_quorum" $ say f$getsyi("cluster_votes"), " =cluster_votes" $ say f$getsyi("hw_model"), " =hw_model" $! hw_model > 1023 is an ALPHA; otherwise VAX $ say f$getsyi("hw_name"), " =hw_name" $ say f$getsyi("nodename"), " =nodename" $ nn = f$getsyi("nodename") ! for use below $ say f$getsyi("node_area"), " =node_area" $ say f$getsyi("node_csid"), " =node_csid" $ say f$getsyi("node_hwtype"), " =node_hwtype" $ say f$getsyi("node_hwvers"), " =node_hwvers" $ say f$getsyi("node_number"), " =node_number" $ say f$getsyi("node_quorum"), " =node_quorum" $ say f$getsyi("node_swincarn"), " =node_swincarn" $ say f$getsyi("node_swtype"), " =node_swtype" $ say f$getsyi("node_swvers"), " =node_swvers" $ say f$getsyi("node_systemid"), " =node_systemid" $ say f$getsyi("node_votes"), " =node_votes" $ say f$getsyi("scs_exists"), " =scs_exists" $ say f$getsyi("system_rights"), " =system_rights" $ say f$getsyi("vector_emulator"), " =vector_emulator" $ say f$getsyi("vp_mask"), " =vp_mask" $ say f$getsyi("vp_number"), " =vp_number" $ say "=================================================================" $ say "We will now execute $SHOW CPU/FULL" $ on error then continue $ show cpu/full $ say "=================================================================" $ say "We will try to show Internet address." $! Another way would be to telnet to nn (which gives its address), then $! ctrl-], then exit $! and another way would be $ ucx show host 'nn', where nn was saved above. $ ucx show host 'f$trnlnm("ucx$inet_host") $!Last line suggested by Shawn Clifford. $ say "=================================================================" $ say "We will try to show DECnet Physical Working Ethernet address." $ mcr ncp show exec stat $ say "=================================================================" $ say "We will try to show Hardware Ethernet address." $! Obtain line from $mcr ncp sho kno line $assign/user nodeinfoscratch. sys$output $mcr ncp sho kno line $! $open/read scratch nodeinfoscratch. !attempting to rewind the file $close scratch !attempting to rewind the file $! $open/read scratch nodeinfoscratch. $recno=0 $readloop: $read scratch rec $!say rec $recno = recno + 1 $if recno .ne. 7 then goto readloop $knownline = f$extract(2,5,rec) !gets name like BNA-0 on our system $!sho sym knownline $ mcr ncp sho line 'knownline char $done: $delete nodeinfoscratch..* $ say "=================================================================" $ say "We will try to show node characteristics." $ mcr ncp show node 'nn char ************************************************************************ EXAMPLE 7. joblog.log This is the output produced at our site by the above nodeinfo.com.50 You are on a VAX 6000-420 named WILLOW. It was last booted on 25-JAN-1993 01:14:06.06. This system has 2 cpu(s); 2 is/are active. It is a member of a VAXcluster containing 4 nodes. This VAXcluster has a total cluster quorum of 2 votes, and 3 total cluster vote(s). This node's quorum value is 2 and it has 1 vote(s). We will now execute the equivalent of showing F$GETSYI(*) 2 =activecpu_cnt 2 =availcpu_cnt 14576 =archflag VAX =arch_name 25-JAN-1993 01:14:06.06 =boottime TRUE =character_emulated 10556 =contig_gblpages 11 =cpu TRUE =decimal_emulated FALSE =d_float_emulated FALSE =f_float_emulated 10984 =free_gbl_pages 274 =free_gbl_sects FALSE =g_float_emulated 158454 =pagefile_free 209984 =pagefile_page 184549382 =sid 32392 =swapfile_free 32392 =swapfile_page V5.5-2 =version 0000000005F6 =cluster_fsysid 25-JAN-1993 01:15:02.28 =cluster_ftime TRUE =cluster_member 4 =cluster_nodes 2 =cluster_quorum 3 =cluster_votes 160 =hw_model VAX 6000-420 =hw_name WILLOW =nodename 1 =node_area 00010002 =node_csid 6420 =node_hwtype 00A00000000000000B000006 =node_hwvers 504 =node_number 2 =node_quorum 009671C3A12953C0 =node_swincarn VMS =node_swtype V5.5 =node_swvers 0000000005F8 =node_systemid 1 =node_votes TRUE =scs_exists SYS$NODE_WILLOW =system_rights 0 =vector_emulator 0 =vp_mask 0 =vp_number ================================================================= We will now execute $SHOW CPU/FULL WILLOW, a VAX 6000-420 Multiprocessing is ENABLED. Full checking synchronization image loaded. PRIMARY CPU = 01 CPU 01 is in RUN state Current Process: JOBLOG_0000606C PID = 2040606D Revision levels: Pchip microcode = 6, RSSC = 0.0, XCA rev = 1. KA64A module revision = AM04, module serial number = SG939KH503. Compatibility group = 2. System serial number = 95009770. Capabilities of this CPU: PRIMARY QUORUM RUN Processes which can only execute on this CPU: CONFIGURE PID = 20400206 Reason: PRIMARY Capability CPU 02 is in RUN state Current Process: *** None *** Revision levels: Pchip microcode = 6, RSSC = 0.0, XCA rev = 1. KA64A module revision = AM05, module serial number = SG002PP485. Compatibility group = 2. System serial number = 95009770. Capabilities of this CPU: QUORUM RUN Processes which can only execute on this CPU: *** None *** ================================================================= We will try to show Internet address. LOCAL database Host address Host name 129.63.152.1 willow.ulowell.edu, willow, WILLOW.ULOWELL.EDU ================================================================= We will try to show DECnet Physical Working Ethernet address. Node Volatile Status as of 5-FEB-1993 14:57:08 Executor node = 1.504 (WILLOW) State = on Physical address = AA-00-04-00-F8-05 Active links = 4 Delay = 1 ================================================================= We will try to show Hardware Ethernet address. Line Volatile Characteristics as of 5-FEB-1993 14:57:12 Line = BNA-0 Receive buffers = 10 Controller = normal Protocol = Ethernet Service timer = 4000 Hardware address = 08-00-2B-13-A4-D9 Device buffer size = 1498 ================================================================= We will try to show node characteristics. Node Volatile Characteristics as of 5-FEB-1993 14:57:15 Executor node = 1.504 (WILLOW) Identification = DECnet-VAX V5.5-2, VMS V5.5-2 Management version = V4.0.0 Incoming timer = 45 Outgoing timer = 60 Incoming Proxy = Enabled Outgoing Proxy = Enabled NSP version = V4.1.0 Maximum links = 40 Delay factor = 80 Delay weight = 5 Inactivity timer = 60 Retransmit factor = 10 Routing version = V2.0.0 Type = area Routing timer = 600 Broadcast routing timer = 180 Maximum address = 1023 Maximum circuits = 16 Maximum cost = 1022 Maximum hops = 30 Maximum visits = 63 Maximum area = 63 Max broadcast nonrouters = 1022 Max broadcast routers = 1022 Maximum path splits = 1 Area maximum cost = 1022 Area maximum hops = 30 Maximum buffers = 100 Buffer size = 576 Nonprivileged user id = DECNET Nonprivileged password = DECNET Default access = incoming and outgoing Pipeline quota = 23000 Alias incoming = Enabled Alias maximum links = 32 Alias node = 1.599 (WOODS) Path split policy = Normal Maximum Declared Objects = 31 -- Brendan Welch, UMass/Lowell, W1LPG, welchb@woods.ulowell.edu