Number of Transformers
Moderators: chulett, rschirm, roy
Number of Transformers
Understand that no of transformers in the project can be determined by querying UNIVERSE tables. please let me know the below query will provide that.
select count(*) from DS_TRANSFORMS and this command needs to be executed from Administrator client.
Is there any alternative better way of identifying this?
Thanks
Elavenil
select count(*) from DS_TRANSFORMS and this command needs to be executed from Administrator client.
Is there any alternative better way of identifying this?
Thanks
Elavenil
How about in the Designer. Go to "Stage Types" and do a find of where-used to get a list of all jobs that use that stage type.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Thanks Arnd.
The way that you recommended provides no of jobs on which transformers used. For eg. more than one transformer used in the same job, the job is listed.
What i need is to get no of transformers used in the project.
Is there any best way of getting no of transformers in the project?
Regards
Elavenil
The way that you recommended provides no of jobs on which transformers used. For eg. more than one transformer used in the same job, the job is listed.
What i need is to get no of transformers used in the project.
Is there any best way of getting no of transformers in the project?
Regards
Elavenil
the "DS_TRANSFORMS" file does not contain the information you want.
I would suggest using the (documented) BASIC API Calls rather than trying to work with the DataStage internal (undocumented) hashed files.
I would suggest using the (documented) BASIC API Calls rather than trying to work with the DataStage internal (undocumented) hashed files.
Code: Select all
Select all Projects, for each project:
Select all Jobs, for each Job:
Select all stages, for each Stage "CTransformerStage" (assuming only PX transform stages are of interest)
--> show the Project.Job.Stagename
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DS_TRANSFORMS contains Transforms (pre-stored expressions), not Transformer stages. Transformer stages are recorded in DS_JOBOBJECTS.
But I agree with Arnd's advice that the API is a smarter way to retrieve the information - we can't guarantee that DS_JOBOBJECTS will be the storage mechanism in future versions.
But I agree with Arnd's advice that the API is a smarter way to retrieve the information - we can't guarantee that DS_JOBOBJECTS will be the storage mechanism in future versions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Now is a great time to start learning! You create server routines within DataStage Designer.
Documentation about the API functions is to be found in the DataStage BASIC manual.
Documentation about the API functions is to be found in the DataStage BASIC manual.
Code: Select all
FUNCTION CountTransformerStages(Arg1)
* Return list of jobname|stagename pairs for Transformer stages.
$INCLUDE DSINCLUDE JOBINCLUDE.H
Ans = ""
* Generate sorted list of job names.
Perform 'SSELECT DS_JOBS WITH NAME LIKE "1A0X"'
* Process list of job names one job name at a time.
Loop
While ReadNext JobName
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
StageList = DSGetJobInfo(hJob, DSJ.STAGELIST)
* Produce list of stage names and process these one at a time.
Convert "," To @FM In StageList
Loop
Remove StageName From StageList Setting MoreStages
StageType = DSGetStageInfo(hJob, StageName, DSJ.STAGETYPE)
If StageType = "Transformer"
Then
Ans<-1> = JobName : "|", StageName
End
While MoreStages
Repeat
Repeat
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,
The recommended code was modified slightly and transformer stage for the 1st job is written in the file. But it did not go to next job and i think i am missing something.
Could someone help to get transformer stage names for all jobs in the project?
Code is pasted below.
Appreciate expertise help on this.
Regards
Elavenil
The recommended code was modified slightly and transformer stage for the 1st job is written in the file. But it did not go to next job and i think i am missing something.
Could someone help to get transformer stage names for all jobs in the project?
Code is pasted below.
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = ""
* Generate sorted list of job names.
Perform 'SSELECT DS_JOBS WITH NAME LIKE "1A0X"'
* Process list of job names one job name at a time.
AllJobsRead = @False
OpenSeq 'num_of_xfms.txt' to InputFile Else
Call DSLogInfo("File Open", "Could not Open this file")
End
Loop
ReadNext JobName Else AllJobsRead = @True
Until AllJobsRead Do
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
StageList = DSGetJobInfo(hJob, DSJ.STAGELIST)
MoreStages = @False
* Produce list of stage names and process these one at a time.
Convert "," To @FM In StageList
Loop
Remove StageName From StageList Setting MoreStages
StageType = DSGetStageInfo(hJob, StageName, DSJ.STAGETYPE)
If StageType = "CTransformerStage"
Then
Ans = JobName : "|": StageName
WriteSeq Ans to InputFile Else
Call DSLogInfo("File Write", "Error in writing into the file")
End
End
Until MoreStages
Repeat
Repeat
Close InputFile
Ans = '0'
RETURN(Ans)
Regards
Elavenil
I'm not sure about the next loop until constructs. Can you add some "CALL DSLogWarning('Inside xxxx loop with value yyyyy','')" type of debugging code to see why you aren't looping?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Thanks ArndW for your response.
Tried calling DSLogInfo to see where it is failing. Once the both loops are completed for 1st job, ReadNext does not get the next job name in JobName variable.
Tried using ReadList as well and ReadList loads all jobs in a list but ReadNext did not go to next job name.
Any inputs to resolve this is highly appreciated.
Regards
Elavenil
Tried calling DSLogInfo to see where it is failing. Once the both loops are completed for 1st job, ReadNext does not get the next job name in JobName variable.
Tried using ReadList as well and ReadList loads all jobs in a list but ReadNext did not go to next job name.
Any inputs to resolve this is highly appreciated.
Regards
Elavenil
Here a bare-bones loop structure:
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = ""
* Generate sorted list of job names.
Perform 'SSELECT DS_JOBS WITH NAME LIKE "1A0X"'
* Read list to memory
READLIST JobNames FROM 0 ELSE JobNames = ''
CONVERT @VM TO @FM IN JobNames
REMOVE JobName FROM JobNames SETTING JobNameType
LOOP UNTIL JobNameType = 0
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
StageList = DSGetJobInfo(hJob, DSJ.STAGELIST)
Convert "," To @FM In StageList
REMOVE StageName FROM StageList SETTING StageNameType
LOOP UNTIL StageNameType = 0
print JobName:'.':StageName
REMOVE StageName FROM StageList SETTING StageNameType
REPEAT
Dummy = DSDetachJob(hJob)
REMOVE JobName FROM JobNames SETTING JobNameType
REPEAT
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>