Help Need!!!

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Help Need!!!

Post by admin »

For passing to 30 jobs , you need to call 30 jobs with this parameter
(runtime) from the parent job i,e the job where you are storing "Year" in
dataStage Parameter..

For calling 30 jobs from 1 job , you need to call a "after job Unix Shell
script or batch in NT ( Go to the Job Properties of the calling job) which
in turns call DSJOB command.

If further help is needed ,, mail me..

Amitava



----- Original Message -----
From: "Venkat"
To:
Sent: Monday, January 05, 2004 12:45 PM
Subject: Help Need!!!


Hey Gurus,

Happy New Year 2004.

I need your suggestion in DataStage for a logic.

I have one Oracle funcation and it is returning "Year" value everytime. I
want to store this "Year" value in a DataStage parameter itself. Now, After
I store in a DataStage Parameter, I will pass this value to 30jobs. Pls help
in this and Waiting ur Suggestions how to I do this?

Thanx and Regards,
Venkat.
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Help Need!!!

Post by admin »

Hi Venkat,

you cannot change any parameter after the start of the Job. But if you work
with different Jobs there are several oportunities. Even some beside
parameter, depending what you want to do with the "Year". If you only want
to use it to fill a field you can work with stage variables and datastage
functions.

Thought I don't know precisly what you want to do here a general answer.

(1) You have JobA, which is looking for your year. JobA can write this Year
to a seqeuntial file, a hash file or a relational table. Or you can write it
with a dataStage-function to the userstatus of JobA

(2) You have JobB, which task it is to start your 30 Jobs in a
Batchlanguage. JobB can read from userstatus of JobA or the sequential file,
or hash file or relational table, where relational table is not a good
sugestion because it is very difficult (and when not having the right
ODBC-drivers - specialy in UNIX - impossible) to read from relational tables
with batch language.

That's it.

Have a nice new year.

Wolfgang

-----Original Message-----
From: Venkat [mailto:nvkuriseti@rediffmail.com]
Sent: Monday, January 05, 2004 8:15 AM
To: datastage-users@oliver.com
Subject: Help Need!!!


Hey Gurus,

Happy New Year 2004.

I need your suggestion in DataStage for a logic.

I have one Oracle funcation and it is returning "Year" value everytime. I
want to store this "Year" value in a DataStage parameter itself. Now, After
I store in a DataStage Parameter, I will pass this value to 30jobs. Pls help
in this and Waiting ur Suggestions how to I do this?

Thanx and Regards,
Venkat.
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Help Need!!!

Post by admin »

Hi Venkat,
Solution for your question: Create a Job that read or execute
your function and transfer that value to the Hash file. For the Hash file
create a unique key and transfer the value '1'. Then write the following
script


"--------------------------------------- Start of Script
--------------------------------------------------------------------
* Call UtilityHashLookup to get value from Hashfile
Common /HashLookup/ FileHandles(100), FilesOpened

Deffun DSRMessage(A1, A2, A3) Calling "*DataStage*DSR_MESSAGE"

HashTable = 'IN_BUSDATE'
HashKey = '1'
ColumnPosition = ''
PositionReturn = 0

* Determine if we are returning one column or entire row.
If Num(ColumnPosition) then
ColumnPosition = Int(ColumnPosition)
If ColumnPosition > 0 and ColumnPosition Else Ans = Rec
End Else
Ans = DSRMessage("DSTAGE_TRX_I_0010" , "**RECORD NOT FOUND**",
"" )
End
End Else
* Table is not in cache of opened tables, so open it.
Open HashTable To FileHandles(POS) Then
FilesOpened = HashTable
Read Rec From FileHandles(POS), HashKey Else
Rec = DSRMessage("DSTAGE_TRX_I_0010" , "**RECORD NOT
FOUND**", "" )
End
If PositionReturn And Rec DSRMessage("DSTAGE_TRX_I_0010" ,
"**RECORD NOT FOUND**", "" ) Then
Ans = Rec
End Else
Ans = Rec
End
End Else
Rec = DSRMessage("DSTAGE_TRX_I_0011" , "**TABLE NOT FOUND**",
"" )
Ans = Rec
End
End

** ----------------------- END of Script ---------- **

************** This is other jobs which is created to use the date value
as a parameter ***************8


* Setup DelGLHeaderBUSDATE, run it, wait for it to finish, and test for
success
hJob4 = DSAttachJob("DelGLHeaderBUSDATE", DSJ.ERRFATAL)
If NOT(hJob4) Then
Call DSLogFatal("Job Attach Failed: DelGLHeaderBUSDATE",
"JobControl")
Abort
End
ErrCode = DSSetParam(hJob4, "BUSDATE", Rec)
ErrCode = DSRunJob(hJob4, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob4)
Status = DSGetJobInfo(hJob4, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: DelGLHeaderBUSDATE", "JobControl")
End
***************************************************************************
AND so on for other jobs **********************************************

I hope this will help you.

regards.

Thiruma Valavan.

Banque Saudi Fransi
ITD/DEV/DSS.
Office: + 966 1 404 2222 #1739
Mobile: + 966 5 341 7820



"Venkat"
cc:
Subject: Help Need!!!
01/05/2004 10:15
AM
Please respond to
datastage-users






Hey Gurus,

Happy New Year 2004.

I need your suggestion in DataStage for a logic.

I have one Oracle funcation and it is returning "Year" value everytime. I
want to store this "Year" value in a DataStage parameter itself. Now, After
I store in a DataStage Parameter, I will pass this value to 30jobs. Pls
help in this and Waiting ur Suggestions how to I do this?

Thanx and Regards,
Venkat.


Visit us on www.alfransi.com.sa
====== Banque Saudi Fransi - Privacy Notice ======
This message is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any
use of this information by persons or entities other than the intended
recipient is prohibited. If you have received this in error, please
contact the sender and delete the material from your computer. Any
opinions and other information contained in this message that do not
relate to the official business of Banque Saudi Fransi shall be
understood as neither given or endorsed by it.
====== Banque Saudi Fransi - Privacy Notice ======
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Help Need!!!

Post by admin »

Wolfgang had the 'simplest' way to accomplish this with his Option #2 if you
want to use a Sequence job to control your 30 jobs (or a series of jobs) and
not have to write any Batch Control...

Your first DataStage job sources from Oracle and selects (via the stored
function) the year value you want to pass to the other jobs. In the
transformer, make use of the DSSetUserStatus function to pass this value to
the User Status comm area. This job can then write some audit information
out to Oracle or do nothing (write to a junk file, perhaps) depending on
what you deem is appropriate - the important thing is to get the value out
to User Status. Then, any follow-up jobs in the sequencer can have their
'Year' parameter set to the value of Job1.$UserStatus (an option in the
Parameter Helper dialogue box) which the Sequencer will read from the proper
place for you.

-craig

-----Original Message-----
From: Venkat [mailto:nvkuriseti@rediffmail.com]
Sent: Monday, January 05, 2004 12:15 AM
To: datastage-users@oliver.com
Subject: Help Need!!!


Hey Gurus,

Happy New Year 2004.

I need your suggestion in DataStage for a logic.

I have one Oracle funcation and it is returning "Year" value everytime. I
want to store this "Year" value in a DataStage parameter itself. Now, After
I store in a DataStage Parameter, I will pass this value to 30jobs. Pls help
in this and Waiting ur Suggestions how to I do this?

Thanx and Regards,
Venkat.
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Help Need!!!

Post by admin »

Sure you do! There are all kinds of 'DS' functions available, it's just that
they are not directly accessable in a transform. You need to write a custom
routine that 'wrappers' this function and then use your routine in a
transform.

If you go to the 'DSXchange' site at http://www.dsxchange.com and search for
'DSSetUserStatus', you'll find several examples of routines people have
written and ways they've done what you are trying to do. Besides, it's a
great site and a great resource!

-craig

-----Original Message-----
From: Alex Martins [mailto:Alex@proit.com.br]
Sent: Wednesday, January 07, 2004 11:10 AM
To: datastage-users@oliver.com
Subject: RES: Help Need!!!


Dear Mister Craig,
I have no DSSetUserStatus as a function. We are running DataStage 6.0.0.17
Sincerely,
Alex
-----Mensagem original-----
De: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Enviada em: segunda-feira, 5 de janeiro de 2004 12:11
Para: datastage-users@oliver.com
Assunto: RE: Help Need!!!


Wolfgang had the 'simplest' way to accomplish this with his Option #2 if you
want to use a Sequence job to control your 30 jobs (or a series of jobs) and
not have to write any Batch Control...

Your first DataStage job sources from Oracle and selects (via the stored
function) the year value you want to pass to the other jobs. In the
transformer, make use of the DSSetUserStatus function to pass this value to
the User Status comm area. This job can then write some audit information
out to Oracle or do nothing (write to a junk file, perhaps) depending on
what you deem is appropriate - the important thing is to get the value out
to User Status. Then, any follow-up jobs in the sequencer can have their
'Year' parameter set to the value of Job1.$UserStatus (an option in the
Parameter Helper dialogue box) which the Sequencer will read from the proper
place for you.

-craig

-----Original Message-----
From: Venkat [mailto:nvkuriseti@rediffmail.com]
Sent: Monday, January 05, 2004 12:15 AM
To: datastage-users@oliver.com
Subject: Help Need!!!


Hey Gurus,

Happy New Year 2004.

I need your suggestion in DataStage for a logic.

I have one Oracle funcation and it is returning "Year" value everytime. I
want to store this "Year" value in a DataStage parameter itself. Now, After
I store in a DataStage Parameter, I will pass this value to 30jobs. Pls help
in this and Waiting ur Suggestions how to I do this?

Thanx and Regards,
Venkat.
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
Locked