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

  1. * Program REFREPTS - makes reports of selected categories of the CROSSREF files
  2. Store T to level2
  3. Do while LEVEL2
  4.   Erase
  5.   @ 2,1 say 'DATA DISK = '+D
  6.   @ 2,60 say curdate
  7.   @ 3,20 say '     CROSSREF Reports'
  8.   @ 5,9 say '1) Display all/selected Articles in SOURCECODE order'
  9.   @ 6,9 say '2) Display all/selected Articles by LOCATION'
  10.   @ 7,9 say '3) Print Articles LOCATION report'
  11.   @ 8,9 say '4) Display all/selected Articles by TITLE'
  12.   @ 9,9 say '5) Print Articles TITLE report'
  13.   @ 10,9 say '6) Display all/selected Articles by AUTHOR'
  14.   @ 11,9 say '7) Print Articles AUTHOR report'
  15.   ?
  16.   Accept '         Enter selection ' to MSEL
  17.   ?
  18.   Do while @(MSEL,'1234567Qq')=0
  19.     Accept '         Invalid selection. Please enter again ' to MSEL
  20.   enddo
  21.   If !(MSEL)='Q'
  22.     Store F to LEVEL2
  23.     USE
  24.   else
  25. Store 0 to IKEY
  26. Store 0 to IABS
  27. Accept 'Enter selection criteria (<RETURN> = all) ' to scriteria
  28. ?
  29. Accept 'Include keywords? ' to XX
  30. If !(XX)='Y'
  31.   Store IKEY+5 to IKEY
  32. endif
  33. Accept 'Include Abstracts? ' to XX
  34. If !(XX)='Y'
  35.   Store IABS+5 to IABS
  36. endif
  37. Store IKEY+IABS to ISKIP
  38. STORE ' ' TO XX
  39. Use &MFILE
  40. Do case
  41. CASE MSEL='2'.or.MSEL='3'
  42.   Store D+':REFLOCAT' to MFILEX
  43.   Store 'LOCATION' to XX
  44. CASE MSEL='4'.or.msel='5'
  45.   Store D+':REFTITLE' to MFILEX
  46.   Store 'TITLE' to XX
  47. CASE MSEL='6'.or.MSEL='7'
  48.   Store D+':REFAUTHR' to MFILEX
  49.   Store 'AUTHOR' to XX
  50. otherwise
  51.   Store MFILE to MFILEX
  52.   Store 'SOURCECODE' to XX
  53. endcase
  54. ? 'Index file to',XX,'field of',MFILE,'is',MFILEX,'.'
  55. If MSEL<>'1'
  56. Accept 'Is this index file current with the latest data file changes?' to X
  57.  If !(X)<>'Y'
  58.   ? 'Now indexing file ',MFILE,' by ',XX,' field.'
  59.   Use &MFILE
  60.   Set talk on
  61.   Index on &XX to &MFILEX
  62.   Set talk off
  63.   ? 'Indexing is complete.'
  64.   ?
  65.  endif
  66. endif
  67. Use &MFILE index &MFILEX
  68. Store T to beginng
  69. Store T to LEVEL1
  70. If @(msel,'1246')<>0
  71.   ? '        ',INH,' Report -  by',XX,'    ',curdate
  72.   ?
  73.   If scriteria=' '
  74.     Store 'LEVEL1' to scriteria
  75.   else
  76.     ? '                    Selection:  ',scriteria
  77.   endif
  78.   ?
  79.   ?
  80.   Do while .not.EOF
  81.     If .not. beginng
  82.       ? $(TITLE,1,54),'LOCATION:',LOCATION
  83.       ? '   by: ',AUTHOR,'                          SOURCE:',sourcecode
  84.       If IKEY<>0
  85.         ? '  KEYWORDS -    ',keyw1,'    ',keyw5
  86.         ? '                ',keyw2,'    ',keyw6
  87.         ? '                ',keyw3,'    ',keyw7
  88.         ? '                ',keyw4,'    ',keyw8
  89.       endif
  90.       If IABS<>0
  91.         ? '  ABSTRACT -  ',text1
  92.         ? '              ',text2
  93.         ? '              ',text3
  94.         ? '              ',text4
  95.       endif
  96.       ?
  97.       SKIP
  98.     endif
  99.     Store F to beginng
  100.     Do while .not. EOF.and..not.(&SCRITERIA)
  101.       SKIP
  102.     enddo
  103.   enddo
  104. else
  105.   Store T to beginng
  106.   Set format to print
  107. @ 1,9 say INH+' Report  -   by '+XX+'      '+curdate
  108. Store 4 to curline
  109. Store 1 to PN
  110. If scriteria=' '
  111.   Store 'LEVEL1' to scriteria
  112. else
  113.   @ 3,28 say 'Selection: '+scriteria
  114.   Store 6 to curline
  115. endif
  116. Do while .not. EOF
  117.   If .not. beginng
  118.     If curline > 62-ISKIP
  119.       Eject
  120.       Store PN+1 to PN
  121.       @ 1,9 say INH+' Report  -  by '+XX+'      '+curdate
  122.       @ 1,72 say 'Page'+str(PN,4)
  123.       Store 4 to curline
  124.     endif
  125.     @ curline,0 say $(title,1,54)+' LOCATION: '+location
  126.     @ curline+1,3 say 'by: '+author
  127.     @ curline+1,55 say 'SOURCE: '+$(sourcecode,1,6)+' '+$(sourcecode,7,2)+;
  128.     ' '+$(sourcecode,9,7)
  129.     If IKEY<>0
  130.       @ curline+2,3 say 'KEYWORDS -   '+keyw1+'    '+keyw5
  131.       @ curline+3,16 say                keyw2+'    '+keyw6
  132.       @ curline+4,16 say                keyw3+'    '+keyw7
  133.       @ curline+5,16 say                keyw4+'    '+keyw8
  134.       Store curline+4 to curline
  135.     endif
  136.     If IABS<>0
  137.       @ curline+2,3 say 'ABSTRACT - '+text1
  138.       @ curline+3,14 say text2
  139.       @ curline+4,14 say text3
  140.       @ curline+5,14 say text4
  141.       Store curline+4 to curline
  142.     endif
  143.     SKIP
  144.     Store curline+3 to curline
  145.   endif
  146.   Store F to beginng
  147.   Do while .not. EOF .and. .not. (&SCRITERIA)
  148.     SKIP
  149.   enddo
  150.   enddo
  151.   EJECT
  152.   Set format to screen
  153. endif
  154. ?
  155. Accept 'End of report. Press <retn> ' to xx
  156.   endif
  157. ENDDO
  158. Release XX,MFILEX,IKEY,IABS,ISKIP,X,beginng,SCRITERIA
  159. RETURN
  160.  
  161. URN
  162.  
  163. eginng,SCRITERIA,LEVEL1
  164. RETURN
  165.  
  166. do
  167.   If !(MSEL)='Q'
  168.     Store F to LEVEL2
  169.     USE
  170.   else     
  171. Store 0 to IKEY
  172. Store 0 to IABS
  173. Accept 'Enter selection criteria (<RETURN> = all) ' to scriteria
  174. ?
  175. Accept 'Include keywords? ' to XX
  176. If !(XX)='Y'
  177.   Store IKEY+5 to IKEY
  178. endif
  179. Accept