Export several jobs to one file using command line

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Export several jobs to one file using command line

Post by clarcombe »

I would like to use dsexport to export several jobs to one file e.g.

c:\Progra~1\Ascential\DataStage7.5.2\dsexport.exe /H=***** /U=***** /P=***** COP_DEV /job=BI1_000_FMI005 Z:\partages\ERP_COPERNIC\SNCF_Datatage\Livraison\BI1\20080108\COP_BI1.dsx

c:\Progra~1\Ascential\DataStage7.5.2\dsexport.exe /H=****** /U=***** /P=***** COP_DEV /job=BI1_000_FNM010 Z:\partages\ERP_COPERNIC\SNCF_Datatage\Livraison\BI1\20080108\COP_BI1.dsx

The /append option is only allowed for exporting executables.

Question
Is there any way to do this either in a standard way or a workaround
Last edited by clarcombe on Wed Oct 08, 2008 7:06 am, edited 1 time in total.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

There is a way, to append all the jobs to a single dsx. Do it as like what you are doing now, and after each execution append the dsx to a different file.

you need to do Some thing like

Code: Select all

::****************Begin Export Loop


For /F "tokens=1" %%i in (C:\export\DsxList.txt) do (

  echo **** Exporting Job %%i


C:\Progra~1\Ascential\DataStage7.5\dsexport /H=***** /U=***** /P=***** /JOB=%%i PROJ_TRAINING  c:\export\aa.dsx

  type C:\export\aa.dsx >> C:\export\dsfinal.dsx 

)


    ECHO *** Export completed successfully for projects:

If the type command is firing before the complete export of a particular job, then you might have to investigate PSLIST, or Search for PSLIST in the forum, i hope once Arndw , posted something related to PSLIST.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Interesting idea.

I had thought of doing a move *.dsx final.dsx but I like the idea of the type better as it means I have less excel code to modify
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Each dsx file has a header. This would work if you stripped the header off. Not sure if it can ignore multiple headers in one file. Try it. Let us know.
Mamu Kim
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

I have left the headers in the dsx and it works fine.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

In fact, I cannot export executables with each dsx and then concatenate them. I can only export the source code
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
Post Reply