home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr2.zip / OLDCREF.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  2KB  |  75 lines

  1. *OLDCREF - Converts the old-format REFERNCE file to the new
  2. Set talk off
  3. Clear
  4. Set intensity off
  5. ?
  6. ? 'This program converts the old-format CROSSREF files to the new format -'
  7. ?? 'CROSSREF, version 1.3.'
  8. ?? 'It reads a file called REFER.DBF on the B disk drive, and copies'
  9. ?? 'its data into a new file called REFERNCE.DBF - the right file for the'
  10. ?? 'CROSSREF'
  11. ? 'program. You must have already renamed the old REFERNCE.DBF file to be'
  12. ?? 'called'
  13. ? 'REFER.DBF.  The new REFERNCE.DBF file will have the sourcecode format'
  14. ?? 'changed,'
  15. ? 'and will have the new LOCATION field added.  Also, the REFIND.DBF file,'
  16. ? 'your old REFINDEX.DBF file, will be converted to file REFINDEX.DBF.  The'
  17. ? 'indexes of both the files are then to be created by the "RE-INDEX" function'
  18. ? 'of SET UP.'
  19. ?
  20. Accept 'Enter the Data Disk letter ' to D
  21. Store d+':REFER' to MFILE
  22. Store d+':REFERNCE' to NFILE
  23. Store d+':REFIND' to M1FILE
  24. Select secondary
  25. Use
  26. Select primary
  27. Use REFERNCX
  28. If file(MFILE).and. file(M1FILE)
  29. ACCEPT ;
  30. 'Now about to copy over any file named REFERNCE.DBF on the data disk. OK?' TO X
  31. IF !(X)<>'Y'
  32.   RETURN
  33. endif
  34. Copy to &NFILE
  35. Use &NFILE
  36. ? 'Now reading old records into the new file.'
  37. Set talk on
  38. Append from &MFILE
  39. Set talk off
  40. Use &NFILE
  41. Do while .not. EOF
  42.   Replace sourcecode with $(sourcecode,1,2)+'-'+$(sourcecode,8,7)+' '+;
  43. $(sourcecode,3,5)
  44.   SKIP
  45. enddo
  46. Use
  47. Accept ;
  48. 'Now about to copy over any file named REFINDEX.DBF on the data disk. OK?' to x
  49. If !(X)<>'Y'
  50.   RETURN
  51. endif
  52. Use REFINDXX
  53. Store d+':REFINDEX' to NFILE
  54. Copy to &NFILE
  55. Use &NFILE
  56. ? 'Now appending old index records into the new.'
  57. Set talk on
  58. Append from &M1FILE
  59. Set talk off
  60. Use &NFILE
  61. Do while .not. EOF
  62.   Replace sourcecode with $(sourcecode,1,2)+'-'+$(sourcecode,8,7)+' '+;
  63. $(sourcecode,3,5)
  64.   SKIP
  65. enddo
  66. ? 'Files are now updated. Do not forget to re-index them from CROSSREF- SET UP'
  67. ?
  68.  
  69.  d+':REFIND' to M1FILE
  70. Select secondary
  71. Use
  72. Select primary
  73. Use REFERNCX
  74. If file(MFILE).and. file(M1FILE)
  75. ACCEPT