export and import job on UNIX

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
FIINFY
Premium Member
Premium Member
Posts: 5
Joined: Tue Jul 29, 2008 10:58 am

export and import job on UNIX

Post by FIINFY »

Hi

Can the datastage jobs be imported from UNIX box, i.e., if the .dsx file is placed on UNIX, is there a dsimport.exe like utility which can import the jobs in DataStage?

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

Post by ray.wurlod »

dsjob has an -import option but it only imports job executables as far as I am aware.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

Hi,

Is there any command in DS where I can export the jobs using UNIX, say call DS Manager from Unix shell script and then pass all the job names to DS Manager using a file and a dsx will automatically be created based on the input file having all the jobs to be exported.
Aim high
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The 'DS Manager' is a client tool. Windows, not UNIX.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

chulett wrote:The 'DS Manager' is a client tool. Windows, not UNIX.
Thanks. In that case, is there any command in Windows which we can put in Bat file which will call DS Manager and take the export of jobs using the input file containing all the jobs?
Aim high
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You wouldn't call the Manager but rather dscmdexport.exe for an entire project or dsexport.exe for a single job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
zealcrash
Participant
Posts: 6
Joined: Sun Feb 25, 2007 8:14 pm

Hmm...

Post by zealcrash »

nkln@you wrote:
chulett wrote:The 'DS Manager' is a client tool. Windows, not UNIX.
Thanks. In that case, is there any command in Windows which we can put in Bat file which will call DS Manager and take the export of jobs using the input file containing all the jobs?
There is 'dscmdimport.exe' and 'dscmdexport.exe' in DataStage client folder. You can use these. :)
"dscmdimport"
usage: dscmdimport [/H][/U][/P][/O][/NUA] project|/ALL|/ASK filepaths [/V]

/H Host name.
/U User name.
/P Password.
/O Omit flag.
/NUA Suppress usage analysis.
project Specifies the project name.
/ALL Import the specified dsx files into all projects on the server.
/ASK Asks for project name.
filepaths Specifies the import file names.
/V Verbose. Default to false.


"dscmdexport"
usage: dscmdexport [/H][/U][/P][/O] project filepath [/V]

/H Host name.
/U User name.
/P Password.
/O Omit flag.
project Specifies the project name.
filepath Specifies the export file name.
/V Verbose. Default to false.
ZealCrash
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

chulett wrote:You wouldn't call the Manager but rather dscmdexport.exe for an entire project or dsexport.exe for a single job.
This command will work for exporting just one job. If I have 20 jobs to export, is there any way I can put all these 20 jobs in a file and then pass this file as input to dsexport.exe which will take each job one by one and keep appending into the same dsx file.

Is there any way I can do this in unix? I mean run any command in Unix which will take the DS export into a file?
Aim high
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, you can't "pass the file" to the command but you can craft a script that reads the file and calls the export command for each record / job name. And from what I recall of previous conversations here, it does not support appending output so your script would need to create multiple output files and then concatenate them together as the last 'cleanup' step.

There's no server side export facility that I am aware of, it's all client-based. For the sake of completeness, it is worth noting that 'dsjob' can do job imports but I believe it only handles executables. There's no export capability in it.
-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 »

Version 8.1 (availability announced yesterday) DOES have server-side export and import. More news as it comes to hand.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Something else to look forward to, eh? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Might be this script will help you.

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=HOSTNAME /U=USERID /P=PASSWORD /JOB=%%i PROJECTNAME  c:\export\aa.dsx

 

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


)


    ECHO *** Export completed successfully

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

Post by ray.wurlod »

Possibly not, however, since it's notoriously difficult to run a BAT file on a UNIX system. The logic could be converted into a UNIX shell script however, and one would need dsexport to be available on the server machine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

ray.wurlod wrote:Possibly not, however, since it's notoriously difficult to run a BAT file on a UNIX system. The logic could be converted into a UNIX shell script however, and one would need dsexport to be available on the server machine.
Does this mean the Script that has been posted by DW_USER can not be run on a DS Client machine.

I just tried the dscmdexport in a client machine but it didnt give any outputs. I am not sure why. I used the following statement.

dscmdexport /H devds /U dsadm /P dsadm test "C:\test2.dsx"
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look again at the subject of the thread.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply