no of process ids

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

kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Ray,

Thanks for your reply.
I could also find the same sort of explaination of you in some previous post. But May i know what way we can acheive this from administrator client. Because if i issue the first command the window goes blank and i cannot execute the next commnad to find the list.
Say
DIVERT.OUT ON &UFD& Capture.txt
SELECT * FROM DS_JOBS
DIVERT.OUT OFF

So i could not execute SELECT * FROM DS_JOBS after the first statement.

Is there any way i can concatinate all the commands in a single line like
DIVERT.OUT ON &UFD& Capture.txt; SELECT * FROM DS_JOBS;

Even this is not working. :oops:
May i now where this all been documented? Even i could not find this in universe pdf.

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

Post by ray.wurlod »

Yes, stdout got diverted away from the client connection. I usually only use this command in a telnet session. You could build them into a "paragraph" in a telnet session, then execute tha paragraph from the Administrator client.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Ray,

Paragraph - you ment here is it somthing like any shell script which can be invoked from client?

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

Post by ray.wurlod »

A "paragraph" is the "UniVerse" (DataStage) equivalent of a shell script. It must be executed within that environment (hence from the Administrator client).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

ray.wurlod wrote:A "paragraph" is the "UniVerse" (DataStage) equivalent of a shell script. It must be executed within that environment (hence from the Administrator client).
Could you shed some light on the process to creating "paragraph".

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

Post by ray.wurlod »

From the Administrator client select one or more contiguous commands from the history pane and click Save. You will be prompted for a name under which the paragraph will be saved.

From the TCL prompt use the .S name n m command to save a contiguous set of commands from the command history stack.

Use the line editor (ED) to create a paragraph. The first line must begin with the letters "PA".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,

May i know where will the file get strored. I could not find under project directry or in Client machine.
:cry:
-Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This is not stored as a file, but as a record in the VOC hashed file. It is not visible or accessible from UNIX.
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post by kcshankar »

Hi Ray,
For any job, no of Active stages in a job = Total no of process -1(Controller) correct me if Iam wrong.

Only sometimes.
If your design has two active stages directly linked (for instance two Transformer stages) they will be executed in one process.
However, if you have inter-process row buffering enabled it will enforce execution of the adjacent active stages in separate processes.
What you have called the "controller" runs DSD.RUN in server jobs. The DSD.
Stage Run routine executes the code generated by compiling a Transformer stage.
I want to find the active stages for about 10 jobs.
I wrote a routine to find the Active stages in a particular job.

Code: Select all

$IFNDEF JOBCONTROL.H 
$INCLUDE DSINCLUDE JOBCONTROL.H 
$ENDIF 
ActiveStages = DSGetJobInfo (DSJ.ME, DSJ.STAGELIST)
ValidOpen = @FALSE 
OPENSEQ "/home/user6/active_stages.txt" TO XXXXX Then
Call DSLogInfo ("Done","Done") 
End
Else
Call DSLogInfo ("Can't Open","Can't Open")
End 
WRITESEQ ActiveStages TO XXXXX else 
Call DSLogFatal ("Could not update the file: ":Target, "OutputFile") 
End 

WEOFSEQ XXXXX 
ErrorCode = 0 ;* set to non-zero to stop the stage/job 
I called this routine in the transformer of the First job and got the output in Target file.
But when I execute the same routine for the second job the Target file is not updated/the value of the second job doesn't append.
I want the values to append.

Anything wrong with the routine.....?

regards
kcs
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Where in your code are you telling it to append? Search the forum for the proper usage of the SEEK command.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

HI,

You can also try with WriteSeqF Function, which writes a new line to a file that is open for sequential processing,
advances a pointer to the next position in the file, and saves the file to
disk.

-Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The way you have the BASIC coded will open and overwrite (potentially only partially overwrite) the sequential file. The statement "WEOFSEQ {FilePtrVariable}" will truncate a file at the current position, and the statement "SEEK {FilePtrVariable},0,2" to position the file pointer to offset 0 relative to the current end of file.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

kumar_s wrote:HI,

You can also try with WriteSeqF Function, which writes a new line to a file that is open for sequential processing,
advances a pointer to the next position in the file, and saves the file to
disk.

-Kumar
Not if you WRITESEQF straight after OPENSEQ, with the file pointer positioned at beginning-of-file. It will just overwrite the existing contents.

The "F" form simply forces the WRITESEQF statement to wait until notification that the physical write has occurred has been received.

The requirement here is a SEEK statement to position to end-of-file before writing. Another requirement is to handle the possibility that the file is open but does not exist (the ELSE clause of OPENSEQ is taken and STATUS() returns 0 in this case). This does not occur in the previous code, though does occur in other examples posted earlier. Search is your friend.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post by kcshankar »

Hi Ray,ArndW,Kumar,Craig
Thanks for giving valuable suggestions.

I altered the routine and it is working fine now.

*------------Routine to find active stages----------------*
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
ActiveStages = DSGetJobInfo(DSJ.ME, DSJ.STAGELIST)
ValidOpen = @FALSE
OPENSEQ "/home/user6/active_passive_stages.txt" TO XXXXX Then
Call DSLogInfo("Done","Done")
end
else
Call DSLogInfo("Can't Open","Can't Open")
End
SEEK XXXXX ,0,2 else null
WRITESEQF ActiveStages TO XXXXX else
Call DSLogFatal("Could not update the file: ":Target, "OutputFile")
End
ErrorCode = 0 ;* set this to non-zero to stop the stage/job


regards
kcs
Post Reply