Datastage Code Export Important

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

Post Reply
srireddypunuru
Premium Member
Premium Member
Posts: 40
Joined: Thu Jul 10, 2008 12:45 pm

Datastage Code Export Important

Post 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
Srikanth Reddy
Integration Consultant
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Post Reply