| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
  Quest Software Sponsor Message

January 2000

Net.digest summarizes helpful technical discussions on the HP 3000 Internet newsgroup and mailing list. Advice here is offered on a best-effort, Good Samaritan basis. Test these concepts for yourself before applying them to your HP 3000s.

Edited by John Burke

If anyone is reading this, then I guess we survived Y2K reasonably intact. For what it is worth, I pledge to never utter that “word” again. My, that felt liberating.

Maybe it was the end of the millennium or just the holiday period, but the last month of 1999 saw more off-topic postings then any normal two months. Some highlights (or lowlights, depending on your point of view): bridges failing due to harmonic vibration, a quote from Eugene Volokh (circa the very early ‘80s) predicting the HP 3000 would not be around on 12/31/99, the scientific method as it applies to the Mars exploration, how not to do e-commerce, the American Thanksgiving holiday (rather thoroughly trashed, by the way), the 25 shortest books (number 2 is the Amish telephone directory), etc. You get the point — it was a wacky month.

As always though, there were still hundreds of postings with technical merit.

Again, I would like to hear from readers of net.digest and Hidden Value. Even negative comments are welcome. If you think I’m full of it or goofed, or a horse’s behind, let me know. If something from these columns helped you, let me know. If you’ve got an idea for something you think I missed, let me know. Are you seeing a pattern here? You can reach me at john.burke@paccoast.com or john_burke@pacbell.net.

What’s the most common question about CI programming?

Answer: How can I read records from a file into a variable?

How often has this question or some variant been asked on 3000-L? Lots of times. Including this month. I’ve even dealt with it before in Hidden Value. However, it is such a common need once you get into any kind of CI programming that I am presenting here, from Jeff Vance, HP’s architect of the CI, the complete, definitive answer. Cut this out and keep it handy.

From Jeff:

I am assuming you want to know how to do this via the CI. The basic problem is that the CI’s IO redirection opens the file and causes the record pointer to be set to the beginning. This is done each time the IO redirection is encountered by the CI. Thus, if you try to read from a file in a WHILE loop using the INPUT command, you will read only the first record each iteration. Below are some ways to overcome this restriction.

Method 1: Using a MSG file.
PROS: Simple, easy to maintain, and an easy way to read small files or make quick and dirty scripts.
CONS: Slow, especially if the file is long.
Basic idea:
- use a file equation to create a MSG file
- redirect output to this MSG file
- use the INPUT command to read from the MSG file via IO redirection.

Example:
PARM p1, p2, ...
#comments...
file myfile;MSG
errclear
continue
listf !p1,2 >*myfile
if hpcierr = 0 then
setvar eof FINFO(“*myfile”,”eof”)
while setvar(eof,eof-1) > 0 do
input record_var <*myfile
showvar record_var ... etc...
endwhile
endif
reset myfile
deletevar record_var,eof

Method 2: Using a flat file.
PROS: Most efficient way in the CI to read files.
CONS: Less intuitive and more effort to author.
Basic idea:
- create a file via IO redirection
- xeq the same script with the script’s input redirected to the file created in step 1.
- use the INPUT command or input() function to read from the file (with no IO redirection since the input for the entire script is redirected here).

Example:
PARM p1, p2, ..., entry=main
#comments...
if “!entry” = “main” then
# in the main part of the script
errclear
continue
listf !p1,2 >myfile
if hpcierr = 0 then
# execute same script with input redirected
xeq !HPFILE !p1, !p2, ... entry=alternate <myfile
endif
deletevar record_var,eof
return
elseif “!entry” = “alternate” then
# in the ‘alternate’ script entry point
setvar eof FINFO(HPSTDIN,”eof”)
while setvar(eof,eof-1) > 0 do
setvar record_var input()
showvar record_var ... etc..
endwhile
return
endif

Method 3: Using PRINT to get an individual record.
PROS: I’ve seen this approach used many times, so it must be intuitive.
CONS: Inefficient, but okay for small files.
Basic idea:
- create a file via IO redirection.
- use the PRINT;start=;end= to create another file with one record.
- use the INPUT command to read from the one record file via IO redirection.

Example:
PARM p1, p2, ...
#comments...
errclear
continue
listf !p1,2 >myfile
if hpcierr = 0 then
setvar eof FINFO(“myfile”,”eof”)
setvar i 0
while setvar(i,i+1) <= eof do
print myfile;start=!i;end=!i >myfile2
input record_var <myfile2
showvar record_var ... etc...
endwhile
endif
deletevar record_var,eof,i

How do things get from here to there?

Several months ago, James Hofmeister of the Hewlett-Packard Expert Center provided a comprehensive answer to a collection of questions about networking — in particular, search orders for IP and HP addressing. I did not have space to include it when originally posted, but since the questions came up again this month, I thought it would tie in nicely with the previous section; i.e., cut this out and keep it handy.

HP’s James Hofmeister provided a thorough Q&A:

Q1: What is the search priority when using RESLVCNF and HOST files and NMMGR configurations?

A1: It depends on what services you are using. NS-SERVICES VT/DSCOPY/NFT/etc. or ARPA-SERVICES FTP/TELNET/ETC.?

Q2: What I have read is that when DNS servers are defined in the RESLVCNF file the HOSTS file is not accessed. True or not?

A2: False, sort of. When a RESLFCNF file points to a valid DNS server and the DNS server responds, the 3000 will NOT look at the HOSTS file. This is true if the response from the DNS server is positive or if the response is negative (node name lookup reports unknown host), if any reply comes back from the DNS, the 3000 will NOT look at the HOSTS file. The 3000 will look at the HOSTS in only two cases

1. The DNS server has crashed (or is unreachable) and does not reply at all.

2. The RESLVCNF.NET.SYS file does not exist.

Warning! Do not configure bogus (99.99.99.99) entries in the RESLVCNF.NET.SYS, this will significantly degrade your name lookup search times. Are your users complaining it takes a long time to get connected to a system? Check to see if your DNS is responding.

Q3: What if I wanted to use a combination of the RESLVCNF and HOSTS files — can we set up the system to look first at the HOSTS file then the RESLVCNV file for domain names similar to a Unix environment?

A3: No. The HP 3000 does not support what is known in the Unix environment as NSSWITCH (fallback) capabilities. See Enhancement Request SR 5003443176. The operation on the 3000 is similar to HP-UX version 9.x as described in answer #2 above.

Q4: We want to rid the hard-coded addresses assigned in NMMGR and utilize the DNS servers as well as, if possible, use the HOSTS file to override the DNS entries when testing is required.

A4: Many sites have eliminated NMMGR NSDIR entries and rely on the DNS server pointed to on the HP3000 by RESLVCNF.NET.SYS and only fall back to HOSTS.NET.SYS when the DNS server is down. We do not have a fall back mode for HOSTS.NET.SYS as I have described in Answers #2 and #3 above.

Q5: Can we have whatever name is found and resolved on the DNS server put in cache memory on the HP 3000?

A5: No, this is not done on the 3000. As a mater of fact, the last time I investigated caching of the result of a DNS lookup, a cache was also not present/implemented on HP-UX. See Enhancement Request SR 4701259549.

Q6: Is the (default) search path is as follows: cache, probe, proxy, nsdir, reslvcnf (DNS), hosts.net, or falls off as unresolvable?

A6: Same as answer #1: No, It depends on what services you are using. NS-SERVICES such as VT/DSCOPY/NFT/etc. or ARPA-SERVICES such as FTP/TELNET/ETC.?

Q7: I had also thought that upon using a reslvcnf file, that hosts.net is not searched when a search on the DNS server has failed to produce a result.

A7: HOSTS.NET.SYS file will be used if the DNS server is DOWN (or not network accessible) and it produces NO reply. Any reply from a DNS server will result in the HOSTS.NET.SYS file not being looked at. Same as answers #2 and #3 above.

Q8: I’ve heard that on UNIX machines, you can define the path to search in a local hosts file first, before searching DNS. Is this true?

A8: I understand it, HP-UX has NSSWITCH (fall back) which gives them additional flexibility in using the HOSTS file as a backup, but I am not totally aware of the specifics and all the functionality, so I will leave this answer open for input from others.

Q9: Can you change the priority in NMMGR with cache, probe, and proxy?

A9: Yes, the priority can be changed as well as disabling cache, probe and proxy.

To wrap it all up:

NS-SERVICES Name Lookup:

• Cache - configured/enabled in NMMGR, learned as a result of a probe lookup or loaded as a static name from NSDIR.

• Probe - configured/enabled in NMMGR, probe packet is sent on the network and the host that matches the request replies. The result is cached.

• Proxy - configured/enabled in NMMGR, probe proxy packet is sent on the network and a host configured for probe proxy reply replies. The result is cached.

ARPA-SERVICES Name Lookup:

• RESLVCNF - Configured in RESLVCNF.NET.SYS, which points (by IP address) to a DNS server. A DNS request is sent out to the DNS server and it replies. The result is not cached.

• HOSTS - Configured in HOSTS.NET.SYS, which is only accessed if 1.) a DNS request is not replied to by a DNS server or 2.) a RESLVCNF files does not exist. The result is not cached.

And now the million-dollar question everyone is asking:

Q1: What is the search priority when using RESLVCNF and HOST files and NMMGR configurations?

A1: It depends on what services you are using. NS-SERVICES such as VT/DSCOPY/NFT/etc. or ARPA-SERVICES such as FTP/TELNET/etc.?

The NS-SERVICES VT/DSCOPY/NFT/etc., as you might guess, use NS-SERVICES Name Lookup first and then failing that use ARPA-SERVICES Name Lookup. One note: if you pass a four-part or greater node name “james.atl.hp.com” at “NS-SERVICES Name Lookup,” it automatically bails out and jumps to the ARPA-SERVICES Name Lookup.

ARPA-SERVICES FTP/TELNET/etc., as you might guess, use “ARPA-SERVICES Name Lookup” first and then failing that then use “NS-SERVICES Name Lookup.”

If you are ever working with our friends at the HP Response Center and you tell them what is not working, they may start asking you what is working or they may be testing other services or tools. You now know they are trying to identify if the ARPA-SERVICES Name Lookup works or if the NS-SERVICES Name Lookup works, or if none of the above are working. Just another of the tools used to isolate a failure in establishing a connection.

 


Copyright The 3000 NewsWire. All rights reserved.