Selective Command Line Export?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.patonp wrote:Is it as simple as concatenating multiple dsx files into one, or is it more complex than that?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Here is the code to export the set of Jobs.
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.
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.
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
Anand
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
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
This is the place to share... your are always welcome to share your creative ideas.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
-Kumar
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
dsexport job design and exe
Is there an option to export both the job designs and exe using the command line
etlbets
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
Yes, we can do that
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.
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)