Automic Workload Automation

Expand all | Collapse all

Issue running a script

  • 1.  Issue running a script

    Posted 05-15-2019 07:35 AM



    I have the following script which I am running on a windows server. in a workflow


    ! List the Weekly-GMR files in the D:\SAP_REPORT\Inbound folder
    : SET &LISTFILE# = PREP_PROCESS("OMP-BATCHQA","WINCMD","","CMD=DIR /b /a-d D:\SAP_REPORT\InBound\Stock_List_*.csv > D:\Stock_Archive\StockList.log","UC_LOGIN=LOGIN.OMPBATCH")




    When I execute the script, the LastReport will show that the script has been executed


    2019-05-15 12:25:04 - U0007000 'EVENT.WINCMD' activated with RunID '0138289588'.


    But the script doesn't seem to do anything. I've checked that the command inside the script is valid and have run it manually on the server when connected as the same user the script runs as and it works fine.  Even if I execute the script directly from the object itself, it still doesn't work


    Any ideas of why it is not doing what it is supposed to do ?




  • 2.  Re: Issue running a script

    Posted 05-15-2019 10:02 AM

    What is it that you want this script to do exactly?

    A PREP_PROCESS command will parse the stdout from the command you execute, and since your command is redirecting all of its output into the D:\Stock_Archive\StockList.log file, I wouldn't expect there to be much stdout to be processed.

    I also don't see that you have anything between your ": PROCESS &LISTFILE#" and ": ENDPROCESS" commands anyway, so it's not like you're doing anything with your stdout to begin with.

    Are you just saying that the D:\Stock_Archive\StockList.log file isn't being created?

  • 3.  Re: Issue running a script

    Posted 05-15-2019 10:36 AM

    Hi Daryl


    Thanks for the reply.  Yes, basically the D:\Stock_Archive\StockList.log file isn't being created.




  • 4.  Re: Issue running a script

    Posted 05-15-2019 11:04 AM

    This might be a long shot, but if you look in client 0 for the 'EVENT.WINCMD' object, is the windows tab configured properly to execute this command?  (e.g., do you need to have 'Log on as batch user' checked off in order for this job to execute properly?  To put it another way, if you were to create a regular windows job (JOBS) to execute this command, would the windows tab of your job match what you're seeing on this EVENT.WINCMD object?)