home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG102.ARC
/
CLEARDAT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
4KB
|
173 lines
*CLEARDATA.PRG
* A PROGRAM TO CLEAR OUT ALL DATA FILES SO THAT THE SYSTEM CAN BE RESTARTED.
ERASE
SET TALK OFF
STORE '~' TO DEC
DO WHILE T
ERASE
@ 2,0 SAY '*****************************************************************'
@ 3,0 SAY ' CLEAR DATA PROGRAM .. '
@ 4,0 SAY ' THIS PROGRAM CLEARS OUT ALL DATA FILES '
@ 6,0 SAY ' PRESS TO DO '
@ 7,0 SAY ' 1 START '
@ 8,0 SAY ' R TO ABORT AND RETURN '
@ 11,0 SAY '****************************************************************'
SET TALK OFF
WAIT TO DEC
STORE !(DEC) TO DEC
DO CASE
CASE DEC='R'
RETURN
ENDCASE
ERASE
?? CHR(07)
? 'PLEASE NOTE THAT THIS PROGRAM DESTROYS ALL DATA '
? 'WHAT IS THE CODE TO CONTINUE THIS PROGRAM '
? ':'
SET TALK OFF
SET CONSOLE OFF
ACCEPT TO PASSWORD
IF PASSWORD <> DATE()
SET CONSOLE ON
ERASE
?
?
?'************************* INCORRECT PASSWORD ****************************'
STORE 100 TO WAIT
DO WHILE WAIT>1
STORE WAIT-1 TO WAIT
LOOP
ENDDO
LOOP
ENDIF
SET CONSOLE ON
ERASE
?
?
? '**************************** PASSWORD CORRECT **************************'
?? CHR(07)
***********************************
? ' ** CLEARING OUT BACKORDER/FREIGHT ARCHIVE FILE **'
USE DATARCH
COPY STRUCTURE TO TEMP
USE
DELETE FILE DATARCH
USE
RENAME TEMP TO DATARCH
********************************
? ' ** CLEARING OUT TRANSACTION FILE FOR STANDARD ORDERS **'
USE DATAFILE
COPY STRUCTURE TO TEMP
USE
DELETE FILE DATAFILE
USE
RENAME TEMP TO DATAFILE
*****************
? ' ** CLEARING OUT TRANSACTION FILE FOR CASH SALES **'
USE DATATEMP
COPY STRUCTURE TO TEMP
USE
DELETE FILE DATATEMP
RENAME TEMP TO DATATEMP
*********************
? ' ** CLEARING OUT TRANSACTION FILE FOR COLLECTED GOODS **'
USE HOLDATA
COPY TO TEMP
USE
DELETE FILE HOLDATA
USE
RENAME TEMP TO HOLDATA
*************************************
? ' ** CLEARING OUT ARCHIVE FILE FOR DEBTORS TRANSACTIONS **'
USE LEDARCH
COPY STRU TO TEMP
USE
DELETE FILE LEDARCH
RENAME TEMP TO LEDARCH
******************************
? ' ** CLEARING OUT TRANSACTION FILE FOR STATEMENTS & RECEIPTS **'
USE LEDGER
COPY STRU TO TEMP
USE
DELETE FILE LEDGER
RENAME TEMP TO LEDGER
******************************
? ' ** CLEARING OUT GENERAL LEDGER FILE **'
USE GENLED
COPY STRU TO TEMP
USE
DELETE FILE GENLED
RENAME TEMP TO GENLED
? ' ** RE-STRUCTURING GENERAL LEDGER INDEXES **'
DELETE FILE CHQNUM.NDX
DELETE FILE GENTYPE.NDX
USE GENLED
INDEX ON CHQNUM TO CHQNUM
INDEX ON TYPE TO GENTYPE
******************************
? ' ** CLEARING CUSTOMER FILE **'
USE NAMELIST
COPY STRU TO TEMP
USE
DELETE FILE NAMELIST
RENAME TEMP TO NAMELIST
? ' ** RE-STRUCTURING CUSTOMER FILE INDEXES **'
DELETE FILE NAME.NDX
DELETE FILE NAMENUM.NDX
USE NAMELIST
INDEX ON NAME TO NAME
INDEX ON ACCNUM TO NAMENUM
********************************
? ' ** CLEARING OUT PRODUCT FILE **'
USE PRICELIS
COPY STRU TO TEMP
USE
DELETE FILE PRICELIS
RENAME TEMP TO PRICELIS
? ' ** RE-STRUCTURING PRODUCT FILE INDEX **'
DELETE FILE PRICECOD.NDX
USE PRICELIS
INDEX ON CODE TO PRICECOD
******************************
? ' ** CLEARING OUT RETURNED FOR CREDIT FILE **'
USE RFC
COPY STRU TO TEMP
USE
DELETE FILE RFC
RENAME TEMP TO RFC
******************************
? ' ** CLEARING OUT STOCK FILE **'
USE STOCK
COPY STRU TO TEMP
USE
DELETE FILE STOCK
RENAME TEMP TO STOCK
STORE ' ' TO DEC
ENDDO
RETURN
COPY STRU TO TEMP
USE
DELETE FILE PRICELIS
RENAME TEMP TO PRICELIS
? ' ** RE-STRUCTURING PRODUCT FILE INDEX **'
DELETE FILE PRICECOD.NDX
USE PRICELIS
INDEX ON CODE TO PRICECOD
******************************
? ' ** CLEARING OUT RETURNED FOR CREDIT FILE **'
USE RFC
COPY STRU TO TEMP
USE
DELETE FILE RFC
RENAME TEMP TO RFC
******************************
? ' ** CLEARING OUT STOCK FILE **'
USE STOCK
COPY STRU TO TEMP
USE
DELETE FILE STOCK
RENAME TEMP TO STOCK
RETURN
**'
USE