Page 1 of 1

export and import job on UNIX

Posted: Sun Oct 05, 2008 11:17 pm
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

Posted: Sun Oct 05, 2008 11:40 pm
by ray.wurlod
dsjob has an -import option but it only imports job executables as far as I am aware.

Posted: Tue Oct 28, 2008 4:49 pm
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.

Posted: Tue Oct 28, 2008 4:59 pm
by chulett
The 'DS Manager' is a client tool. Windows, not UNIX.

Posted: Tue Oct 28, 2008 5:06 pm
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?

Posted: Tue Oct 28, 2008 10:31 pm
by chulett
You wouldn't call the Manager but rather dscmdexport.exe for an entire project or dsexport.exe for a single job.

Hmm...

Posted: Tue Oct 28, 2008 10:48 pm
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.

Posted: Tue Oct 28, 2008 11:11 pm
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?

Posted: Wed Oct 29, 2008 6:08 am
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.

Posted: Wed Oct 29, 2008 8:50 am
by ray.wurlod
Version 8.1 (availability announced yesterday) DOES have server-side export and import. More news as it comes to hand.

Posted: Wed Oct 29, 2008 9:12 am
by chulett
Something else to look forward to, eh? :wink:

Posted: Wed Oct 29, 2008 10:05 pm
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


Posted: Thu Oct 30, 2008 9:05 am
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.

Posted: Thu Oct 30, 2008 3:02 pm
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"

Posted: Fri Oct 31, 2008 8:48 am
by ray.wurlod
Look again at the subject of the thread.