Page 1 of 1

Viewing the DSSetUserStatus Value

Posted: Fri Aug 05, 2005 6:52 am
by Vinodanand
Hi,

I am using a routine in my sequencer which returns a value for the user status. i normally view the user status in the HP unix box thru the following command ...

/dsadm/Ascential/DataStage/DSEngine/bin/dsjob -run -mode NORMAL -warn 0 -wait -param DSN=dsomig -param UserName=miguat -param Password=miguat -param Schema=MIGUAT -param RunID=466 -param HashFilePath=/chshttp/dsoweb/group3/mig-uat/clients/amtk/eligibility/logs/ -userstatus dsowebmigtst EligPXiTollGateSeq.466

Can i view this USER STATUS value in DataStage itself...

Posted: Fri Aug 05, 2005 8:19 am
by Sainath.Srinivasan
Search for it. There are loads of posts describing the method.

Posted: Fri Aug 05, 2005 7:11 pm
by ray.wurlod
The on-line help will tell you the answer. Once you've found the DSSetUserStatus() function in Help, you can read that the value can be retrieved using the DSGetJobInfo() function.
It's also retrievable as the $UserStatus variable in downstream job activities in job sequences.

Thnx Ray but ...

Posted: Mon Aug 08, 2005 6:32 am
by Vinodanand
Can i view the UserStatus value i've set in the log of the corresponding sequencer......i.e the sequencer with which it is associated...

Posted: Mon Aug 08, 2005 6:34 pm
by ray.wurlod
You can retrieve it and work with it (for example in a downstream Nested Condition activity or Job activity).
I don't believe there's any way to view something in a job sequence, but would be happy to be proved wrong. Indirectly, I guess, you could (in 7.5 and later) invoke an Execute Command activity to echo the $UserStatus value into a text file (on the server) for inspection.

Posted: Tue Aug 09, 2005 5:02 am
by roy
Hi,
You can write a routine for that.
Here's something I wrote recently:
this routine has a single argument named jobName.
It can be tested to view the user status of a job.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H

      If jobName <> DSJobName Then
         hJob = DSAttachJob(jobName,DSJ.ERRNONE)
         Ans = DSGetJobInfo(hJob,DSJ.USERSTATUS)
         err = DSDetachJob(hJob)
      End
      Else
         Ans = "Can't Attach to Myself"
      End
***
adding proper exception handling is advised
this is only an example for implementation

IHTH

Thx ROy

Posted: Tue Aug 09, 2005 10:03 pm
by Vinodanand
Hey thnx mate i'll just try this out and come bak to u if i've got any issues....



roy wrote:Hi,
You can write a routine for that.
Here's something I wrote recently:
this routine has a single argument named jobName.
It can be tested to view the user status of a job.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H

      If jobName <> DSJobName Then
         hJob = DSAttachJob(jobName,DSJ.ERRNONE)
         Ans = DSGetJobInfo(hJob,DSJ.USERSTATUS)
         err = DSDetachJob(hJob)
      End
      Else
         Ans = "Can't Attach to Myself"
      End
***
adding proper exception handling is advised
this is only an example for implementation

IHTH