home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr2.zip
/
CROSSREF.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
7KB
|
255 lines
* Program CROSSREF - Controls all CROSSREF program operations
Clear
Set talk off
Set bell off
Set intensity off
Store 'January February March April May June ' to XX
Store XX+'July August SeptemberOctober November December ' to MONTHS
If $(DATE(),7,2) = '00'
Set date to 01,01,00
ENDIF
Store ' ' to curmonthx
Store ' ' to curyear
Store ' ' to curmonth
* Set today's date from current system-date
Store $(date(),1,2) to curmo
Store $(date(),7,2) to curmonthx
Store val(curmo) to nmonth
Store curmo+curmonthx to indate
If $(date(),4,1) = '0'
Store $(DATE(),5,1) to CURMONTHX
else
Store $(DATE(),4,2) to CURMONTHX
endif
Store trim($(months,NMONTH*9-8,9)) to curmonth
Store curmonth+' '+curmonthx to curmonthx
Store ', 19'+$(DATE(),7,2) to CURYEAR
Store curmonthx+curyear to curdate
release curmo,months,curyear,curmonthx,nmonth
Select secondary
Use UDIRFILE
GOTO 2
Store !($(spact,21,1)) to D
Store D+':REFERNCE' to MFILE
Store T to LEVEL1
Do while LEVEL1
Use
Select primary
Use
Erase
@ 1,1 say 'DATA DISK = '+D
@ 1,60 say curdate
@ 2,20 SAY ' C R O S S R E F 1-/CROSSREF/'
@ 5,13 say ' Makes and Recalls Reference Article Summaries '
@ 7,9 say ' 1) Enter new Reference Articles /REFERNTR/'
@ 8,9 say ' 2) Recall Articles by a selected SUBJECT /REFSELCT/'
@ 9,9 SAY ' 3) Article REPORTS /REFREPTS/'
@ 10,9 say ' 4) Display the CROSSREF Subject INDEX /REFDXLST/'
@ 11,9 say ' 5) Display the Reference Codes-Names '
@ 12,9 say ' 6) Update the Reference Codes-Names /REFCODES/'
@ 13,9 say ' 7) Change/Delete an existing Reference Name /REFCHNGE/'
@ 14,9 say ' 8) SET UP' '
?
Accept ' Enter selection ' to MSEL
?
If !(MSEL)='DISK='
If len(msel)>5
Store $(MSEL,6,1) to D
? 'Disk now being set to drive',D
Store D+':REFERNCE' to MFILE
endif
Store 'D' to MSEL
endif
Do while @(msel,'12345678QqD')=0
Accept 'Invalid entry. Please enter again ' to MSEL
enddo
If MSEL<>'8'.and.!(MSEL)<>'Q'
If file(MFILE)
Use &MFILE index &MFILE
else
? 'File',mfile,'does not exist on the data disk. Perform SET UP to create it.'
?
endif
endif
Do CASE
CASE MSEL = '1'
Store 'CROSSREF - New Reference Article Entry' to INH
Store D+':REFERNCE' to MFILE
Store D+':REFINDEX' to MFILE1
Store D+':REFINDKW' to MFILE3
Do REFERNTR.CMD
Store T to validd1
CASE MSEL = '2'
Store 'CROSSREF Article Subject Search' to INH
Store D+':REFERNCE' to MFILE
Store D+':REFINDEX' to MFILE1
Store D+':REFINDKW' to MFILE1NDX
Do REFSELCT.CMD
CASE MSEL = '3'
Store 'CROSSREF Article' to INH
Store D+':REFERNCE' to MFILE
Do REFREPTS.CMD
CASE MSEL = '4'
Store 'CROSSREF - Article Reference/Publication INDEX list ' to INH
Store D+':REFINDEX' to MFILE
STore D+':REFINDKW' to MFILENDX
Do REFDXLST.CMD
CASE MSEL = '5'
Select primary
Use
Select secondary
Store d+':REFINDEX' to MFILE
Store '~~~' to inx
Use &MFILE index &MFILE
Store '~' to XX
Store # to LTOP
GOTO bottom
Do while * .and. sourcecode<>inx .and. sourcecode=XX
SKIP -1
enddo
If sourcecode<>XX
? 'No Reference/Publication codes present in the code file.'
else
? 'Reference/Publication code list ',curdate
?
If #=LTOP
? $(sourcecode,2,2),' : ',$(keywordndx,2,19)
else
Do while sourcecode=XX.and.#<>LTOP
? $(sourcecode,2,2),' : ',$(keywordndx,2,19)
SKIP -1
Do while * .and. sourcecode<>inx .and. sourcecode=XX
SKIP -1
enddo
enddo
endif
endif
USE
?
?
Accept 'End of Reference/Publications codes. Press <retn> ' to XX
Select primary
Release ST,inx,xx
CASE MSEL = '6'
Store 'CROSSREF Article Reference/Publication code entry routine.' to INH
Store D+':REFINDEX' to MFILE
Store D+':REFINDKW' to MFILENDX
Do REFCODES.CMD
CASE MSEL = '7'
Store 'CROSSREF Article Change routine.' to INH
Store D+':REFINDEX' to MFILENDX
Store D+':REFINDKW' to MFILENX
Store D+':REFERNCE' to MFILE
Do REFCHNGE.CMD
CASE MSEL = '8'
?
? ' CROSSREF SET UP'
?
? ' 1) Build new reference files'
? ' 2) Re-index existing reference files'
? ' 3) Names Directory editing'
?
Accept ' Enter selection ' to XX
?
If XX='1'
Accept ;
'Now about to build new reference files: REFERNCE.DBF and REFINDEX.DBF' to XX
If !(XX)='Y'
? 'Now building new file REFERNCE.DBF with index REFINDEX.NDX'
Use REFERNCX
Store d+':REFERNCE' to MFILE
Copy to &MFILE
USE &MFILE
Index on sourcecode to &MFILE
? 'Now building new file REFINDEX.DBF, with'
? 'indexes = REFINDEX.NDX and REFINDKW.NDX'
Use refindxx
Store d+':REFINDEX' to NFILE
Copy to &NFILE
Use &NFILE
Store d+':REFINDKW' to OFILENDX
Index on keywordndx to &OFILENDX
Index on sourcecode to &NFILE
Use
? 'New Reference and index files are now created. '
Accept 'Press <retn> to enter Publication/Reference codes' to XX
Store 'CROSSREF Article Reference / Publication code entry routine. ' to INH
Store D+':REFINDEX' to MFILE
Store D+':REFINDKW' to MFILENDX
Do refcodes.CMD
USE
endif
Release nfile,ofilendx
Store '9' to XX
endif
If XX='2'
Select secondary
Use
Select primary
Store d+':REFERNCE' to MFILE
Use &MFILE
? 'Now re-indexing REFERNCE file by SOURCECODE.'
Set talk on
Index on sourcecode to &MFILE
Set talk off
Store d+':REFINDEX' to MFILE1
Use &MFILE1
? 'Now re-indexing REFINDEX file by SOURCECODE.'
Set talk on
Index on sourcecode to &MFILE1
Set talk off
Store d+':REFINDKW' TO MFILE2
? 'Now re-indexing REFINDEX file by KEYWORDNDX.'
Set talk on
Index on keywordndx to &MFILE2
Set talk off
Accept 'Re-building is complete. Press <RETURN>' to XX
Release MFILE1,MFILE2
Use
endif
If XX='3'
@ 17,0
@ 18,0
@ 19,0
@ 20,0
@ 21,0
@ 22,0
@ 16,0
? ' Names Directory editing'
Store D to DD
@ 19,9 say 'Data disk drive ' get DD
?
READ
? 'Now saving the new Data Disk Drive designator.'
Select secondary
Use UDIRFILE
GOTO 2
Replace spact with $(spact,1,20)+!(DD)
Store DD to D
Use
Select primary
endif
CASE !(MSEL) = 'Q'
Select secondary
USE
Select primary
USE
Store F to LEVEL1
ENDCASE
ENDDO
ENDDO
Store T to LEVEL1
RETURN
ce / Publication code entry routine. ' to INH
Store D+':REFINDEX' to MFILE
Store D+':REFINDKW' to MFILENDX
Do refcodes.CMD
USE
endif
Release nfile,ofilendx
Store '9' to XX
endif
If XX='2'
Select secondary
Use