Page 1 of 1

How to get a runable job after a export?

Posted: Fri Apr 24, 2009 6:43 am
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

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

Posted: Fri Apr 24, 2009 7:06 am
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.

Posted: Fri Apr 24, 2009 9:50 am
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.

Posted: Tue Apr 28, 2009 1:48 am
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.

Posted: Tue Apr 28, 2009 4:13 am
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.

Posted: Tue Apr 28, 2009 4:58 am
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.

Posted: Tue Apr 28, 2009 10:06 am
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.