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

  1. * Program CROSSREF - Controls all CROSSREF program operations
  2. Clear
  3. Set talk off
  4. Set bell off
  5. Set intensity off
  6.   Store 'January  February March    April    May      June     ' to XX
  7.   Store XX+'July     August   SeptemberOctober  November December ' to MONTHS
  8.   If $(DATE(),7,2) = '00'
  9.     Set date to 01,01,00
  10.   ENDIF
  11.   Store ' ' to curmonthx
  12.   Store ' ' to curyear
  13.   Store ' ' to curmonth
  14.   * Set today's date from current system-date
  15.   Store $(date(),1,2) to curmo
  16.   Store $(date(),7,2) to curmonthx
  17.   Store val(curmo) to nmonth
  18.   Store curmo+curmonthx to indate
  19.   If $(date(),4,1) = '0'
  20.     Store $(DATE(),5,1) to CURMONTHX
  21.   else
  22.     Store $(DATE(),4,2) to CURMONTHX
  23.   endif
  24.   Store trim($(months,NMONTH*9-8,9)) to curmonth
  25.   Store curmonth+' '+curmonthx to curmonthx
  26.   Store ', 19'+$(DATE(),7,2) to CURYEAR
  27.   Store curmonthx+curyear to curdate
  28.   release curmo,months,curyear,curmonthx,nmonth
  29. Select secondary
  30. Use UDIRFILE
  31. GOTO 2
  32. Store !($(spact,21,1)) to D
  33. Store D+':REFERNCE' to MFILE
  34. Store T to LEVEL1
  35. Do while LEVEL1
  36.   Use
  37.   Select primary
  38.   Use
  39.   Erase
  40.   @ 1,1 say 'DATA DISK = '+D
  41.   @ 1,60 say curdate
  42.   @ 2,20 SAY '    C R O S S R E F                        1-/CROSSREF/'
  43.   @ 5,13 say ' Makes and Recalls Reference Article Summaries '
  44.   @ 7,9 say  ' 1)  Enter new Reference Articles                     /REFERNTR/'
  45.   @ 8,9 say  ' 2)  Recall Articles by a selected SUBJECT            /REFSELCT/'
  46.   @ 9,9 SAY  ' 3)  Article REPORTS                                  /REFREPTS/'
  47.   @ 10,9 say ' 4)  Display the CROSSREF Subject INDEX               /REFDXLST/'
  48.   @ 11,9 say ' 5)  Display the Reference Codes-Names        '
  49.   @ 12,9 say ' 6)  Update the Reference Codes-Names                 /REFCODES/'
  50.   @ 13,9 say ' 7)  Change/Delete an existing Reference Name         /REFCHNGE/'
  51.   @ 14,9 say ' 8)  SET UP'                                  '
  52.   ?
  53.   Accept '         Enter selection ' to MSEL
  54.   ?
  55.   If !(MSEL)='DISK='
  56.     If len(msel)>5
  57.       Store $(MSEL,6,1) to D
  58.       ? 'Disk now being set to drive',D
  59.       Store D+':REFERNCE' to MFILE
  60.     endif
  61.     Store 'D' to MSEL
  62.   endif
  63.   Do while @(msel,'12345678QqD')=0
  64.    Accept 'Invalid entry. Please enter again ' to MSEL
  65.   enddo
  66.   If MSEL<>'8'.and.!(MSEL)<>'Q'
  67.     If file(MFILE)
  68.       Use &MFILE index &MFILE
  69.     else
  70.  ? 'File',mfile,'does not exist on the data disk. Perform SET UP to create it.'
  71.  ?
  72.     endif
  73.   endif
  74.   Do CASE
  75.     CASE MSEL = '1'
  76.       Store 'CROSSREF - New Reference Article Entry' to INH
  77.       Store D+':REFERNCE' to MFILE
  78.       Store D+':REFINDEX' to MFILE1
  79.       Store D+':REFINDKW' to MFILE3
  80.       Do REFERNTR.CMD
  81.       Store T to validd1
  82.     CASE MSEL = '2'
  83.       Store 'CROSSREF Article Subject Search' to INH
  84.       Store D+':REFERNCE' to MFILE
  85.       Store D+':REFINDEX' to MFILE1
  86.       Store D+':REFINDKW' to MFILE1NDX
  87.       Do REFSELCT.CMD
  88.     CASE MSEL = '3'
  89.       Store 'CROSSREF Article' to INH
  90.       Store D+':REFERNCE' to MFILE
  91.       Do REFREPTS.CMD
  92.     CASE MSEL = '4'
  93.       Store 'CROSSREF - Article Reference/Publication INDEX list  ' to INH
  94.       Store D+':REFINDEX' to MFILE
  95.       STore D+':REFINDKW' to MFILENDX
  96.       Do REFDXLST.CMD
  97.     CASE MSEL = '5'
  98. Select primary
  99. Use
  100. Select secondary
  101. Store d+':REFINDEX' to MFILE
  102. Store '~~~' to inx
  103. Use &MFILE index &MFILE
  104. Store '~' to XX
  105. Store # to LTOP
  106.     GOTO bottom
  107.     Do while * .and. sourcecode<>inx .and. sourcecode=XX
  108.       SKIP -1
  109.     enddo
  110.     If sourcecode<>XX
  111.       ? 'No Reference/Publication codes present in the code file.'
  112.     else
  113.         ? 'Reference/Publication code list   ',curdate
  114.         ?
  115.       If #=LTOP
  116.         ? $(sourcecode,2,2),' :  ',$(keywordndx,2,19)
  117.       else
  118.       Do while sourcecode=XX.and.#<>LTOP
  119.         ? $(sourcecode,2,2),' :  ',$(keywordndx,2,19)
  120.         SKIP -1
  121.         Do while * .and. sourcecode<>inx .and. sourcecode=XX
  122.           SKIP -1
  123.         enddo
  124.       enddo
  125.       endif
  126.     endif
  127. USE
  128. ?
  129. ?
  130. Accept 'End of Reference/Publications codes. Press <retn> ' to XX
  131. Select primary
  132. Release ST,inx,xx
  133.     CASE MSEL = '6'
  134.       Store 'CROSSREF Article Reference/Publication code entry routine.' to INH
  135.       Store D+':REFINDEX' to MFILE
  136.       Store D+':REFINDKW' to MFILENDX
  137.       Do REFCODES.CMD
  138.     CASE MSEL = '7'
  139.       Store 'CROSSREF Article Change routine.' to INH
  140.       Store D+':REFINDEX' to MFILENDX
  141.       Store D+':REFINDKW' to MFILENX
  142.       Store D+':REFERNCE' to MFILE
  143.       Do REFCHNGE.CMD
  144.     CASE MSEL = '8'
  145. ?
  146. ? '                   CROSSREF  SET UP'
  147. ?
  148. ? '         1) Build new reference files'
  149. ? '         2) Re-index existing reference files'
  150. ? '         3) Names Directory editing'
  151. ?
  152. Accept '         Enter selection ' to XX
  153. ?
  154. If XX='1'
  155. Accept ;
  156. 'Now about to build new reference files: REFERNCE.DBF and REFINDEX.DBF' to XX
  157. If !(XX)='Y'
  158. ? 'Now building new file REFERNCE.DBF with index REFINDEX.NDX'
  159. Use REFERNCX
  160. Store d+':REFERNCE' to MFILE
  161. Copy to &MFILE
  162. USE &MFILE
  163. Index on sourcecode to &MFILE
  164. ? 'Now building new file REFINDEX.DBF, with'
  165. ? 'indexes = REFINDEX.NDX and REFINDKW.NDX'
  166. Use refindxx
  167. Store d+':REFINDEX' to NFILE
  168. Copy to &NFILE
  169. Use &NFILE
  170. Store d+':REFINDKW' to OFILENDX
  171. Index on keywordndx to &OFILENDX
  172. Index on sourcecode to &NFILE
  173. Use
  174. ? 'New Reference and index files are now created. '
  175. Accept 'Press <retn> to enter Publication/Reference codes' to XX
  176. Store 'CROSSREF Article Reference / Publication code entry routine. ' to INH
  177. Store D+':REFINDEX' to MFILE
  178. Store D+':REFINDKW' to MFILENDX
  179. Do refcodes.CMD
  180. USE
  181. endif
  182. Release nfile,ofilendx
  183. Store '9' to XX
  184. endif
  185. If XX='2'
  186.       Select secondary
  187.       Use
  188.       Select primary
  189.       Store d+':REFERNCE' to MFILE
  190.       Use &MFILE
  191.       ? 'Now re-indexing REFERNCE file by SOURCECODE.'
  192.       Set talk on
  193.       Index on sourcecode to &MFILE
  194.       Set talk off
  195.       Store d+':REFINDEX' to MFILE1
  196.       Use &MFILE1
  197.       ? 'Now re-indexing REFINDEX file by SOURCECODE.'
  198.       Set talk on
  199.       Index on sourcecode to &MFILE1
  200.       Set talk off
  201.       Store d+':REFINDKW' TO MFILE2
  202.       ? 'Now re-indexing REFINDEX file by KEYWORDNDX.'
  203.       Set talk on
  204.       Index on keywordndx to &MFILE2
  205.       Set talk off
  206.       Accept 'Re-building is complete. Press <RETURN>' to XX
  207.       Release MFILE1,MFILE2
  208.       Use
  209. endif
  210. If XX='3'
  211.   @ 17,0
  212.   @ 18,0
  213.   @ 19,0
  214.   @ 20,0
  215.   @ 21,0
  216.   @ 22,0
  217.   @ 16,0
  218.   ? '            Names Directory editing'
  219.   Store D to DD
  220.   @ 19,9 say 'Data disk drive ' get DD
  221.   ?
  222.   READ
  223.   ? 'Now saving the new Data Disk Drive designator.'
  224.   Select secondary
  225.   Use UDIRFILE
  226.   GOTO 2
  227.   Replace spact with $(spact,1,20)+!(DD)
  228.   Store DD to D
  229.   Use
  230.   Select primary
  231. endif
  232.     CASE !(MSEL) = 'Q'
  233.       Select secondary
  234.       USE
  235.       Select primary
  236.       USE
  237.       Store F to LEVEL1
  238.   ENDCASE
  239. ENDDO
  240. ENDDO
  241. Store T to LEVEL1
  242. RETURN
  243.  
  244. ce / Publication code entry routine. ' to INH
  245. Store D+':REFINDEX' to MFILE
  246. Store D+':REFINDKW' to MFILENDX
  247. Do refcodes.CMD
  248. USE
  249. endif
  250. Release nfile,ofilendx
  251. Store '9' to XX
  252. endif
  253. If XX='2'
  254.       Select secondary
  255.       Use