home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
15a
/
convdb2.zip
/
CONGEN.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-02-14
|
3KB
|
80 lines
************************************************************
************************************************************
***** File Converter (c) COPYRIGHT 1983 *****
***** congen.cmd Data Based Advisor *****
***** *****
***** AUTHOR: Larry Eitel *****
***** DATE: October 29, 1983 *****
***** *****
***** called from con.cmd *****
***** *****
***** PURPOSE: *****
***** Generate a command file with REPLACE *****
***** statements to convert the contents in the *****
***** (SECONDARY) "from" file and APPEND it to the *****
***** (PRIMARY) "to" file. The command file *****
***** generated is named CONVERT.CMD. *****
***** *****
***** DISCLAIMER: *****
***** The author makes or implies no warranties *****
***** regarding the operation or usefulness of this *****
***** program. It is recommended the user make *****
***** backups of any valuable files. *****
************************************************************
************************************************************
***** If there are no REPLACE statements available, RETURN.
IF 0=test(line&lnumber)
RETURN
ENDIF 0=test(line&lnumber)
@ 8,0 SAY ' '
***** Open a text file that will become a command file to
***** convert the contents in the from file (secondary)
***** and add them to the to file (primary). The name of
***** command file generated can be changed by replacing
***** convert.cmd with the new name. Make sure that if
***** you want to run the results, the name has the
***** extention .CMD for 8-bit users or .PRG for 16-bit
***** users.
SET ALTERNATE TO convert.cmd
SET ALTERNATE ON
? 'CLEAR'
? 'ERASE'
? 'SET TALK OFF'
? '***** File to recieve converted information.'
? 'SELECT PRIMARY'
? 'USE ' +tock
? 'SELECT SECONDARY'
? '***** Source of converted information.'
? 'USE ' +fromck
? 'DO WHILE .NOT. eof'
? ' @ 10,00 SAY "Currently record number-"+str(#,5)'
? ' SELECT PRIMARY'
? ' APPEND BLANK'
***** This loop will display each available REPLACE
***** statement. The result of course is that each
***** REPLACE statement will be a separate line in the
***** command file.
STORE 1 TO showline
STORE str(showline,1) TO show
DO WHILE 0#test(line&show)
? ' ' +line&show
STORE showline+1 TO showline
IF showline<10
STORE str(showline,1) TO show
ELSE
STORE str(showline,2) TO show
ENDIF showline<10
ENDDO WHILE 0#test(line&show)
? ' SELECT SECONDARY'
? ' SKIP'
? 'ENDDO'
? 'RETURN'
***** Turn off and close the ALTERNATE FILE.
SET ALTERNATE OFF
SET ALTERNATE TO
?
? 'Press any key to continue.'
WAIT
RETURN