command line functins that import and export the DS jobs

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

rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

command line functins that import and export the DS jobs

Post by rumu »

Hi All,
What is the command line functins that import and export the DS jobs?
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Post by dsusr »

Hi,

You can find the utilities for command line export and import from DataStage Manager guide.

There are two utilities called dsimport.exe and dsexport.exe by which you can take the import and export from command line.

Regards
dsusr
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

dsexport does only export a whole project. dsimport does import, what's in the file.

If you want to export individual elements (single jobs, single routines and single transforms) you can use for example a third-party-Tool called dsmove.

Wolfgang
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

WoMaWil wrote:dsexport does only export a whole project. dsimport does import, what's in the file.

If you want to export individual elements (single jobs, single routines and single transforms) you can use for example a third-party-Tool called dsmove.

Wolfgang
Thnx for your promt response.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

exporting sigle job from command line is possible

Post by kaps »

Hi

You can export individial jobs from command line. I don't know why others are saying it's not possinle. I have heard the samething but I could export an individual job from command line using dsexport command.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

But you can't do it with the client-based dscmdexport command. If you disagree with that assertion, please supply the method.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mdan
Charter Member
Charter Member
Posts: 46
Joined: Mon Apr 28, 2003 4:21 am
Location: Brussels
Contact:

Re: exporting sigle job from command line is possible

Post by mdan »

to export an individual job use
dsexport [/XML] /U=username /P=password /H=hostname /JOB=jobname projectname to_file_name
kaps wrote:Hi

You can export individial jobs from command line. I don't know why others are saying it's not possinle. I have heard the samething but I could export an individual job from command line using dsexport command.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Now show us with dscmdexport command. This is the command about which it is asserted that individual jobs can not be exported, not dsexport.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

ray.wurlod wrote:Now show us with dscmdexport command. This is the command about which it is asserted that individual jobs can not be exported, not dsexport.
I think it's hardly fair to criticize someone for posting a useful answer to the original poster's question.
Phil Hibbs | Capgemini
Technical Consultant
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Ray

I don't dare to disagree with you. But can you please explain why do you want to use dscmdexport when we can accomplish the same objective using dsexport ?

by the way dsexport command can be run without any user interaction.

Thanks
Neil C
Participant
Posts: 46
Joined: Sun Apr 06, 2003 8:59 pm
Location: Auckland, New Zealand

Post by Neil C »

Is there a parameter to enable this to append to to_file_name file?
Neil Courtney

"MG - Life's too short not to"
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Neil,

for to control dsexport, you will programm just somewhere something, for example a dos-batchfile.

There you can use normal pipes.

type file1 >> file2

(append file1 to file2)

Wolfgang
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

WoMaWil wrote:Neil,
for to control dsexport, you will programm just somewhere something, for example a dos-batchfile.
There you can use normal pipes.
type file1 >> file2
(append file1 to file2)
Wolfgang
The problem with this is that when your batch executes dsexport, the dsexport starts running as a separate Windows process and your batch continues to execute in parallel. You will have to do something clever to detect when dsexport has finished executing. It may be possible to write a program that repeatedly tries to open the output file exclusively, which should fail while the dsexport command is running. I will investigate and update this post if I find an easy solution.

Update: Got it! You need to download pslist.exe from sysinternals.com, and use a batch file like this:

Code: Select all

@echo off
del %1.dsx
"C:\Program Files\Ascential\DataStage\dsexport" /U=dsadm /P=ascential /H=corus /JOB=%1 CorusITB_Dev %1.dsx

REM wait for file to exist
:1
if not exist %1.dsx goto 1

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

REM file should exist now!
dir %1.dsx
Save that as export.bat along with the pslist.exe somewhere in your PATH (I recommend making a directory like c:\utils and add that to your path in the system properties), and run "export XXXX" where XXXX is your job name, and it will create a file XXXX.dsx that you can then concatenate to another .dsx file.

It will all go horribly wrong if the job doesn't exist, or the password is wrong, or you can't connect to the server for some reason, it will wait forever for the file to appear, but you can break out of it with [Ctrl]-C.

Update: If the export fails for any of the aforementioned reasons, you will get dialog boxes telling you about the problem. When you have got rid of these dialog boxes, it will create a file, so the batch will then terminate correctly without Ctrl-C.
Last edited by PhilHibbs on Fri Sep 23, 2005 7:16 am, edited 1 time in total.
Phil Hibbs | Capgemini
Technical Consultant
mickboland
Participant
Posts: 27
Joined: Sun Mar 20, 2005 4:23 am
Location: Brisbane, Australia

Post by mickboland »

Is there any way to export the full project to XML?
mickboland
Participant
Posts: 27
Joined: Sun Mar 20, 2005 4:23 am
Location: Brisbane, Australia

Post by mickboland »

Is there any way to export the full project to XML from the cmd line?
Post Reply