How to get a runable job after a 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

Post Reply
asrnl
Premium Member
Premium Member
Posts: 15
Joined: Thu Dec 11, 2008 6:16 am

How to get a runable job after a export?

Post by asrnl »

How to get a runable job after a export?

I have a server job exported but it is not runable, i must first compile this job before i can run it!

is there a option when i export the job so that it wil be a runable job so i don't have to compile it?

I am using dsexportcmd.exe to export.

Please advise
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: How to get a runable job after a export?

Post by Pagadrai »

asrnl wrote: I am using dsexportcmd.exe to export.
Hi,
Iam not sure about the syntax and options to specify for dsexportcmd.exe.
But check if you can export 'job executables' and 'program sources' along with the job design.

Also, if any transforms, routines are used in that job, you need to include them too.

DS Experts here can add if I have missed anything.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Here is the syntax we use:

Code: Select all

SET DsBaseDir=C:\Progra~1\Ascential\DataStage7.5.1
SET DsExportCmd=%DsBaseDir%\DsExport.exe

%DsExportCmd% /H=%ExportHost% /U=%ExportUser% /P=%ExportPassword% /JOB=%%i %ExportProject% %%i.dsx >> %LogFileName%
Where %%i is fed from a list of job names. Each is exported to its own dsx file of the same name as the job.


You need to import next. Here is the syntax for importing job.

Code: Select all

SET DsImportCmd=%DsBaseDir%\dsimport.exe
%DsImportCmd% /H=%ImportHost% /U=%ImportUser% /P=%ImportPassword% %ImportProject% %ProjectDir%\%%i.dsx >> %LogFileName%
Here is the syntax for compiling job.

Code: Select all

SET DsCompileCmd=%DsBaseDir%\dscc.exe
%DsCompileCmd% /h %ImportHost% /u %ImportUser% /p %ImportPassword% %ImportProject% /j %%i /f >> %LogFileName%
You need to compile the job to make it runnable.
Mamu Kim
asrnl
Premium Member
Premium Member
Posts: 15
Joined: Thu Dec 11, 2008 6:16 am

Post by asrnl »

KDuke Thanks for youre reply, but it's still not working.
I have the following syntax:
for /F "tokens=1" %%i in (%DsxList%) do (

ECHO Importing %%i to Project: %Project% on Host: %Host%

echo %DSImportCmd% /H=%Host% /U=%User% /P=%Password% %Project% %ProjectDir%\%%i >> %LogFileName%
%DSImportCmd% /H=%Host% /U=%User% /P=%Password% %Project% %ProjectDir%\%%i >> %LogFileName%
%DsCompileCmd% /H=%Host% /U=%User% /P=%Password% %Project% %ProjectDir% /j * /f >> %LogFileName%
IF NOT %ERRORLEVEL%==0 GOTO ProjFail

ECHO. >> %LogFileName%
ECHO *** Completed Import for Project: %Project% on Host: %Host% >> %LogFileName%
ECHO from File: %ProjectDir%\%%i >> %LogFileName%
ECHO. >> %LogFileName%
)

GOTO EXITPT

As you can see i am using youre DataStageImport.bat script iam getting the following error:
C:\Progra~1\Ascential\DataStage\dsimport.exe /H=servername /U=login /P=password projectname Z:\Afdeling\Rollen\Temp\Project\\GetMIJobLog.dsx
Unrecognized argument '/H=servername'.

Usage: dscc [@argfile] [/?] /h <value> [/o] [/u <value>] [/p <value>] <project> [/j <value>] [/r <value>] [/f] [/ouc] [/rd <value>] [/rt <value>] [/mful <value>] [/mfcgb <value>]


Do i have to make a seperate script to compile? Or can i put it in the import script?


kduke wrote:Here is the syntax we use:

Code: Select all

SET DsBaseDir=C:\Progra~1\Ascential\DataStage7.5.1
SET DsExportCmd=%DsBaseDir%\DsExport.exe

%DsExportCmd% /H=%ExportHost% /U=%ExportUser% /P=%ExportPassword% /JOB=%%i %ExportProject% %%i.dsx >> %LogFileName%
Where %%i is fed from a list of job names. Each is exported to its own dsx file of the same name as the job.


You need to import next. Here is the syntax for importing job.

Code: Select all

SET DsImportCmd=%DsBaseDir%\dsimport.exe
%DsImportCmd% /H=%ImportHost% /U=%ImportUser% /P=%ImportPassword% %ImportProject% %ProjectDir%\%%i.dsx >> %LogFileName%
Here is the syntax for compiling job.

Code: Select all

SET DsCompileCmd=%DsBaseDir%\dscc.exe
%DsCompileCmd% /h %ImportHost% /u %ImportUser% /p %ImportPassword% %ImportProject% /j %%i /f >> %LogFileName%
You need to compile the job to make it runnable.
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post by pavans »

While Exporting the Job, You can check Job Executables and select the job from the list. Once you import, you will see the job in compiled state.
Thanks,
Pavan
asrnl
Premium Member
Premium Member
Posts: 15
Joined: Thu Dec 11, 2008 6:16 am

Post by asrnl »

pavans thanks for the reply, but i don't use the manager to export. i am using the export script from Duke.
pavans wrote:While Exporting the Job, You can check Job Executables and select the job from the list. Once you import, you will see the job in compiled state.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

dscc.exe needs job name not dsx name. It maybe complaing about your job name. We use dscc.exe exactly as posted above and it works fine.
Mamu Kim
Post Reply