home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr2.zip
/
REFSELCT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
4KB
|
134 lines
* Program REFSELCT - Allows operator to select a subject for program to search
* Program assumes the user has entered each keyword only once for one article
*Store d+':REFERNCE' TO MFILE
Use &MFILE index &MFILE
Select secondary
*Store d+':REFINDEX' to MFILE1
*Store d+':REFINDKW' to MFILE1NDX
USE &MFILE1 index &MFILE1NDX
Erase
@ 1,20 say INH
?
Store 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' to months
Accept 'Do you want the text displayed with the reference? ' to TEXT:TOO
Store T to moresrch
Do while moresrch
Store T to SRCHCONT
Accept 'Enter a search subject ' to insearch
Store len(insearch) to islen
If !(insearch)='Q' .and. islen=1
Store F to moresrch
Store F to srchcont
else
If len(insearch)=1
Store F to srchcont
? 'Search subject must have at least 2 characters.'
else
Store ' ' to SOURCES
Store ' ' to XAND
Store ' ' to XXAND
If $(insearch,islen,1) = '&'
Store $(insearch,1,islen-1) to insearch
Accept 'Enter second search subject ' to XAND
If !(XAND) = 'Q'
Store F to SRCHCONT
else
if len(xand)>1
Store len(XAND) to IXLEN
If $(XAND,IXLEN,1)='&'
? 'Only one secondary search subject is allowed. "&" is ignored.'
Store $(XAND,1,ixlen-1) to XAND
endif
endif
Store ' & '+XAND to XXAND
endif
endif
Find &INSEARCH
If # = 0
? 'No match for search subject. '
Store F to SRCHCONT
endif
endif
If SRCHCONT
Store ' ' to inblnk
@ 6,18 say 'Subject is "'+insearch+XXAND+'"'+' '+curdate
?
?
Do while keywordndx=insearch
Store sourcecode to scin
Select primary
Find &scin
If #=0
? 'Error in data files. No match in',MFILE,'for index found in',MFILE1,'.'
? 'SOURCECODE =',scin
?
Store F to SRCHCONT
else
Store F to MATCHED
* Omit this source if it has been found already from a different keyword.'
Store '|'+SCIN to SOURCEX
If @(sourcex,sources)=0
Store trim(sources)+sourcex to sources
If XAND<>' '
Store 1 to incntr
Store '1' to C
Store F to MATCHED
Do while incntr<8 .and. keyw&C<>' '
If kEYW&C=XAND
Store T to MATCHED
Store 7 to incntr
endif
Store incntr+1 to incntr
Store STR(incntr,1) to C
enddo
else
Store T to matched
endif
If MATCHED
? keywordndx,' ',scin
? ' ',$(P.title,1,55),P.author
endif
If XAND=' ' .or. MATCHED
If !(TEXT:TOO)='Y'
Store ' ' to TEXT0
Store 1 to TXTN
Store '1' to TX
Do while text&TX <> ' ' .and. tx<>'0'
? ' ',TEXT&TX
Store txtn+1 to txtn
If txtn=5
Store '0' to TX
else
Store str(txtn,1) to TX
endif
enddo
?
endif
endif
endif
endif
Select secondary
SKIP
enddo
?
Accept 'Another? ' to XX
If !(XX)<>'Y' .and. XX<>' '
Store F to moresrch
endif
ERASE
endif
enddo
use
select primary
Use
Release nmonth,st,lsep,mfile1,mfile1ndx,months,text:too,moresrch,srchcont,xand
Release xxand,insearch,sources,islen,inblnk,scin,matched,sourcex,text0,txtn,tx
Release C,incntr
RETURN
3-9386 478 Cinnamon Ridge Dr. Apple Valley, MN 55124 03/29/50- Y 12 C-3 WS,TE,DS,BO, X 1283 Bruns Dennis BRUD0021M871-6176 4561 Lyndale Ave S. Mpls, MN 55473 07/13/47 3N 6721-3545 C28 to XXAND
If $(insearch,islen,1) = '&'
Store $(insearch,1,islen-1) to insearch
Accept 'Enter second search subject ' to XA