home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19699 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.5 KB

  1. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!gatech!swrinde!elroy.jpl.nasa.gov!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: How to merge two sysuaf.dat files??
  5. Date: 22 Dec 1992 05:53:38 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 37
  8. Distribution: world
  9. Message-ID: <1h6ah2INN9ks@gap.caltech.edu>
  10. References: <01GSKVJUMIOI9I4IMI@HCACAD.HOLYCROSS.EDU>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <01GSKVJUMIOI9I4IMI@HCACAD.HOLYCROSS.EDU>, JBP@HCACAD.HOLYCROSS.EDU (Father Pomeroy) writes:
  15. >
  16. > As usual, I believe I saw this but did not keep it.
  17. > We have two SYSUAF.DAT files (which we shouldn't, I know), which I now wish
  18. >to merge into one. the problem is that some of the same entries exist in
  19. >both, but with variations. VMS SORT will eliminate dups but there is no
  20. >way to determine which of the two to keep ( we will always wish to keep the
  21. >entry from the shorter file). 
  22. > The only thing I can think of is to write a program which will read the
  23. >shorter file and WRITE into the longer file, checking first for  the existence
  24. >of the same key, in which case re-write from the new record. I feel very
  25. >insecure about this, since it IS the UAF with which I am playing (I would,
  26. >of course, do it in a work area first, but still??).
  27. > Suggestions appreciated.
  28.  
  29. You've got the right idea.  If the two SYSUAFs are from the same version of
  30. VMS, your idea will work with no problems.  DEC has changed the format of
  31. SYSUAF a few times, and if the SYSUAFs are from versions between which DEC made
  32. changes, it won't work.  Assuming you're not in that unenviable position:
  33.     $    OPEN/READ INPFILE short_sysuaf
  34.     $    OPEN/READ/WRITE OUTFILE long_syauaf
  35.     $    SET NOON
  36.     $ LOOP:    READ/END=DONE INPFILE REC
  37.     $    WRITE/SYMBOL OUTFILE REC
  38.     $    GOTO LOOP
  39.     $ DONE:    CLOSE INPFILE
  40.     $    CLOSE OUTFILE
  41. will do what you want.  You will, of course, want to check the log file to see
  42. which records conflicted.
  43. --------------------------------------------------------------------------------
  44. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  45.  
  46. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  47. understanding of astronomy is purely at the amateur level (or below).  So
  48. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  49. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  50. hold me responsible for it, but my organization had nothing to do with it.
  51.