How to use perl to query info from DS repository

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
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

How to use perl to query info from DS repository

Post by mchaves »

Hi there,

Has anyone ever queried the ds repository using perl? If so, can you provide an example ?

Thanks,
Melquior
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The DataStage Repository is a database. Like any other database it must be queried using a query language (for example SQL) within its own environment.

You can wrap this in Perl or any other scripting language, but you still need to know how to construct the query.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

Post by mchaves »

Hi Ray,

Thanks for reply. Mate, I know that ds repository is a database but I couldn't find any information on how to pull data from it. Do you mind elaborating a bit more on it? Just tell me how setup a connection to it like odbc or something.

Cheers,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The easiest way is to use the dssh or uv command in the project directory. This can take a double-quoted command (query) as its command line argument.

You may need to have set environment variables first by sourcing the dsenv script.

Code: Select all

. $DSHOME/dsenv
$DSHOME/bin/dssh "SELECT NAME FMT '32L', CATEGORY FMT '32L' FROM DS_JOBS ORDER BY 1;"
Wrap that in Perl, capture the output, and parse it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
melquior
Participant
Posts: 1
Joined: Sun Jan 23, 2005 3:43 am

Post by melquior »

Thanks Ray.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Same person, new nick? That's one way to get to 10,000 users! :twisted:
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