Page 1 of 1

Announcement: PyDataStage - DataStage Job control for python

Posted: Wed May 28, 2008 8:23 am
by devnull
Hello all.

I just created and posted a new open source project on SourceForge called PyDataStage. This is a Python extension using the DataStage job API that allows you control jobs and retrieve log information for jobs using Python. It is a work in progress and so far I have only tested this on AIX 5.3, so if you want to try this on other platforms you may have to make changes to the compile and build options in the setup.py script.

The following is an example of how you might use PyDataStage in a Python script:

Code: Select all

import datastage,os,sys
if len(sys.argv) < 3:
    print "usage: run_job.py project job"
    sys.exit(1)

project = sys.argv[1]
job = sys.argv[2]
dsjob = datastage.DSJob(project=project,job=job)
dsjob.params['out_dsname'] = '/home/mabim01/myds.ds'
status = dsjob.run()
logstat,logs = datastage.get_logs(project,job)
for log in logs:
   print log["EVENT_ID"],log["EVENT_TYPE"],log["TIMESTAMP"],log["MESSAGE"]

for log in logs:
        log_detail = datastage.get_log_detail(project,job,log['EVENT_ID'])
        print "event id:",str(log["EVENT_ID"]),log["EVENT_TYPE"],"time:",log["TI
MESTAMP"].strip()
        print log_detail['MESSAGE']

PyDataStage - SourceForge Link

Posted: Wed May 28, 2008 9:15 am
by devnull
Oops. I forgot to include the link.

http://sourceforge.net/projects/pydatastage

Re: PyDataStage - SourceForge Link

Posted: Wed Dec 12, 2012 10:38 am
by haylo75
devnull - Thanks for your work on this. I checked the project site on SourceForge and see no downloads available. Did you end up removing the code from SF?