Copy the following script into a text file and rename into ".bat" file
@echo off
:: -----------------------------------------------------------------
:: DataStageExportJobs.bat
:: -----------------------------------------------------------------
:: This batch script is used to Export all jobs from a Projects
:: This script must be run from a DataStage client machine and the parameters below should be given
:: -----------------------------------------------------------------
:: Host is server name
:: User is DataStage username
:: Password is DataStage password
:: ImpLocation is the directory where the datastage dsx's are stored
:: -----------------------------------------------------------------
:: IF "%1"=="" GOTO MissingParameter
:: IF "%2"=="" GOTO MissingParameter
:: IF "%3"=="" GOTO MissingParameter
:: IF "%4"=="" GOTO MissingParameter
:: IF "%5"=="" GOTO MissingParameter
::------------------------------------------------------------------
SET Host=%1
SET Project=%2
SET User=%3
SET Password=%4
SET ExpLocation=%5
SET JobList=%ExpLocation%\JobList.txt
:: -----------------------------------------------------------------
:: Get the current Date
:: -----------------------------------------------------------------
FOR /f "tokens=2-4 delims=/ " %%a in ('DATE/T') do SET DsxDate=%%c%%a%%b
:: -----------------------------------------------------------------
:: Get the current Time
:: -----------------------------------------------------------------
FOR /f "tokens=1* delims=:" %%a in ('ECHO.^|TIME^|FINDSTR "[0-9]"') do (SET DsxTime=%%b)
:: -----------------------------------------------------------------
SET delim1=%DsxTime:~3,1%
SET delim2=%DsxTime:~9,1%
FOR /f "tokens=1-4 delims=%delim1%%delim2% " %%a in ('echo %DsxTime%') do (
set DsxHr=%%a
set DsxMin=%%b
set DsxSec=%%c
set DsxHun=%%d
)
:: -----------------------------------------------------------------
:: Set the log file name
:: -----------------------------------------------------------------
SET LogFileName=%ProjectDir%\DataStageImport_bat_%DsxDate%_%DsxHr%_%DsxMin%_%DsxSec%.log
:: -----------------------------------------------------------------
:: Main
:: -----------------------------------------------------------------
SET ArchiveDir=Archive_%DsxDate%_%DsxHr%_%DsxMin%_%DsxSec%
cd %ExpLocation%
mkdir %ArchiveDir%
MOVE *.dsx %ArchiveDir%
MOVE *.log %ArchiveDir%
:: -----------------------------------------------------------------
:: Create a log file name to output
:: -----------------------------------------------------------------
ECHO. > %LogFileName%
ECHO DataStage Export ran on %DsxDate% %DsxHr%:%DsxMin%:%DsxSec% with the following parameters >> %LogFileName%
ECHO Host=%Host% >> %LogFileName%
ECHO User=%user% >> %LogFileName%
ECHO Project=%Project% >> %LogFileName%
ECHO ExportDir=%ExpLocation% >> %LogFileName%
ECHO JobList=%JobList% >> %LogFileName%
ECHO. >> %LogFileName%
:: -----------------------------------------------------------------
:: Change the local directory to DataStage instalation Directory
:: This must be modified based on the DataStage Instalation Drive
:: -----------------------------------------------------------------
cd C:\Program Files\Ascential\DataStage7.5.2\
for /F "tokens=1" %%i in (%JobList%) do (
ECHO Exporting %%i to Project: %Project% on Host: %Host%
echo dscmdexport /H=%Host% /U=%User% /P=%Password% %Project% %ExpLocation%\%%i >> %LogFileName%
dscmdexport /H=%Host% /U=%User% /P=%Password% /NUA %Project% %ExpLocation%\%%i /V >> %ExpLocation%\%LogFileName%
IF NOT %ERRORLEVEL%==0 GOTO ERROR
ECHO. >> %LogFileName%
ECHO *** Completed Export of Project: %Project% on Host: %Host% >> %LogFileName%
ECHO from File: %ExpLocation%\%%i >> %LogFileName%
ECHO. >> %LogFileName%
)
:: -----------------------------------------------------------------
:: ERROR: Checking's
:: -----------------------------------------------------------------
::-------------------------------------------------------------------------------------------------
:MissingParameter
ECHO Missing Parameters
ECHO Please make sure you have enterd HostName,Project,UserName,Password and ImportLocation correctly
cd %ImpLocation%
rmdir %ExpLocation%\%ArchiveDir% /s/q
GOTO END
::------------------------------------------------------------------
:ExportFailed
ECHO.
ECHO *** ERROR: Failed to Export Project: %Project% on Host: %Host%
ECHO. >> %LogFileName%
ECHO *** ERROR: Failed to Export File: %ExpLocation%\%%i Project: %Project% on Host: %Host% >> %LogFileName%
ECHO. >> %LogFileName%
rmdir %ExpLocation%\%ArchiveDir%
GOTO ERROR
:: -----------------------------------------------------------------
:ERROR
ECHO Export Failed,Please make sure all parameters are given and Files are in place
rmdir %ExpLocation%\%ArchiveDir%
GOTO END
::-----------------------------------------------------------------
:ENDS
ECHO. >> %LogFileName%
ECHO successfully Exported
:END
Translate to your Language
Labels
- BI
- Big Data
- BO
- BO Universe Context
- BusinessObjects Context
- BusinessObjects Universe Context
- Cognos
- Command Line DataStage Job Export
- DataStage
- DataStage Command Line Compile
- DataStage Job Compile in command line
- DataStage SCD
- DataStage Server JobCompile Script
- DB
- DW
- DW-SCD
- Optimizing BO Universe and Reports
- Optimizing Business Objects Universe and Reports
- Other
- Q&A
- SAP BO
- SCD
Disclaimer Statement
Total Pageviews
47,671
Category
- BI
- Big Data
- BO
- BO Universe Context
- BusinessObjects Context
- BusinessObjects Universe Context
- Cognos
- Command Line DataStage Job Export
- DataStage
- DataStage Command Line Compile
- DataStage Job Compile in command line
- DataStage SCD
- DataStage Server JobCompile Script
- DB
- DW
- DW-SCD
- Optimizing BO Universe and Reports
- Optimizing Business Objects Universe and Reports
- Other
- Q&A
- SAP BO
- SCD
Track
Follow us on FaceBook
About
Powered by Blogger.
Category
- BI
- Big Data
- BO
- BO Universe Context
- BusinessObjects Context
- BusinessObjects Universe Context
- Cognos
- Command Line DataStage Job Export
- DataStage
- DataStage Command Line Compile
- DataStage Job Compile in command line
- DataStage SCD
- DataStage Server JobCompile Script
- DB
- DW
- DW-SCD
- Optimizing BO Universe and Reports
- Optimizing Business Objects Universe and Reports
- Other
- Q&A
- SAP BO
- SCD
Contributors
Blog Archive
-
▼
2010
-
▼
September
- Informatica PowerCenter 7 Architecture and Perform...
- Informatica PowerCenter 7 Architecture and Perform...
- DataStage Performance Tuning
- DataStage Performance Tuning
- BusinessObjects Enterprise XI session timeout
- BusinessObjects Enterprise XI session timeout
- 10 Don't Do on DataStage
- 10 Don't Do on DataStage
- The Deciding factors for ETL Tools
- The Deciding factors for ETL Tools
- End-to-End Data Governance Webinar by RalphKimbal
- End-to-End Data Governance Webinar by RalphKimbal
- Business Objects Tips and Tricks
- Business Objects Tips and Tricks
- Business Objects Tips and Tricks
- DataStage Convert 32bit(2GbHash Limit) Hash to 64bit
- DataStage Convert 32bit(2GbHash Limit) Hash to 64bit
- DataStage Convert 32bit(2GbHash Limit) Hash to 64bit
- DataStage tip for beginners
- DataStage tip for beginners
- Debugging DataStage parallel jobs
- Debugging DataStage parallel jobs
- Data Generation Using DataStage
- Data Generation Using DataStage
- Data Generation Using DataStage
- DataStage and Slowly Changing Dimensions
- DataStage and Slowly Changing Dimensions
- DataStage and Slowly Changing Dimensions
- DOS Batch Script to Export DataStage Jobs Automati...
- DOS Batch Script to Export DataStage Jobs Automati...
- DataStage Server JobCompile Script
- DataStage Server JobCompile Script
- BusinessObjects Context
- BusinessObjects Context
- Optimizing Business Objects Universe and Reports
- Optimizing Business Objects Universe and Reports
- Optimizing Business Objects Universe and Reports
-
▼
September
Popular Posts
-
Netezza dosen't have any isnumeric check function, so in order to find out whether the column has non-numeric, use the following logic n...
-
If you have table like below GROUP_NAME GROUP_ID PASS_FAIL COUNT GROUP1 5 FAIL 382 GROUP...
-
@echo off :: ----------------------------------------------------------------- :: DataStageExport.bat :: -----------------------------------...
-
The error and reject capturing is one of the best practices that I recommend to all developers, let me explain in a very simple way Rejec...
-
Migrate Universe from one database to another · First backup the original universe in case if something go wrong · Launch ...
-
The open document functionality between 3 and 4 is exactly the same expect a change the default URL The default URL to the OpenDocument web...
-
In data warehousing, a conformed dimension is a dimension that has the same meaning to every fact table in the structure. Conformed dim...
-
Source :-dwh-ejtl.blogspot.com Q1) Tell me what exactly, what was your role? A1) I worked as ETL Developer. I was also involved in requireme...
-
Netezza has 3 internal planner • Fact Relationship Planner (factrel_planner) • Snowflake Planner • Star Planner In the course of a query pla...
-
One of the regular viewer of this blog requested me to explain the important's of the ETL mapping document. What is ETL Mapping Document...
Thursday, September 23, 2010
DOS Batch Script to Export DataStage Jobs Automatically from a Project
by Unknown | at 8:39 PM
-
Netezza ISNUMERIC Data Check Logic
-
How to do PIVOT in netezza SQL
-
Datastage DSX Files Export Script
-
Datastage Error and reject record Handling simplified
-
SAP BO Universe and Report Migration Part 1
-
SAP BO Open Document in 4.1
-
Conformed Dimensions with example
-
Informatica Job Interview Question & Answers
-
Netezza Optimizer Parameters
-
What is ETL Mapping Document ?A Real Time Example
0 comments: