DOS option jump implementation, dos + bcp double-click import and export data
DOS option jump implementation, dos + bcp double-click import and export data
Option. bat
@echo off:Start2 clsgoto Start:Starttitle Frequently Used Websitesecho Please select a website from the listecho with the corresponding keyecho --------------------------------------echo [1] Googleecho [2] Wikipediaecho [3] Facebookecho [4] Youtubeecho [5] Yahooset input=set /p input= Choice:if "%input%" =="" goto Nif %input%==1 goto Z if NOT goto Start2if %input%==2 goto X if NOT goto Start2if %input%==3 goto C if NOT goto Start2if %input%==4 goto V if NOT goto Start2if %input%==5 goto B if NOT goto Start2if %input% gtr 5 goto N:Zclsecho You have selected Googlepausestart www.google.comexit:Xclsecho You have selected Wikipediapausestart www.wikipedia.comexit:Cclsecho You have selected Facebookpausestart www.facebook.comexit:Vclsecho You have selected Youtubepausestart www.youtube.comexit:Bclsecho You have selected Yahoopausestart www.Yahoo.comexit:Nclsecho Invalid Selection! Try againpausegoto :start2
Mantis%225_exportsalesorder_autosys.cmd
@cls@echo OFF@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"@SETLOCAL ENABLEEXTENSIONS@SETLOCAL ENABLEDELAYEDEXPANSION@echo ...@echo VALIDATE ENVIRONMENT VARIABLES ...rem +--------------------------------------------------------------------------+rem | VALIDATE ENVIRONMENT VARIABLES |rem +--------------------------------------------------------------------------+@set MSBACKUP=D:\SalesOrder_NEWDRM@set MSLOG=D:\SalesOrder_NEWDRM@set MSTMP=D:\SalesOrder_NEWDRM@echo ...@echo DECLARE ALL GLOBAL VARIABLES...rem +--------------------------------------------------------------------------+rem | DECLARE ALL GLOBAL VARIABLES. |rem +--------------------------------------------------------------------------+@set FILENAME=SALESORDER@set DB_USERNAME=DRMPOS@set DB_PASSWORD=DRMPOS@set TNS_ALIAS=DRMPROD@set LOGFILE=%MSLOG%\%FILENAME%_%TNS_ALIAS%.log@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.datrem +--------------------------------------------------------------------------+rem | WRITE EXPORT PARAMETER FILE. |rem +--------------------------------------------------------------------------+@echo ...@echo MOVE OLD EXPORT (DUMP) FILE....rem +--------------------------------------------------------------------------+rem | MOVE OLD EXPORT (DUMP) FILE. |rem +--------------------------------------------------------------------------+@if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup")@if exist %DUMPFILE% (echo f|@xcopy /y %DUMPFILE% %DUMPFILE%.backup)@if exist %LOGFILE% (echo f|xcopy /y %LOGFILE% "%LOGFILE%.%endfix%")@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")@if exist %LOGFILE% (del /q %LOGFILE%)@echo ...@echo PERFORM EXPORT...rem +--------------------------------------------------------------------------+rem | PERFORM EXPORT. |rem +--------------------------------------------------------------------------+rem exp parfile=%PARFILE%@bcp " select * from drmpos.SALESORDER where orderdate >= convert(DATE,getdate()-10)" queryout %DUMPFILE% -T -c -t^| -d apoms -e %LOGFILE% @IF not EXIST %LOGFILE% GOTO end@echo ...error occured@echo SCAN THE EXPORT LOGFILE FOR ERRORS...rem +--------------------------------------------------------------------------+rem | SCAN THE EXPORT LOGFILE FOR ERRORS. |rem +--------------------------------------------------------------------------+@echo ...@echo Analyzing log file for errors...@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%@if errorlevel 1 (goto good1) else (goto exception):END@echo ...@echo finished WITHOUT errorlog@exit /b 0:good1@echo ...@echo Analyzing log file for MS-errors...@findstr /I /C:"invalid" %LOGFILE%@if errorlevel 1 (goto good2) else (goto exception):good2@echo ...@echo Analyzing log file for warnings...@findstr /I /C:"error" %LOGFILE%@if errorlevel 1 (goto good3) else (goto exception):good3@echo ...@echo Analyzing log file for warnings...@findstr /I /C:"rows" %LOGFILE%@if errorlevel 1 (cmd /c exit 0) else (goto exception)@exit /b 0:exception@exit /b 1
Mantis%227_importsalesorder_autosys.cmd
@cls@echo OFF@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"@SETLOCAL ENABLEEXTENSIONS@SETLOCAL ENABLEDELAYEDEXPANSION@echo ...@echo VALIDATE ENVIRONMENT VARIABLES ...rem +--------------------------------------------------------------------------+rem | VALIDATE ENVIRONMENT VARIABLES |rem +--------------------------------------------------------------------------+@set MSBACKUP=D:\SalesOrder_NEWDRM@set MSLOG=D:\SalesOrder_NEWDRM@set MSTMP=D:\SalesOrder_NEWDRM@echo ...@echo DECLARE ALL GLOBAL VARIABLES...rem +--------------------------------------------------------------------------+rem | DECLARE ALL GLOBAL VARIABLES. |rem +--------------------------------------------------------------------------+@set FILENAME=SALESORDER@set DB_USERNAME=DRMPOS@set DB_PASSWORD=DRMPOS@set TNS_ALIAS=DRMPROD@set LOGFILE=%MSLOG%\IMP_%FILENAME%_%TNS_ALIAS%.log@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.datrem +--------------------------------------------------------------------------+rem | WRITE EXPORT PARAMETER FILE. |rem +--------------------------------------------------------------------------+@echo ...@echo MOVE OLD EXPORT (DUMP) FILE....rem +--------------------------------------------------------------------------+rem | MOVE OLD EXPORT (DUMP) FILE. |rem +--------------------------------------------------------------------------+@if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup")@if exist %DUMPFILE% (echo f|@xcopy /y %DUMPFILE% %DUMPFILE%.backup)@if exist %LOGFILE% (echo f|xcopy /y %LOGFILE% "%LOGFILE%.%endfix%")@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")@if exist %LOGFILE% (del /q %LOGFILE%)@echo ...@echo PERFORM EXPORT...rem +--------------------------------------------------------------------------+rem | PERFORM EXPORT. |rem +--------------------------------------------------------------------------+rem exp parfile=%PARFILE%@bcp apoms.drmpos.SALESORDER in %DUMPFILE% -T -c -t^| -e %LOGFILE% @IF not EXIST %LOGFILE% GOTO end@echo ...error occured@echo SCAN THE EXPORT LOGFILE FOR ERRORS...rem +--------------------------------------------------------------------------+rem | SCAN THE EXPORT LOGFILE FOR ERRORS. |rem +--------------------------------------------------------------------------+@echo ...@echo Analyzing log file for errors...@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%@if errorlevel 1 (goto good1) else (goto exception):END@echo ...@echo finished WITHOUT errorlog@exit /b 0echo ...echo Analyzing log file for errors...findstr /I /C:"Import terminated unsuccessfully" %LOGFILE%if errorlevel 1 (goto good1) else (goto exception):good1echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"communication" %LOGFILE%if errorlevel 1 (goto good2) else (goto exception):good2echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"errors" %LOGFILE%if errorlevel 1 (goto good3) else (goto exception):good3echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"Snapshot" %LOGFILE%if errorlevel 1 (goto good4) else (goto exception):good4echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"TNS" %LOGFILE%if errorlevel 1 (goto good5) else (goto exception):good5echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"resource" %LOGFILE%if errorlevel 1 (goto good6) else (goto exception):good6echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"deadlock" %LOGFILE%if errorlevel 1 (goto good7) else (goto exception):good7echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"identifier" %LOGFILE%if errorlevel 1 (goto good8) else (goto exception):good8echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"maximum" %LOGFILE%if errorlevel 1 (goto good9) else (goto exception):good9echo ...echo Analyzing log file for ORA- errors...findstr /I /C:"shutdown" %LOGFILE%if errorlevel 1 (goto good10) else (goto exception):good10echo ...echo Analyzing log file for warnings...findstr /I /C:"unable" %LOGFILE%if errorlevel 1 (cmd /c exit 0) else (goto exception)exit /b 0:exceptionexit /b 1