Selective Command Line Export?

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

patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

Is it as simple as concatenating multiple dsx files into one, or is it more complex than that?
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

I guess concat should work. let us know.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

patonp wrote:Is it as simple as concatenating multiple dsx files into one, or is it more complex than that?
It's more complex than that. Each DSX file has its own header. You need to make sure that the result has only one header.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

I don't think we need to do that. I tried concating two dsx files into one and imported it which worked fine.

Thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

kaps wrote:I don't think we need to do that. I tried concating two dsx files into one and imported it which worked fine.

Thanks
Do you mean to say with two header?

-Kumar
Andal
Participant
Posts: 124
Joined: Thu Dec 02, 2004 6:24 am
Location: Bangalore, India

Post by Andal »

Here is the code to export the set of Jobs.

Code: Select all

@echo off

ECHO **************Beginning Export of Jobs

For /F "tokens=1" %%i in (C:\Anand\ExportJobs\DsxList.txt) do (
echo **** %%i

C:\Progra~1\Ascential\DataStage7.5\DSExport.exe /U=Username /P=Password /H=HostName /JOB=%%i ProjectName C:\Anand\ExportJobs\aa.dsx


   REM wait for the dsexport to finish
   :2
   pslist dsexport > nul
   if not errorlevel 1 goto 2

type C:\Anand\ExportJobs\aa.dsx >> C:\Anand\ExportJobs\bb.dsx

)


    ECHO *** Export completed successfully.
Save the Code as a Bat File.

Here C:\Anand\ExportJobs\DsxList.txt will contain the list of Jobs to be exported.

aa.dsx will contain the current job which is being exported.

bb.dsx will conatin the final dsx.

If we are having Multiple headers in a same DSX it wont give any problem.

PSLIST.exe can be downloaded from sysinternals.com.

You should put pslist.exe and the batch file in the same folder.
Rgds
Anand
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

kaps wrote:I don't think we need to do that. I tried concating two dsx files into one and imported it which worked fine.

Thanks
Yes, Concatinating two dsx with two header is also working
:D
-Kumar
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

I've written a routine that reads data from a file containing server/project/job names and accepts login information as parameters. The routine then executes the DSExport command using this information.

If the user has incorrectly specified these parameters or job names, the routine hangs. I'm not certain, but I think that DSExport is attempting to prompt the user for correct login credentials and/or a corrected server/project name. I'm guessing that the routine is not aware of this and simply waits for the executable to terminate.

Is there any way to simply have the DSExport function return an error if incorrect parameters are passed to it?

Thanks again!

Peter
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Peter

I am not sure about routine. But I have done this using Bat script.
If you want I can share you the code. If you write a batch script you can also include that in your datastage designer as a utility so that the functionality is one click away.

Thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

kaps wrote:Peter

I am not sure about routine. But I have done this using Bat script.
If you want I can share you the code. If you write a batch script you can also include that in your datastage designer as a utility so that the functionality is one click away.

Thanks
This is the place to share... your are always welcome to share your creative ideas.

-Kumar
Chuah
Participant
Posts: 46
Joined: Thu May 18, 2006 9:13 pm
Location: Melbourne

Post by Chuah »

kaps wrote:DSExport command can also export individual jobs.

Thanks
Hi,
Can DSExport export only Table Definitions without exporting the jobs etc ? What I'm trying to do is export all my Table Def into an XML document.
Pls advise.

Rgds
Chin
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'd have to do that from the Manager.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I once wrote (and posted) a routine to dump a table definition in CSV, IMF or XML format.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
etlbets
Premium Member
Premium Member
Posts: 25
Joined: Wed Jul 25, 2007 8:51 am

dsexport job design and exe

Post by etlbets »

Is there an option to export both the job designs and exe using the command line
etlbets
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Yes, we can do that

Code: Select all


   Call DSExecute("NT","C:\Progra~1\Ascential\DataStage7.5\DSExport.exe /U=Admin /P=***** /H=Hostname /JOB= TestJob PROJECTNAME c:\aa.dsx",Abc,Abcd) 


   Call DSExecute("NT","C:\Progra~1\Ascential\DataStage7.5\DSExport.exe /U=Admin /P=***** /H=Hostname /JOB= TestJob  /EXEC /APPEND PROJECTNAME c:\aa.dsx",Abc,Abcd) 

You cannot include the executables in the same command, but you can append it with the existing DSX file, in the another call.Just I have tried this and didnt follow any error handling.
Post Reply