Counting number of columns used in a job

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
Django
Premium Member
Premium Member
Posts: 20
Joined: Fri Apr 18, 2008 12:16 am

Counting number of columns used in a job

Post by Django »

Hi frnds..

I have a urgent requirement for Identifying number of columns being used in each stage in a server job. Any idea how can this be accomplished ?


Thanks in advance
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Define "number of columns".

What about stage variables, source, target, columns not taken to target etc etc. ?
Django
Premium Member
Premium Member
Posts: 20
Joined: Fri Apr 18, 2008 12:16 am

DSJOBS and DSJOB_OBJECTS or .dsx ???

Post by Django »

DS JOB OBJECTS I believe has all the data in it. But how to get the column count across all stages ?

To get 3 parameters in a job I would say

SELECT
DS_JOBS.NAME AS JOB_NAME,
EVAL DS_JOBOBJECTS."@RECORD<14,1>" ,
EVAL DS_JOBOBJECTS."@RECORD<14,2>" ,
EVAL DS_JOBOBJECTS."@RECORD<14,3>"

FROM DS_JOBS, DS_JOBOBJECTS

WHERE DS_JOBS.NAME LIKE '%#JobsLike#%'
AND DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO
AND DS_JOBOBJECTS.OLETYPE='CJobDefn';

I dont know how to look into the @RECORD to get the column count

The above query I got from DSExchange only...
Django
If a simple dsx project requires such intelligence how much more is required to create this Cosmic System. Who dares to say there is no intelligence behind this creation i.e. no GOD .....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Counting number of columns used in a job

Post by ray.wurlod »

Django wrote:I have a urgent requirement... Any idea how can this be accomplished ?
By signing up with your support provider for priority service, where you will learn the true cost of "urgent".
We don't do "urgent" here. DSXchange is an all-volunteer site whose members post when they can, and only (usually) if they have something pertinent to contribute.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It can be accomplished easily. Simply open the job design in Designer and inspect. The Columns grids in most cases have row numbers. This will make your task easier.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Django
Premium Member
Premium Member
Posts: 20
Joined: Fri Apr 18, 2008 12:16 am

Determining at runtime

Post by Django »

Sorry about using the word 'Urgent'. I understand this is a free service in one sense. But I did pay to become a premium member. I have derived unlimited benefits from this site especially from Ray which is beyond what I have paid. So I agree with Ray.

Now can you please help give a direction as to how to find the number of columns by looking into the datastage repository.

I believe the @RECORD has all the necessary data in it. But how to get that ?. Ray/others please help...

how to adjust the EVAL function to read appropriately ?. What does this EVAL really do ?? and how to format it and how to arrive at the right data... ? any idea ??

EVAL DS_JOBOBJECTS."@RECORD<??>"
Django
If a simple dsx project requires such intelligence how much more is required to create this Cosmic System. Who dares to say there is no intelligence behind this creation i.e. no GOD .....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have at least two problems that I can see.

1. The number of columns is likely to be inconstant across links in a job design, which mitigates against a generic solution to "columns used in a job".

2. Different record types in DS_JOBOBJECTS have different structure, so there is no single expression that would suit. Even different link type entries have different structures*.

So how about you have a much deeper think about what you actually require, and whether there's any useful mechanism for handling that, such as systematic link names.


* They really are clever things, hashed files!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I am truly curious why anyone would have a "need" to "Identify the number of columns being used in each stage in a server job"? To what purpose? What problem are you trying to solve? :?

Perhaps if we attack the problem from a different angle there will be a better solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply