I undertook to advise of a generic way to set the user status value within a job, based on a recent project. In this example the job design is:
ODBC ----> Transformer ----> SeqFile
The ODBC stage executes a stored procedure (in SQL Server as it happens) that inserts a new row in a table, generating a guid (guaranteed unique id) value and returning this value and the columns from the row as a recordset. Subsequent jobs need to update this row; it's a row in a control file managing process metadata and restartability.
All columns are transmitted to the Transformer stage and are passed unchanged to the sequential file. In addition, the unique id (as a VarChar(36) for anyone who needs to know) is passed to an additional output column, the derivation for which is:
DSSetUserStatus(InputLink.TableID)
This column then goes into the output file as the return value of the DSSetUserStatus() function, which in my experience is always 0.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
DSSetUserStatus in Job
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray,
I don't realy yet understand your Problem, so I write something about the function you use, where I am assuming, that you know this details already.
Let us assume you have a Job1 and a Job2.
In Job1 you have anywhere the function DSSetUserStatus("It is a nice day")
When you have in Job2 for example the following code:
JobHandle = DSAttachJob("Job1", DSJ.ERRFATAL)
Wert = DSGetJobInfo(JobHandle,DSJ.USERSTATUS)
ErrCode = DSDetachJob(JobHandle)
you can use the String "It is a nice day" in Job2 for whatever you want.
By this you can pass a string from one job to another.
(to "another job" and not back to the same job!!!)
What you cannot do is:
- Make a DSAttachJob("Job1", DSJ.ERRFATAL) within Job1
When you make a
Wert=DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS)
after Job hast started then you get nothing.
When you make a
Wert=DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS)
after the
Call DSSetUserStatus("It is a nice day")
you will get
"It is a nice day" or whatever string you put into it.
That are the rules of DSSetUserStatus.
What you are doing else in the Job doesn't matter to this.
Hope I could have helped you a bit. If not please explain a bit more about your problem.
Wolfgang
I don't realy yet understand your Problem, so I write something about the function you use, where I am assuming, that you know this details already.
Let us assume you have a Job1 and a Job2.
In Job1 you have anywhere the function DSSetUserStatus("It is a nice day")
When you have in Job2 for example the following code:
JobHandle = DSAttachJob("Job1", DSJ.ERRFATAL)
Wert = DSGetJobInfo(JobHandle,DSJ.USERSTATUS)
ErrCode = DSDetachJob(JobHandle)
you can use the String "It is a nice day" in Job2 for whatever you want.
By this you can pass a string from one job to another.
(to "another job" and not back to the same job!!!)
What you cannot do is:
- Make a DSAttachJob("Job1", DSJ.ERRFATAL) within Job1
When you make a
Wert=DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS)
after Job hast started then you get nothing.
When you make a
Wert=DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS)
after the
Call DSSetUserStatus("It is a nice day")
you will get
"It is a nice day" or whatever string you put into it.
That are the rules of DSSetUserStatus.
What you are doing else in the Job doesn't matter to this.
Hope I could have helped you a bit. If not please explain a bit more about your problem.
Wolfgang
I have tried your solution to this problem, using DSSetUserStatus(INPUT.FIELD) in the derivation of one of my columns in a transformer but it keeps showing an error.
I am using DS v.7, AIX 5.2
in the derivation section of my output column I write:
DSSetUserStatus (Source.Value)
and it is always red.
I have tried
DSSetUserStatus ("Test") but this doesn't work either.
Is this a problem with version 7 or have I misunderstood something.
Regards, Nick.
I am using DS v.7, AIX 5.2
in the derivation section of my output column I write:
DSSetUserStatus (Source.Value)
and it is always red.
I have tried
DSSetUserStatus ("Test") but this doesn't work either.
Is this a problem with version 7 or have I misunderstood something.
Regards, Nick.
Regards,
Nick.
Nick.
Hi,
I'm not sure Ray inteded to ask anything here, or it would have been obvious (what the question is).
by the way if you have no need for the actual value in the seq file why not direct it to the NUL virtual file be it in unix (/dev/null) or windows (forgot the syntax).
I'm sure ray knows bettert then most of us how to get what he wants using DS
I'm not sure Ray inteded to ask anything here, or it would have been obvious (what the question is).
by the way if you have no need for the actual value in the seq file why not direct it to the NUL virtual file be it in unix (/dev/null) or windows (forgot the syntax).
I'm sure ray knows bettert then most of us how to get what he wants using DS
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org