Page 1 of 1

Datastage Code Export Important

Posted: Mon Mar 15, 2010 2:49 pm
by srireddypunuru
Hi

We are planning to have a process in place where we can use Rational Build Forge Tool which invoke a script which would export and import DSX into Datastage 8.1. what are the ds commands which are specific to 8.1 which can be used at the server side other than ISTOOLS.

Thanks
Srikanth Punuru

Posted: Mon Mar 15, 2010 5:04 pm
by kduke
I took the scripts I used to backup a project and modified them to migrate jobs. I create a list of jobs called JobList.txt. Then I edit a bat file which sets up my from and to project names and user names. Then I run the script.

Code: Select all

for /F "tokens=1" %%i in (%JobList%) do (
    %DsExportCmd% /H=%ExportHost% /U=%ExportUser% /P=%ExportPassword% /JOB=%%i %ExportProject% %%i.dsx >> %LogFileName%
    %DsImportCmd% /H=%ImportHost% /U=%ImportUser% /P=%ImportPassword% %ImportProject% %ProjectDir%\%%i.dsx >> %LogFileName%
    %DsCompileCmd% /h %ImportHost% /u %ImportUser% /p %ImportPassword% %ImportProject% /j %%i /f >> %LogFileName%
    osql -S %ETL_MIGRATION_HOST% -U %ETL_MIGRATION_USER% -P %ETL_MIGRATION_PWD% -i %SqlFile%
)
The commands are these:

Code: Select all

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
The ones commented out work better for whole projects and not individual jobs.

Posted: Mon Mar 15, 2010 5:10 pm
by kduke
I build I SQL statement which does an insert into table so we can track what jobs got migrated when. There are actually 2 tables one with job names and another with start and end times for the whole migration. We could easily track how much time it took the admins to migrate jobs. We had a nice audit trail too.

This use osql the SQL Server command line tool. I will have an Oracle version soon. Maybe I will post the code to others can benefit. The changes are real simple to the original DataStageBackup.bat file posted on my tips page. I think anyone can do it from what I posted above.