Viewing the DSSetUserStatus Value

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
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Viewing the DSSetUserStatus Value

Post 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...
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Search for it. There are loads of posts describing the method.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Thnx Ray but ...

Post 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...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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
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
Image
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Thx ROy

Post 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
Post Reply