Page 2 of 2

Posted: Tue Jan 24, 2006 12:06 am
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

Posted: Tue Jan 24, 2006 12:46 am
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.

Posted: Tue Jan 24, 2006 1:22 am
by kumar_s
Hi Ray,

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

-Kumar

Posted: Tue Jan 24, 2006 2:29 am
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).

Posted: Tue Jan 24, 2006 2:33 am
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

Posted: Tue Jan 24, 2006 2:44 am
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".

Posted: Tue Jan 24, 2006 3:33 am
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

Posted: Tue Jan 24, 2006 3:46 am
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.

Posted: Wed Jan 25, 2006 8:00 am
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

Posted: Wed Jan 25, 2006 8:09 am
by chulett
Where in your code are you telling it to append? Search the forum for the proper usage of the SEEK command.

Posted: Wed Jan 25, 2006 8:11 am
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

Posted: Wed Jan 25, 2006 8:13 am
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.

Posted: Wed Jan 25, 2006 4:28 pm
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.

Posted: Thu Jan 26, 2006 4:50 am
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