Export routines, transforms etc. from code

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
TBartfai
Premium Member
Premium Member
Posts: 15
Joined: Wed Jul 28, 2004 5:26 am

Export routines, transforms etc. from code

Post 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
hassers
Participant
Posts: 14
Joined: Thu Dec 11, 2003 11:34 am
Location: Chester, UK

Creating Export via command line

Post 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.
Thanks

Steve
TBartfai
Premium Member
Premium Member
Posts: 15
Joined: Wed Jul 28, 2004 5:26 am

Re: Creating Export via command line

Post by TBartfai »

Unfortunately with this you can export the whole project. I need to export only specified routines or transforms and so on :(
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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