Page 1 of 1

Export routines, transforms etc. from code

Posted: Wed Jul 28, 2004 6:30 am
by TBartfai
Hello!

I would like to write a client program, that exports routines, transforms etc. from code. I am using Visual Basic. I have added DataStage Repository interface. I am able to export jobs with ExportNoForm. But this method does not exist for stage types, routines etc. I found an interface called CExporterAPI. I can add an id with AddId, but i can't export with Run, because i get an error message Object variable or with block variable not set, the source is VMDataStage.

My code snipplet is here:

Set oF = New VMDataStage.CExporterAPI
bAddResult = oF.AddId(oRoutines.ObjectType, "RoutineName")
bRunResult = oF.Run("c:\RoutineName.dsx")
Set oF = Nothing

Any suggestion or souliton (even in other languages) would be appreciated.

Thank you,
Tamas

Creating Export via command line

Posted: Wed Jul 28, 2004 6:51 am
by hassers
On a related issue,
we had difficulty running DS Manager to complete an export of project.
We were informed of the dos command dscmdexport. Please note there can be issues if run whilst objects are locked by users.


dscmdexport command

The dscmdexport is as follows:
dscmdexport /H=hostname /U=username /P=password /O=omitflag project
pathname /V

The arguments are as follows:
Importing, Exporting, and Packaging Jobs 14-17
* hostname. Specifies the DataStage Server from which the file will be
exported.
* username. The user name to use for connecting to the DataStage
Server.
* password. The user's password.
* omitflag. Set this to 1 to omit the username and password (only
possible if you are connected to the DataStage Server via LAN
Manager).
* project. Specify the project to export the components from.
* pathname. The file to which to export.
* V. Use this flag to switch the verbose option on.

For example, the following command exports the project dstage2 from the
R101 to the file dstage2.dsx:

dscmdexport /H=R101 /O=1 dstage2 C:/scratch/dstage2.dsx

Messages from the export are sent to the console by default, but can be
redirected to a file using '>', for example:
dscmdexport /H=R101 /O=1 dstage99
c:/scratch/project99.dsx /V > c:/scratch/exportlog

You can simply type dscmdexport at the command prompt to get help
on the command options.

Re: Creating Export via command line

Posted: Wed Jul 28, 2004 6:55 am
by TBartfai
Unfortunately with this you can export the whole project. I need to export only specified routines or transforms and so on :(

Posted: Wed Jul 28, 2004 2:43 pm
by ray.wurlod
I seriously doubt that CExporterAPI is the whole story; in particular, even if it is an appropriate source of objects, what are these objects and what are the properties and methods associated with them?
And what is the format of the generated export?

You may (or may not) find it useful to switch on server-side tracing, do an export from Manager of selected components, disable server-side tracing, then inspect the trace file. This will show you the communication between Manager and the DataStage server. I cannot promise that CExportedAPI uses the same techniques however.

I'm happy enough to use the Export capabilities in Manager. :wink:
I see no value in writing my own.