Export DataStage jobs from Command line without executables

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Here is the Driver script which could be scheduled easily.

Code: Select all

:: -----------------------------------------------------------------
:: DataStageExport1PerJobDriver.bat 
:: -----------------------------------------------------------------
:: Host is server name
:: Project
:: User is username to use to attach to DataStage
:: Password   is password to use to attach to DataStage
:: -----------------------------------------------------------------
call A_Edit_Me_First.bat

SET ExportDir=%BaseDir%\Backups
SET ProjectDir=%ExportDir%\%From_Project_Name%

:: Dwn_ExecTCL.exe -n -s%From_Host_Name% -u%From_Project_User% -p%From_Project_Pwd% UNLOCK READULOCK UV
DataStageExport1PerJob.bat %From_Host_Name% %From_Project_Name% %From_Project_User% %From_Project_Pwd%
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

The call is to set the from and to variables on migrating jobs. It is the same as sourcing a shell script in UNIX with

Code: Select all

. MyScript.ksh

Code: Select all

call A_Edit_Me_First.bat
It saves time in just editting this one thing.

Code: Select all

@echo off
:: -----------------------------------------------------------------
:: A_Edit_Me_First.bat 
:: -----------------------------------------------------------------
:: Used to be called DataStageMigrateRequestor.bat
:: -----------------------------------------------------------------
::
:: This batch file needs to be edited each migration.
:: It is called be DataStageMigrate.bat
:: -----------------------------------------------------------------

:: -----------------------------------------------------------------
:: Server parameters
:: Dev to Test or Test to Prod ????????????
:: -----------------------------------------------------------------
SET From_Host_Name=dsdev
SET To_Host_Name=dstest

:: -----------------------------------------------------------------
:: Project parameters
:: -----------------------------------------------------------------
SET From_Project_Name=MyDevProject
SET From_Project_User=MyUser
SET From_Project_Pwd=MyPwd

SET To_Project_Name=MyTestProject
SET To_Project_User=MyUser
SET To_Project_Pwd=MyPwd

:: -----------------------------------------------------------------
:: ExportDir        is the directory above the backed up project
:: -----------------------------------------------------------------
SET BaseDir=c:\DataStage\KimD
SET ProgDir=%BaseDir%\Scripts
:: -----------------------------------------------------------------
:: DsExportCmd      Export command on client
:: DsImportCmd      Import command on client
:: DsCompileCmd     Compile command on client
:: -----------------------------------------------------------------
SET DsBaseDir=C:\Progra~1\Ascential\DataStage7.5.1
SET DsExportCmd=%DsBaseDir%\DsExport.exe
:: SET DsExportCmd=%DsBaseDir%\dscmdexport.exe 
SET DsJobCmd=%DsBaseDir%\dsjob.exe 
:: SET DsImportCmd=%DsBaseDir%\dscmdimport.exe 
SET DsImportCmd=%DsBaseDir%\dsimport.exe
SET DsCompileCmd=%DsBaseDir%\dscc.exe
SET DsDesignerCmd=%DsBaseDir%\dsdesign.exe
:: -----------------------------------------------------------------
SET BackupDir=%BaseDir%\Backups
SET ExportDir=%BaseDir%\Backups
SET ProjectDir=%ExportDir%\%From_Project_Name%
:: -----------------------------------------------------------------
SET PerlBaseDir=C:\strawberry-perl\perl\bin
SET PerlStripDepsCmd=%PerlBaseDir%\perl.exe %BaseDir%\Scripts\StripDSJobDependencies.pl
SET JobList=JobList.txt
SET DsxList=DsxList.txt
:: -----------------------------------------------------------------
Mamu Kim
Post Reply