home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr2.zip
/
CLIBRARY.CMD
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
7KB
|
248 lines
* Program CLIBRARY - Controls all CLIBRARY 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+':CLIBRARY' 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 L I B R A R Y 2-/CLIBRARY/'
@ 5,13 say ' Makes and Recalls Book Article Summaries '
@ 7,9 say ' 1) Enter new Book Articles /REFERNTR/'
@ 8,9 say ' 2) Recall Books by a selected SUBJECT /REFSELCT/'
@ 9,9 SAY ' 3) Books Library REPORTS /REFREPTS/'
@ 10,9 say ' 4) Display the Book Library Subject INDEX /REFDXLST/'
@ 11,9 say ' 5) Display the Book Library Codes-Names '
@ 12,9 say ' 6) Update the Library Codes/Names /REFCODES/'
@ 13,9 say ' 7) Change/Delete an existing Library 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+':CLIBRARY' 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 'CLIBRARY - New Book Article Entry' to INH
Store D+':CLIBRARY' to MFILE
Store D+':CLIBINDX' to mfile1
Store D+':CLIBINKW' to MFILE3
Do REFERNTR.CMD
Store T to validd1
CASE MSEL = '2'
Store 'CLIBRARY Book Subject Search' to INH
Store D+':CLIBRARY' to MFILE
Store D+':CLIBINDX' to MFILE1
Store D+':CLIBINKW' to MFILE1NDX
Do REFSELCT.CMD
CASE MSEL = '3'
Store 'CLIBRARY Book' to INH
Store D+':CLIBRARY' to MFILE
Do CLIBREPT.CMD
CASE MSEL = '4'
Store 'CLIBRARY - Book Article Reference/Publication INDEX list ' to INH
Store D+':CLIBINDX' to MFILE
STore D+':CLIBINKW' to MFILENDX
Do REFDXLST.CMD
CASE MSEL = '5'
Select primary
Use
Select secondary
Store d+':CLIBINDX' to MFILE
Store '~~~' to inx
Use &MFILE index &MFILE
Store # to LTOP
Store '~' to XX
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
? 'Book Library 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 Book Library Reference/Pub. codes. Press <retn> ' to XX
Select primary
Release ST,inx,xx
CASE MSEL = '6'
Store D+':CLIBINDX' to MFILE
Store D+':CLIBINKW' to MFILENDX
Store 'CLIBRARY Book Reference / Publication code entry routine.' to INH
Do REFCODES.CMD
CASE MSEL = '7'
Store D+':CLIBINDX' to MFILENDX
Store D+':CLIBINKW' to MFILENX
Store D+':CLIBRARY' to MFILE
Store 'CLIBRARY Book Article Change routine.' to INH
Do REFCHNGE.CMD
CASE MSEL = '8'
?
? ' CLIBRARY SET UP'
?
? ' 1) Build new Library files'
? ' 2) Re-index existing Library files'
? ' 3) Names Directory editing'
?
Accept ' Enter selection ' to XX
?
If XX='1'
Accept ;
'Now about to build new Library files: CLIBRARY.DBF and CLIBINDX.DBF. OK? ' ;
to XX
If !(XX)='Y'
Use REFERNCX
? 'Now creating CLIBRARY.DBF file with index = CLIBRARY.NDX'
Store d+':CLIBRARY' to MFILE
Copy to &MFILE
USE &MFILE
Index on sourcecode to &MFILE
Use refindxx
? 'Now creating CLIBINDX.DBF file for keywords,'
? 'with indexes = CLIBINDX.NDX and CLIBINKW.NDX'
Store d+':CLIBINDX' to NFILE
Copy to &NFILE
Use &NFILE
Store d+':CLIBINKW' to OFILENDX
Index on keywordndx to &OFILENDX
Index on sourcecode to &NFILE
Use
? 'New Library and index files are now created. '
Accept 'Press <retn> to enter Book Publication/Reference codes' to XX
Store 'CLIBRARY Book Reference / Publication code entry routine.' to INH
Store D+':CLIBINDX' to MFILE
Store D+':CLIBINKW' 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+':CLIBRARY' to MFILE
Use &MFILE
? 'Now re-indexing CLIBRARY file by SOURCECODE.'
Set talk on
Index on sourcecode to &MFILE
Set talk off
Store d+':CLIBINDX' to MFILE1
Use &MFILE1
? 'Now re-indexing CLIBINDX file by SOURCECODE.'
Set talk on
Index on sourcecode to &MFILE1
Set talk off
Store d+':CLIBINKW' TO MFILE2
? 'Now re-indexing CLIBINDX 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'
@ 16,0
@ 17,0
@ 18,0
@ 19,0
@ 20,0
@ 21,0
@ 22,0
@ 15,0
? ' Names Directory editing'
Store D to DD
@ 18,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
Store T to LEVEL1
RETURN
@ 7,9 say ' 1) Enter new Book Articles /REFERNTR/'
@ 8,9 say ' 2) Recall Books by a selected SUBJECT /REFSELCT/'
@ 9,9 SAY ' 3) Books Library REPORTS /REFREPTS/'
@ 10,