This works for me.

Here is the test STAX job that I am using:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <defaultcall function="test"/>

  <function name="test">

    <sequence>

      <stafcmd>
        <location>'local'</location>
        <service>'var'</service>
        <request>'SET SHARED VAR SharedVar1=test'</request>
      </stafcmd>

      <return>'RC=%s, Result=%s' % (RC, STAFResult)</return>

    </sequence>

  </function>

</stax>
 
So, note that it is setting a shared var named SharedVar1 to the value 
"test".  I will be running this STAX job on remote system "staf1b".

Before running the STAX job:

$ staf staf1b var list shared
Response
--------
 
Then on staf1b I run the STAX job:

# staf local stax execute file /usr/local/staf/setsharedvar.xml wait 
returnresult
Response
--------
{
  Job ID         : 1
  Start Date-Time: 20090827-09:53:23
  End Date-Time  : 20090827-09:53:23
  Status         : Normal
  Result         : RC=0, Result=
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}

Then I run the VAR LIST and VAR GET requests:

$ staf staf1b var list shared
Response
--------
SharedVar1: test

$ staf staf1b var Get Shared Var SharedVar1
Response
--------
test

And they work as expected.  Can you provide a detailed scenario to 
reproduce what you are seeing?

Thanks, 
David 

David Bender 
STAF/STAX Development 
IBM Software Group, WPLC 
 
11501 Burnet Rd. 
Bldg. 903-5B002 
Austin, TX 78758-3400 
 
Phone (T/L): 1-512-286-5315 (363-5315) 
ITN: 23635315 
Email: bda...@us.ibm.com 
 





Abnish Kumar <abnish.jmi.mc...@gmail.com> 
08/27/2009 08:06 AM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] Problem in accessing the value of shared variable  created 
through STAX Job







I have created some shared variable on test server (ABNISH) through the 
STAX Job running on remote machine (ABC). To check the list of the entire 
shared variables, I have used the command on the console of test server 
(ABNISH):
 
STAF ABNISH Var List Shared
 
The above command is displaying the entire shared variable names (which 
include the variables created through STAX Job) with their values.
 
Now, I am trying to extract the value of some of shared variables created 
by STAX Job through writing the command on console of test server 
(ABNISH):
 
STAF ABNISH Var Get Shared Var SharedVar1
 
Then the error with RC:13 has been returned.
 
When I tried to create the shared variable with same name (with different 
value) through the command on console of test server (ABNISH):
 
STAF ABNISH Var Set Shared Var SharedVar1
 
Then the shared variable has been created successfully. 
 
As a result, two shared variable with the same name (SharedVar1) with 
different values are existing on the test server (ABNISH).
 
Please explain how two same name variables can exist for a machine, and 
how I can extract the value of variable created by STAX Job on console?
 
STAF version: 3.2.5
STAX version: 3.2.0
OS: Windows XP (service pack 2)
 
 
Thanks in advance, 
Abnish
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
30-Day 
trial. Simplify your report design, integration and deployment - and focus 
on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to