How to set a variable's value from job output
Can anyone point me at documentation on how to set the value of a variable based on the output of a job? We are running TES v6.0.2.153.
The Agent/Adapter is a Linux command line, so the Command could be for example:
echo foo
and I would like a variable named bar to contain the value foo. (Obviously in real life the variable value would be dependent on what the command output)
Thanks in advance,
Martin
One more nugget: to parse the response from a command from a UNIX/Linux agent for a specific string and store that in a variable, I followed Rami's advice and then had to find the string in the output.
The below example puts the first digit of a random number in the variable:
Job Command:
bash -c
Command Parameters:
"'echo' Random number is $RANDOM | perl -ple 's/.*Random number is (\d{1}).*/\1/'"
Note that your command itself (in this case "echo") cannot be put in the Command box, otherwise TES does not interpret the Command Parameters correctly. So you need to set the Command to "bash -c" (run the command in the parameter string), and enter your command and parameters within double quotes in the Command Parameters, with the command being run (in this case "echo") in single quotes at the beginning.
(I also had to make my .bash_profile run without any output to avoid it being prefixed to the variable value.)
Hope this helps,
Martin.
Similar Messages
-
(Bash) How to set a variable with text from a file? [SOLVED]
I'm having a little problem.
I have textfile with a single line of text. What I want to do is set a variable with that line of text. How do I go about doing that?
A simple var="text" wont work in this case, since the text in the file changes with another script of mine.
Thanks in advance.
Last edited by Aziere (2007-03-27 09:07:03)if you have a file with more than one line but you only want the first line you could use 'head'
VAR=`head -n 1 file`
Last edited by SiD (2007-03-27 05:58:33) -
How to Set a Variable with data from Srouce Data Store
Hello ODI Experts,
I have created a Physical & Logical Schema and a Source Data store to pickup data from a database table.
On the other hand, I have a few variable that I will pass in a web service call (ODIInvokeWebService tool).
Would yo please guide how I can set variables from my source data store.
Thanks & Regards,
AhsanHello Bos/Damodhar/ODI Experts,
Doesn't it gives me a less optimized approach picking one column per query (per variable)?
Lets say, I have to pick 35 columns from a table and put those in 35 variables...It would mean running 35 queries for fetching one record from the database table.
Doesn't it seem less performance effective (less optimized)..a little scary..any thing better that I can do to make it more optimized?
Another question, what if multiple new values have come in the DB table, since I am using Refresh Variable, would this variable have multiple values in it?
Thanks for all your help,
Ahsan
Edited by: Ahsan Asghar on 21-Jun-2011 07:46 -
How to set a variable value on the BPC Data Manager
Hello BPC Experts,
I'm creating a BPC10 NW version demo environment for our prospect customer.
I made a data manager to import BW data into BPC model from BW cube.
I need to import just one month data into BPC from the BW cube that has more than one month data.
When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
But, in a case where the program (data manager) runs by JOB monthly,
I can't select a member of the time dimension prompt manually.
So I want to know how to set a variable value to the time dimension prompt from a system date etc. automatically.
Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data by the data manager running on JOB ?
(without selecting a member of the time dimension prompt of the data package manually)
Thanks in advance,
KeisukeHi Gersh
Sorry for my late reply and thanks for your helpful information.
I tried the second way of your information and I could configure it.
And I 'll try first way of your information.
Regards,
Keisuke -
How can i pass a variable's value from PR to PFR
Dear all,
hope you are fine.
i would like to pass a variable's value from PR to PFR.
how can i do that.
please suggest.
in PR:
String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
i would like to get this value to PFR.Mofizur,
You can achieve the same using Session variable.
If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
Note - You have a few of the threads left open, mark it as answered if solved.
Regards,
Gyan -
How to set a variable in portal session using web dynpro java.
Hi,
I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
Can anyone tells me how to set a variable in portal session using web dynpro java.
thanks
ArushHi,
Try this:
WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
Ex:
WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
/people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
Regards,
Charan -
How to set enviroment variables for Inso Filter
Hi everyone,
I want to convert word documents to html using CTX_DOC.Filter.According to the documentation,I know I neednot set the 'Inso Filter'in the preference when creating index,but I must set enviroment variables for Inso Filter.
I found the following instructions for it in the 8.1.5 documentation,but I can't understand it well.Is there anyone can tell me how to set enviroments variables for Inso Filter on Windows2000 Server?(My DB version is 8.1.7EE)
Environment Variable Locations
All environment variables related to Inso filtering must made visible to interMedia Text. Set these variables in the following locations:
listener.ora file. This makes the environment variables visible to the extproc PL/SQL process.
The operating system shell from where ctxsrv server is started. This makes the environment variables visible to the ctxsrv process, which does background DML.
Any suggestions are apreciated
Reemon
nullNSAPI plugins are normally configured using parameters specified in magnus.conf and/or obj.conf. What plugin requires you set an environment variable?
-
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
How Can I get multi column values from dynamic search help?
Hi Gurus;
I'm using dynamic search help in my program.
I want to get multi column values from search help. But I dont know solution for this issue.
I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
How Can I get multi column values from dynamic search help?
Thanks.Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
There are like 3 steps.
You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined (just to keep it straight, i will be putting here) data: It_return type standard table of ddshretval.
Next step is to call the function module. Make sure you have values in IT_VALTAB.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'FLD2'
value_org = 'S'
tables
value_tab = It_VALTAB
return_tab = It_return
dynpfld_mapping = It_dynpfld
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
perform get_selected_fields tables It_return.
endif.
The code within the perform GET_SELECTED_FIELDS - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
I need a internal table as well as a work area here. like,
data: lt_fields type table of dynpread,
la_fields type dynpread.
field-symbols: <fs_return> type ddshretval.
so fill out LT_FIELDS from the IT_RETURN table
loop at lt_return assigning <fs_return>.
la_fields-fieldname = <fs_return>-retfield.
la_fields-fieldvalue = <fs_return>-fieldval.
append la_fields to lt_fields.
clear: la_fields.
endloop.
Call the FM to update the dynpro
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
tables
dynpfields = lt_fields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
good luck -
How do I update a bean value from an AJAX call?
Hi all,
How do I update a bean value from an AJAX call? I suppose I could write a servlet to do it. However, this seems like a common problem, so I was wondering if there was some built in solution.
Thanks,
Grae
Edited by: caalip2 on Mar 30, 2010 1:07 PMcaalip2 wrote:
Raymond
Basically, I would user the following. The first choice for IE, the second for Firefox.
new ActiveXObject("Microsoft.XMLHTTP");
new XMLHttpRequest();
GraeDon't do this to yourself. If it were that easy there wouldn't be AJAX frameworks for JSF. Find one you like and use it. I've used a4j (part of RichFaces) successfully. -
How to set title of jsp page from resource bundle
hi ,
How to set title of jsp page from resource bundle....Depends on how you configured and declared the resourcebundle in your JSP. The usual way is just<title>${resourceBundle.messageKey}</title>
-
How to set environment variables permanetly?
I have installed oracle apps R12 on Oracle Enterprise Linux 5.3 successfully. When i run the file APPS<context_name>.env as oracle user(the one who installed software), the variables are set,,,but when i logout and login again,,,,,i dont see $ORACLE_HOME, $APPL_TOP etc......so please can someone tell me how to set the variables permanently..
thanksHi,
set the env file in profile of unix user.
if your shell is bash shell, then edit the user .bash_profile with env file. If your's is bourn shell, edit the user .profile
for example,
i have PROD as the database SID
/oraprod and /applprod are the base mount points of database and application tiers respectively.
erpserver is the hostname of R12 (single node)
(1) Database Tier:
login as oracle user
$vi .bash_profile
. /oraprod/db/tech_st/10.2.0/PROD_erpserver.env
save the file
(2) Application Tier:
login as applmgr user
$vi .bash_profile
. /applprod/apps/apps_st/appl/APPSPROD_erpserver.env
save the file
------ -
I installed j2sdk in my system.....
i want to know how to set env variables...?Which ones, what for? Did you check whether some are already set?
Forget about the classpath variable, if you want to add that. Use the command-line arguments.
And which OS? -
How to set environment variables in WL ?
Hi,
How to set environment variables in WL ?
Thanks,
SriviHi,
You can set the environmet variable in Weblogic by using the below commands
setWLSEnv.cmd/sh ==>Set the CLASSPATH to include the WebLogic Server classes.
Overview of WebLogic Server Domains
or you can use to set the Environment variable along with domain specific varables using the SetDomainEnv.cmd
To run SetDomainEnv.sh in Linux please use
. ./setDomainEnv.sh it require two dots (Dont miss it )
http://docs.oracle.com/cd/E28280_01/web.1111/e13749/weblogicserver.htm#ADMRF205
Hope it helps -
How to set environment variable ORACLE_HOME ?
Hi
I trying to install SAP Solution manager 4.0 SR3:
OS: Linux RHEL4u4
DB: Oracle
SAPinst now stops the installation.
To proceed with the installation, install the Oracle database as follows:
1.Log in as user orassm.
2.Set the DISPLAY variable.
3.Change to directory /oracle/stage/102_32/database/SAP.
4.Start './RUNINSTALLER'.
After you installed the Oracle database software, proceed with the database instance
installation by choosing 'OK' in this dialog box.
./RUNINSTALLER
oracle_stage is not set (OK)
oracle_base is not set (OK)
oracle_home is not set (OK)
oracle_sid is not set (OK)
oracle_home_name is not set (OK)
oracle_inst_group is not set (OK)
from_location is not set (OK)
tmp_netca_file is not set (OK)
tmp_dbca_file is not set (OK)
Working in /oracle/stage/102_32/database/SAP ...
The environment variable ORACLE_HOME is not set! abort ...
How to set environment variable ORACLE_HOME ?
Regards
Erici
Switch shell to bash:
orassm:x:502:503:SAP Database Administrator:/oracle/SSM:/bin/bash
[root@csp-p-sm00 ~]# su - orassm
[orassm@csp-p-sm00 ~]$
But when try to run ./RUNINSTALL
[orassm@csp-p-sm00 SAP]$ ./RUNINSTALLER
oracle_stage is not set (OK)
oracle_base is not set (OK)
oracle_home is not set (OK)
oracle_sid is not set (OK)
oracle_home_name is not set (OK)
oracle_inst_group is not set (OK)
from_location is not set (OK)
tmp_netca_file is not set (OK)
tmp_dbca_file is not set (OK)
Working in /oracle/stage/102_32/database/SAP ...
The environment variable ORACLE_HOME is not set! abort ...
Additionaly I've post csh.cshrc and csh.login
/etc/cshrc
csh configuration for all shell invocations.
by default, we want this to get set.
Even for non-interactive, non-login shells.
[ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]
if $status then
umask 022
else
umask 002
endif
if ($?prompt) then
if ($?tcsh) then
set prompt='[%n@%m %c]$ '
else
set prompt=\[`id -nu`@`hostname -s`\]\$\
endif
endif
if ( $?tcsh ) then
bindkey "^[[3~" delete-char
endif
setenv MAIL "/var/spool/mail/$USER"
limit coredumpsize 0
if ( -d /etc/profile.d ) then
set nonomatch
foreach i ( /etc/profile.d/*.csh )
if ( -r $i ) then
source $i
endif
end
unset i nonomatch
endif
/etc/csh.login
System wide environment and startup programs, for login setup
if ($?PATH) then
if ( "$" !~ /usr/X11R6/bin ) then
setenv PATH "$:/usr/X11R6/bin"
endif
else
if ( $uid == 0 ) then
setenv PATH "/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
else
setenv PATH "/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
endif
endif
setenv HOSTNAME `/bin/hostname`
set history=1000
if ( ! -f $HOME/.inputrc ) then
setenv INPUTRC /etc/inputrc
endif
Regards
Eric
Maybe you are looking for
-
Work failed while applying the patch 3480000
Dear All, Please Help At the phase of applying the patch 3480000 while upgrading from 11.58 to 11.5.10.2 workers failed: FAILED: file WFXLoad.class on worker 5 for product fnd username APPLSYS. Time is: Tue Apr 05 2011 06:30:13 ATTENTION: All workers
-
SQL Server 2000 and JDBC,Registering cursor as OUT param
hi I am using JDK1.4,SQL Server 2000 and Microsoft's JDBC driver. I am stuck in accessing cursors. The SP i wrote is USE pubs IF EXISTS (SELECT name FROM sysobjects WHERE name = 'spSelectEmployees' and type = 'P') DROP PROCEDURE spSelectEmployees GO
-
How to use jdbc to connect oracle
I want use jdbc direct to connect oracle database,and I want to use sun Company or oracle Company driver. how can I get driver and how do I write connection string? Deeply to wait your reply,thank you!
-
Oracle data lookup - Licensing query
Hi, Not finding the right forum to post this query, so i hope the coffee shop folks can be helpful We are running SAP R/3 4.7 Enterprise with Oracle 9.2.0 as the backend database (on Windows Server 2003 OS). Our Oracle license is embedded with SAP i.
-
Since updating my iPad to ios8 when using the keyboard in Safari the tab for the domain suffix is no longer visible as it was in ios7. Is this hidden or has it just been removed?