Tcl proc with input argument run from UNIX script...how

Environment:
OWB 10g Client on Windows XP Professional
Repository - 9.2.0.4 on UNIX (AIX 5.2)
Target - 9.2.0.4 on UNIX (AIX 5.2)
I need a little tcl advice, please!
I have a tcl script (proc, I guess) that takes one argument, in this case a mapping name.
I would like to execute this tcl script from a UNIX shell script and pass the name of the mapping as an argument to the UNIX shell script. Something like:
OMBPlus.sh omb_deploy.tcl $1
where omb_deploy.tcl is the script that has all the OMBPlus commands in it to create the deployment plan and execute it.
I'd like to pass the mapping name as a command line argument to the UNIX shell script but it doesn't like it.
When I execute the script as above, I don't see any output and the mapping does not get deployed.
So, I need a little help on two (2) issues:
1- How do I generate a log file of the output of the tcl script?
2- How do I pass the mapping name as an argument to the UNIX shell script?
For #1 I have tried using the 'open logfilename w' at the top of the tcl script but it produces no output.
I saw another example from this forum where the author used a 'putslog' command in the script. I can't find any documentation on that command, what does it do?
That same script set a global OMBLOG variable at the top of the script and used the 'putslog' command in the body.
Is OMBLOG some special reserved word for logging? I couldn't find anything on it.
I'm trying to learn tcl but struggling to put all the tcl stuff together with all the OMBPlus stuff and make it all work is getting the best of me.
Any assistance, with examples (I learn best from them), is greatly appreciated.
Gary

Well duh!
I ended up just logging everything from the UNIX shell script and letting the tcl script write everything to stdout.
I also finally found the $argv parameter and have used that to pick up the name of the mapping being passed to OMBPlus.
It seems to be working so far.
Gary

Similar Messages

  • How to run a unix script from oracle warehouse Builder

    Hi,
    can any one share the information about, running the unix script or scripts using oracle warehouse builder.
    Regards,
    Ak

    One way is define a workflow. Inside the workflow you put
    1)an external process that "points to" the shell script and then
    2)put the mapping
    The external process must have the "COMMAND" parameter set to the name of the shell script. If the script has parameters you must put them in the "PARAMETERS LIST" separated by "?" (for example, ?par1?par2).
    The path where OWB executes the external process I think is the ORACLE_HOME of the OWB.
    f you don't use workflow, you can try with this more complex solution. I tried with 9i and OWB 9.2 and it's working well.
    You create an autonomous procedure (within a package or not) :
    CREATE PROCEDURE Extract_Email_List
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    And use the sys.shell script that you need your dba/unix admin to install first of all, with a call like that.
    sys.shell('sh ' || txt_dir_name || '/send_email_marketing.sh ' || txt_dir_name || ' ' || email_addr );
    Then you import your procedure into OWB and use it in your mapping with the "pre-mapping" icon (you can set parameters for your proc with constants if you want).
    To implement sys.shell, go to metalink and find "Note:168065.1" - "How to call a UNIX shell script from PL/SQL".
    Once it's done once, it's not so bad. But I would still recommend the workflow approach also..
    I hope this helps.

  • Running a Unix script from a Java class

    I am trying to use SCP (Secure copy) to copy an xml file from my J2EE application to a remote Unix server using a Unix script. How can I run the Unix script from my Java class? I could not find any resource for this on the internet. Can someone help me with this please.
    Thanks

    I am trying this below program ,but i am getting the error please help me
    import com.jcraft.jsch.*;
    import com.jcraft.jsch.Channel;
    import com.jcraft.jsch.JSch;
    //import com.jcraft.jsch.JSchException;
    import com.jcraft.jsch.Session;
    //import com.jcraft.jsch.UserInfo;
    import java.io.*;
    public class testrad {
    public static void main(String args[])
    String user="usertvr";
    String host="5.34.12.1";
    String cmd="ls -l";
    JSch jsch = new JSch();
    try{
    Session session=jsch.getSession(user,host,22);
    session.setPassword("$yhaj23");
    //UserInfo usrInfo=new MyUserInfo();
    //session.setUserInfo(usrInfo);
    session.connect();
    Channel channel=session.openChannel("exec");
    ((ChannelExec) channel).setCommand(cmd);
    channel.setXForwarding(true);
    channel.connect();
    //code
    channel.setInputStream(System.in);
    // channel.setOutputStream(System.out);
    //((ChannelExec) channel).setErrStream(System.err);
    InputStream in = channel.getInputStream();
    channel.connect();
    byte[] tmp = new byte[1024];
    while (true)
    while (in.available() > 0)
    int i = in.read(tmp, 0, 1024);
    if (i < 0)
    break;
    System.out.print(new String(tmp, 0, i));
    if (channel.isClosed())
    in.close();
    // System.out.println("JSCH: exit-status: " +
    //channel.getExitStatus());
    break;
    try
    Thread.sleep(1000);
    catch (Exception ee)
    channel.disconnect();
    session.disconnect();
    }catch(Exception e)
    {e.printStackTrace();
    System.out.println("Exception"+e);}
    /*public static class MyUserInfo implements UserInfo {
    public String getPassword()
    { return "password"; }
    public String getPassphrase()
    { return ""; }
    public boolean promptPassword(String arg0)
    { return true; }
    public boolean promptPassphrase(String arg0)
    { return true; }
    public boolean promptYesNo(String arg0)
    { return true; }
    public void showMessage(String arg0)
    Here is the error
    com.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
         at com.jcraft.jsch.Session.checkHost(Unknown Source)
         at com.jcraft.jsch.Session.connect(Unknown Source)
         at com.jcraft.jsch.Session.connect(Unknown Source)
         at testrad.main(testrad.java:23)
    Exceptioncom.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
    Can some one help me please.
    I running this program from Windows to connect to remote unix boxes.

  • Run a UNIX Script from java

    Hi,
    how can i run a unix script from java application. This java application is on windows.
    How can i do this.
    thanks,

    Hi,
    how can i run a unix script from java application.
    This java application is on windows.
    So I think it's safe to assume that the target script is on a remote unix server.
    Take a look at http://sourceforge.net/projects/sshtools/

  • My old iPad 2 is updated to ios 7.1.2 but I have a new 4 which is only compatible with 7.0.4 from setup. How can I backup my account to the new iPad with this incompatibility?

    My old iPad 2 is updated to ios 7.1.2 but I have a new 4 which is only compatible with 7.0.4 from setup. How can I backup my account to the new iPad with this incompatibility?

    What you need to do is temporarily set up your new 4. Just long enough to update the operating system. Then you can erase all content and settings - which puts it back to its out of box state, then set it up again, this time restoring it from the backup of your two.
    So, using the same Apple ID on both - just to keep things easy - set up your 4. Just basically choose 'set up as new' to activate it, then immediately update the iOS to 7.1.2.
    then erase all content and settings, which puts it back to 'llike new'...but the operating system will not reset, it'll remain 7.1.2
    Then set it up again, this time choosing to 'restore from the backup' of your 2 and your 4 will be a near clone of your two.

  • Triggering background job event from Unix script

    Hi all,
      I am having one question regarding triggering of background job in SAP using Events from Unix script. Is this possible? If so, can anyboy provide some sample code related to Unix script and how do we communicate to SAP from Unix system. Actually, here the backend of R/3 system is MSSQL. I am having a program in R/3 system which is scheduled as a background job based upon event trigger. I want to trigger that even from the unix script.
      Appreciate for your help in advance.
    Thanks,
    Adithya K

    Hi,
    Check if this can help you
    http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/content.htm
    Regards,
    Atish

  • Running an Unix Script from Informatica Mapping/workflow.

    Hi ,
    I have a need to start /stop service to a remote server (away from the DAC server ,which is on UNIX os)
    how could this be done in a best way?
    I am planning to do this through Informatica Workflow,and need help (technical steps Please) to do this.
    1) workflow will call the Unix Script
    2) Unix Script logins to the remote server
    3) Unix scripts navigates to particular folder
    4) Unix script executes a command to Start/Stop the server.
    5) Unix Script logs out.
    6) if everything done success ,Workflow will success else fail with the error code.
    Regards

    Hi ,
    I have a need to start /stop service to a remote server (away from the DAC server ,which is on UNIX os)
    how could this be done in a best way?
    I am planning to do this through Informatica Workflow,and need help (technical steps Please) to do this.
    1) workflow will call the Unix Script
    2) Unix Script logins to the remote server
    3) Unix scripts navigates to particular folder
    4) Unix script executes a command to Start/Stop the server.
    5) Unix Script logs out.
    6) if everything done success ,Workflow will success else fail with the error code.
    Regards

  • How to run a Unix Script from a specific user

    Hi,
    I want to run a GoldenGate related unix script from a super user. I have created crontab enter from that super user. But its still running from root user. As GGSCI cannot be invoked other than super user, the Script is failing.
    The Script is running fine on command prompt and from "at" batch job command.
    Please give me a way to run the script from a specific user on Cron
    Thanks,
    Saravana

    Hi.
    can you show:
    grep root /etc/passwd
    grep <super user> /etc/passwd (It's not clear for me, what you call super user. For me - root is super user. )
    ls -la /var/spool/cron/crontabs
    Generaly for add cronjobs for any user need:
    crontab -e <username>
    For more information - man crontab
    Reagrds.

  • FM to read files starting with TEST(for example) from Unix server

    Hi all,
    Is there a FM to read all the files which start with TEST (for example) from the Unix server?
    Requirement is if we put TEST* in the selection screen for the filename, it should read all the files which start with TEST from the default Unix path.
    Thanks and regards,
    Anishur

    Function Modules
    http://www.erpgenie.com/abap/functions.htm
    http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
    http://www.erpgenie.com/abap/index.htm
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Rewards if useful.........
    Minal

  • Data block based on stored procedure with  input arguments

    Hi,
    I am able to create a data block based on stored procedure.
    but I want that procedure to take input arguments as well and I am facing the issue while setting the value for that input arguments from another block item.
    Please somebody help, How to set the value for input argument from another control block- item?.(Note :Data block is based on the stored procedure)
    Thanks in Advance,
    Anandan Muthukannan

    I did exactly the same way you mentioned.
    But while building the form, The call to the procedure in 'QUERY-PROCEDURE' trigger has been modified like this way
    procedure_name(qp_data,':BLOCK.ITEM');
    so in procedure i am getting the value as ':BLOCK.ITEM' not the expected value.

  • How can I run a Unix script from a desktop icon?

    I have a Unix script I've created in vi and would like to run it by double clicking on an icon on my desktop. I would like to do this without the additional application layer of Applescript, Automator or Terminal. Is this possible?
    Thanks in advance.
    Howard

    Sounds like a job for platypus.

  • How to invoke from UNIX script and pass back return code?

    Though I am an experienced developer, I am new to java. I created a class containing a single method. I have performed my testing by running the class class.method from the command line in a UNIX (Solaris) environment. Now, I would like to have the class.method invoked from a UNIX shell script, and to return a success/failure indicator from the method, to the UNIX script. I modified the method to make it return char, rather than being defined as void. Within the class and method, I declared and initialized a char variable. I added a finally clause which contains a single return statement, returning the char return code variable. Within my UNIX script, I invoke the class/method as follows:
    return_code = java myClass
    This does not seem to be invoking the method however. Can someone please tell me what I am doing wrong? Or is more information needed in order for someone to help me out.
    Please let me know.
    Thanks.
    Brad

    stdunbar,
    Using your suggestion of System.exit(retVal); seems to allow the java method to be performed successfully (Thank You). But I am still having a problem with the value being recognized by the shell script.
    In my script, I'm doing the following:
    java MyClass inputparameter > return_code
    export return_code
    echo $return_code
    But return_code does not seem to contain a value. Just before the System.exit(retVal); I added System.out.println("return code = " + retVal ); and I can see that retVal. When I run the java method outside of the UNIX shell script, I can see that retVal does indeed contain a value. So I think my problem might actually be the code in the UNIX script.
    Thanks again.
    Brad

  • Integration of TFS with Eclipse to run the Selenium scripts

    Dear All,
    We came across with a difficult situation to build an automation framework for our customer. The objective is to find out a common
    scripting language/tools which can integrate and run automated scripts from both HP ALM and MS TFS test management tools. Below are the two solutions we are trying to explore more. Any information regarding the same will be really appreciated. 
    1. Integration of Microsoft TFS with eclipse and running of automated test cases ( Selenium scripts)
    2. Integration of HP ALM to Visual studio - Here we are checking feasibility of integration and running test cases from HP ALM(.Net
    scripts)
    Please let me know your inputs .Thanks a lot
    Shyam
    [email protected]

    Hello Guys- Pls help me to find a solution on this. 
     To find out a common scripting language/tool which can integrate and run automated scripts from both HP ALM and MS TFS
    test management tools. Below are the two solutions we are trying to explore more. Any information regarding the same will be really appreciated. 
    1. Integration of Microsoft TFS with eclipse and running of automated test cases ( Selenium scripts)
    2. Integration of HP ALM to Visual studio - Here we are checking feasibility of integration and running test cases from HP ALM(.Net
    scripts)
    Please let me know your inputs .Thanks a lot
    Shyam
    [email protected]

  • Calling maxl from unix script

    Hi guys..I want to call a maxl script from a unix script. i am using ksh shell in unix..
    Can anyone give me the syntax from this..I am not very familiar with this.

    Actually I found there was an Esscmd.sh file too.that's why wanted to be sure about the option of esscmd.
    And would these scripts accept parameters like this:
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script.mxl 1 2
    and if we place & after the script name would it be a nohup process and run the next ones parallely??:
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script1.mxl &
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script2.mxl &
    Sorry if my questions seem stupid.
    I know very little about this tech and just want to clear any confusion and know as much as i can.

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

Maybe you are looking for

  • Cannot print from ANY application after upgrade to 10.4.8 !!!

    Hi all, as it is written in the subject. Up to yesterday, I had OS 10.3.9, everything ok, could print from any application. Then I moved to Tiger and to the last version (10.4.8). And today the "nice" surprise: either from Preview, Texshop, Word, any

  • Error message for running stored procedure

    Hello expert, I got error message for a stored procedure running as follows, will you please tell me what that error is? what is the reason for that error? appreciate very much. Job name=PROD DWH REPORT MART LOAD.1 Job owner=DEVTEAM Job type=SQL Scri

  • Can i reregister my iphone 4 on someone else???

    Hi People! I bought one Brand new iphone 4 and it brake in a few months. So when i took it back they swap my phone with a used one refubrished from Apple. The problem is that the phone is already registered to someone else. Can i reregister it to my

  • MX200 Not working plz help !!!

    I really need help, i just got a MX200 Pro2-32s geforce 2 MSI graphic card I am running Win XP Pro on a PIII 800MHz With 192ram now before it i had a NVIDIA RIVA TNT2 Model64 I take it out and put this card in (mx200), and i started windows and it sa

  • Explorer crashes frequently on two Windows 7 64 machines

    Hi, I have two users on the network who are experiencing frequent crashes of Windows Explorer.  In all cases the crashes are being caused by invalid write   I have been collecting crash dumps and trying to analyze them in Visual Studio 2013, but with