Passing parameter to Oconv function

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
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Passing parameter to Oconv function

Post by yaminids »

Friends,

Is there a way to pass parameter to Oconv function?

My current assignment requires me to do the following
1) read the start_date and end_date from log table and pass them as variables to the next job
2) Select data from source based on the values provided by above step (1)
3) Update the log table to set the end_date

I used $USERSTATUS to pass the variables to second job. My question is, what would be the best way to update the log table by passing the end_date as parameter

Thanks a bunch in advance
Yamini
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How do you compute the new end_date that is to be written back to the table and how does OCONV() come into play?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer is "yes" but you should answer Arnd's questions so we have a better idea what is going on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Post by yaminids »

There are 3 jobs in the Sequence which are executed sequentially. end_date is the system date when the first job started. We would like to persist the end_date throughout the 3 jobs. In the next cycle we will use the end_date as the start_date for the jobs and so on. The jobs are executed 4-5 times a day

-Job--|| ----------- Start_date------ || End_date
Job-1|| End_date from the log table ||Get Sysdate & save it in variable DT
Job-2|| End_date from the log table|| DT
Job-3|| End_date from the log table|| DT

Both start_date and end_date will be used in the WHERE clause. After the completion of Job-3 we would like update the log table to set the end_date stored in variable DT

I thought I could use Oconv to convert the date stored in the variable before updating the log table. Is there a better way to update the table with the date value stored in a variable

Thanks
Yamini

P.S.All the dates, mentioned above, include timestamp
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Post by yaminids »

Re-posting as I wasn't sure if you guys got my response
There are 3 jobs in the Sequence which are executed sequentially. end_date is the system date when the first job started. We would like to persist the end_date throughout the 3 jobs. In the next cycle we will use the end_date as the start_date for the jobs and so on. The jobs are executed 4-5 times a day

-Job--|| ----------- Start_date------ || End_date
Job-1 || End_date from the log table || Get Sysdate & save it in variable DT
Job-2 || End_date from the log table || DT
Job-3 || End_date from the log table || DT

Both start_date and end_date will be used in the WHERE clause. After the completion of Job-3 we would like update the log table to set the end_date stored in variable DT

I thought I could use Oconv to convert the date stored in the variable before updating the log table. Is there a better way to update the table with the date value stored in a variable

Thanks
Yamini

P.S. All the dates, mentioned above, include timestamp
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Job1 can save the start date and end date in that job's user status area.
When the sequence requests the run of Job2, the start date and end date can be supplied from Job1's user status area ($UserStatus activity variable). Likewise Job2 can be supplied with end date from Job1's user status area ($UserStatus activity variable).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Post by yaminids »

Ray,

I was able to design the jobs to store and pass the variables using UserStatus based on the information you provided in a different post.

How can I use the end_date in Job2 to update the log table? Do I have to convert the date into DataStage internal format before updating the field in the database?

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

Post by ray.wurlod »

That depends on what stage type you're using. Use a Transformer stage to assign the value of the job parameter to a column. Apply Oconv() if appropriate.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply