Announcement: PyDataStage - DataStage Job control for python

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
devnull
Premium Member
Premium Member
Posts: 37
Joined: Wed Mar 29, 2006 11:17 am
Location: Minneapolis, MN USA

Announcement: PyDataStage - DataStage Job control for python

Post 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']
Michael Mabin
Minneapolis, MN USA
d3vvnull@com.gmail
(Reverse com and gmail to send email)
devnull
Premium Member
Premium Member
Posts: 37
Joined: Wed Mar 29, 2006 11:17 am
Location: Minneapolis, MN USA

PyDataStage - SourceForge Link

Post by devnull »

Oops. I forgot to include the link.

http://sourceforge.net/projects/pydatastage
Michael Mabin
Minneapolis, MN USA
d3vvnull@com.gmail
(Reverse com and gmail to send email)
haylo75
Premium Member
Premium Member
Posts: 15
Joined: Fri Jul 27, 2012 8:44 am

Re: PyDataStage - SourceForge Link

Post 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?
The middle of every successful project looks like a disaster -- Rosabeth Moss Cantor
Post Reply