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

  1. * Program REFERNTR - Allows operator entry of new Article References
  2. Set talk off
  3. USE
  4. SELECT PRIMARY
  5. Store F to INDEXUPD
  6. *Store d+':REFERNCE' to MFILE
  7. Use &MFILE index &MFILE
  8. Select secondary
  9. *Store d+':REFINDEX' to MFILE1
  10. *Store d+':REFINDKW' to MFILE3
  11. Use &MFILE1 index &MFILE1
  12. Store 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' TO MONTHS
  13. Store 'Y' to continu
  14. Do while !(continu)='Y'
  15. Select secondary
  16. Store '                                                            ' to INTITLE
  17. Store INTITLE TO INTEXT1
  18. STORE INTEXT1 TO INTEXT2
  19. STORE INTEXT1 TO INTEXT3
  20. STORE INTEXT1 TO INTEXT4
  21. STORE '             ' TO SOURCECODE
  22. STORE '     ' TO DATE
  23. STORE '  ' TO PUBCODE
  24. STORE 'p   ' TO PAGEID
  25. STORE '         ' TO INDATE
  26. STORE '                    ' TO INAUTHOR
  27. Store '            ' to inlocatn
  28. SET COLON OFF
  29. Store T to NOGOOD
  30. Do while NOGOOD
  31.   Erase
  32.   @ 1,17 say INH
  33.   @ 4,10 say 'TITLE  :' GET INTITLE
  34.   @ 4,78 SAY ':'
  35.   @ 5,10 say 'AUTHOR :' get inauthor
  36.   @ 5,38 say ':   LOCATION :' get inlocatn
  37.   @ 5,64 say ':'
  38.   @ 6,10 say 'SOURCE -  pu mmm dd yy  page'
  39.   @ 7,19 say ':' get PUBCODE
  40.   @ 7,22 say '-' get indate
  41.   @ 7,34 get PAGEID
  42.   @ 7,38 say ":    pu=publication,  mmm=month (3 char's)"
  43.   @ 8,43 say      'dd=day,  yy=year,  page=page number '
  44.   READ
  45.   If intitle='Q' .or. intitle='          '
  46.     STORE 'N' TO CONTINU
  47.     STORE F TO NOGOOD
  48.   else
  49.     If $(indate,7,3)='   '
  50.       Store $(indate,1,4)+'   '+$(indate,5,2) to indate
  51.     endif
  52.     STORE !($(INDATE,1,3)) TO INMONTH
  53.     STORE 1 TO X1
  54.     DO WHILE $(MONTHS,X1,3)<>INMONTH .AND. X1<36
  55.       STORE X1+3 TO X1
  56.     ENDDO
  57.     Store (X1+2)/3 to X1
  58.   IF X1=13
  59.     ACCEPT 'INVALID MONTH NAME. PLEASE ENTER AGAIN (Press <retn>) ' to xx
  60.   else
  61.     Store '~'+pubcode to pubcodex
  62.     Find &pubcodex
  63.     Store pubcode+'-'+$(indate,1,3)+$(indate,5,2)+$(indate,8,2)+' '+;
  64.      pageid to insource
  65.     If # = 0
  66. Accept 'Reference/Publication code not found. Enter it as new? ' to XX
  67.       If !(XX)='Y'
  68.         Accept ' Enter the Reference / Publication Name ' to keywndx
  69.         ? 'Now saving Ref./Pub. = ',pubcode,': ',keywndx
  70.         Append blank
  71.         Replace sourcecode with '~'+pubcode
  72.         Replace keywordndx with '~'+keywndx
  73.         Store F to NOGOOD
  74.       endif
  75.       If !(XX)='Q'
  76.         Store f to NOGOOD
  77.         Store 'N' to continu
  78.       endif
  79.     else
  80.       Store F to NOGOOD
  81.     endif
  82.   endif
  83.   ENDIF
  84. enddo
  85. If !(continu)='Y'
  86. Clear gets
  87. Store '                    ' to keyword1
  88. Store keyword1 to keyword2
  89. Store keyword1 to keyword3
  90. Store keyword1 to keyword4
  91. Store keyword1 to keyword5
  92. Store keyword1 to keyword6
  93. Store keyword1 to keyword7
  94. Store keyword1 to keyword8
  95. Store '  ' to keyword9
  96. Set colon on
  97. @ 9,0 say ' ABSTRACT   ' get intext1
  98. @ 10,12 get intext2
  99. @ 11,12 get intext3
  100. @ 12,12 get intext4
  101. @ 14,1 say 'KEYWORDS   ' GET KEYWORD1
  102. @ 14,34 SAY '      '
  103. @ 15,12 GET KEYWORD2
  104. @ 15,34 SAY '      '
  105. @ 16,12 GET KEYWORD3
  106. @ 16,34 SAY '      '
  107. @ 17,12 GET KEYWORD4
  108. @ 17,34 SAY '      '
  109. @ 14,40 GET KEYWORD5
  110. @ 15,40 GET KEYWORD6
  111. @ 16,40 GET KEYWORD7
  112. @ 17,40 GET KEYWORD8
  113. READ
  114. ACCEPT 'Press <RETURN> to record this new entry, or enter "Q" to bypass ' to XX
  115. If !(XX)<>'Q'
  116. Select primary
  117. Store T to nogood
  118. Do while nogood
  119.   Store F to nogood
  120.   Find &insource
  121.   If #<>0
  122.     ? 'Duplicate source code found -',insource
  123.     Accept 'Do you want to change it? ' to XX
  124.     ?
  125.     If !(XX)='Y'
  126.       @ 23,10 say 'SOURCE CODE ' GET insource
  127.       READ
  128.       Store T to nogood
  129.     else
  130.       If !(XX)='Q' .or.!(XX)=' '
  131.         Store F to nogood
  132.       else
  133.         Store T to nogood
  134.       endif
  135.     endif
  136.   endif
  137. enddo
  138. If !(XX)<>'Q'
  139. Append blank
  140. Replace date:in with $(date(),7,2)+'/'+$(date(),1,3)+$(date(),4,2)
  141. Replace title with intitle
  142. Replace author with inauthor
  143. Replace text1 with intext1
  144. Replace text2 with intext2
  145. Replace text3 with intext3
  146. Replace text4 with intext4
  147. Replace keyw1 with keyword1
  148. Replace keyw2 with keyword2
  149. Replace keyw3 with keyword3
  150. Replace keyw4 with keyword4
  151. Replace keyw5 with keyword5
  152. Replace keyw6 with keyword6
  153. Replace keyw7 with keyword7
  154. Replace keyw8 with keyword8
  155. Replace sourcecode with insource
  156. Store '1' to XX
  157. Store 1 to X1
  158. Select secondary
  159. Store T to INDEXUPD
  160. Do while keyword&XX<>'  '
  161.   Append blank
  162.   Replace sourcecode with insource
  163.   Replace keywordndx with keyword&XX
  164.   Store X1+1 to  X1
  165.   Store str(X1,1) to XX
  166. enddo
  167. endif
  168. endif
  169. Accept 'Another? ' to continu
  170. endif
  171. ENDDO
  172. If INDEXUPD
  173.   ? 'Now re-indexing file',MFILE1,'by key word.'
  174.   Select secondary
  175.   USE &MFILE1 index &MFILE3
  176.   REINDEX
  177. endif
  178. USE
  179. Release keyword1,keyword2,keyword3,keyword4,keyword5,keyword6,keyword7,keyword8
  180. Release keyword9,continu,intext1,intext2,intext3,intext4,intext,pubcodex,nogood
  181. Release notbegin,intitle,continu,ina,inn,months,insource,keywndx,st,sourcecode
  182. Release keyw1,keyw2,keyw3,keyw4,keyw5,keyw6,keyw7,keyw8,text1,text2,text3,text4
  183. Release MFILE1,MFILE3,date,pubcode,pageid,indate,X1,inmonth,inauthor,sourcecode
  184. Release pageid,indxupd
  185. RETURN
  186. YSteinbrenner   Perry         ZStillman       Amy           [Swenson        Charlie       \Thomas         Marty         ]Thompson       Carl          ^Thompson       David         _Thompson       Sally         `Thompson       Sarah         aWalker         Benjamin      bWalter         Barb          cWarner         Frank         dWarner         Marlene       eWarner         Nancy         fWilliams       Robert        gWilson         Bob           `Thompson    TYSteinbrenner   Perry         ZStillman       Amy           [Swenson        Charlie       \Thomas         Marty         ]Thompson       Carl          ^Thompson       David         _Thompson       Sally         `Thompson       Sarah         aWalker         Benjamin      bWalter         Barb          cWarner         Frank         dWarner         Marlene       eWarner         Nancy         fWilliams       Robert        gWilson         Bob           `Thompson    Tecondary
  187.   USE