Running the jobs sequentially instead of parallel

Hi All,
My script runs multiple jobs by iterating in a loop one by one. They are getting executed in parallel where as i want them to run sequentially one only after another has finished execution. For ensuring this i have added this logic in my code:
[Code for Job name reading, parameters setting goes here]
jcsSession.persist();
while (((infoJob.getStatus().toString().matches("Scheduled")) || (infoJob.getStatus().toString().matches("Running"))) {
  jcsOut.println("infojob still running"+infoJob.getStatus().toString());
This should run after each job's persist statement.
Ideally the loop should end as soon as the job attains 'Error' or 'Completed' state i.e. the job ends but when i am running the script
this while loop is running infinitely thus causing an infinite loop.
Because of which the first job ends but the script does not move forward to next job.
Please help me what i am doing wrong here or if there is any other way to make the jobs run sequentially through Redwood.
Thanks,
Archana

Hi Archana,
How about jcsSession.waitForJob(infoJob);
Regards,
HP

Similar Messages

  • How to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    032ee1bf-8007-4d76-930e-f77ec0dc7e54 wrote:
    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also
    Please don't overwhelm us with so many details!  
    Just off the top of my head ... as a general approach ... something like
    nohup proca
    nohup procb
    nohup procc
    while (some condition checking that all three procs are still running ... maybe a ps -ef |grep  )
    do
    sleep 2
    done
    procd
    But, we'd really need to know what it is you are really trying to accomplish, instead of your pre-conceived solution.

  • Need to run the JOB without Ineractive Screen

    Dear All,
    We have written a new ABAP program for executing the Macro background Job and used JOB_OPEN,JOB_SUBMIT and JOB_CLOSE Function Modules to run the JOB from ABAP Program.  We are able to run the JOB successfully for Any other ABAP Programs through the custom program, but when I tried with the same approach to run the Macro job through my new ABAP Program the JOB is throwing an error.
    Error Message is like below
    Job started
    Step 001 started (program /SAPAPO/TS_BATCH_JOB, variant TEST, user ID GKMN3511
    Specify a start time
    Job cancelled after system exception ERROR_MESSAGE
    Point of doubts:
    -- Can we really execute the Macro job through the ABAP program with out any dialogue screen (because when I use the "/SAPAPO/MC8G - Schedule Demand Planning in the Backgroundu201D program in my custom program it pop-ups a interactive screen which I don't want in my ABAP program while scheduling the macro job)
    Regards,
    Raju

    In transaction /sapapo/mc8t --> define the activity that looks at the macro in question
    In transaction /sapapo/ mc8d --> define the job that looks at that activity and a selection iD/aggregation level
    In transaction /sapapo/ts_batch_run --> save a variant pointing to the job defined in mc8d
    you can then run the /sapapo/ts_batch_run job with that variant

  • To identify the user running the job at runtime

    Hi All,
    My requirement is to develop a program which need to send mail only if a particular user runs the job.
    I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime.
    Please suggest me the possible ways of identifying the user running the job at runtime.
    Thanks in advance!!!
    Regards,
    Dinesh.

    "I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime."
    This is not true if your program/form/method is called inside the ABAP report which is executing in the batch job step. There, the active SY-UNAME is the user entered in SM36 as the job step user. It is not the user who planned/scheduled the job.
    It is unclear from your description where your program is actually running. Is it another (ABAP) step belonging to the same job or is it actually some routine called within the same job step that you are checking or is it a program totally unrelated to the batch job in question (in that case, check out the other answers about TBTCO/TBTCP)
    - Alex

  • Not able to run the job with user id - is

    Hello experts,
    We have problem.
    Every day we run the job.
    ( the job contians two programs called  ZTIBCOPRG  and J_5HJSTP  )).
    I would like to know why the above job is running with the user ID TIBCOADM.  Because this user has German settings for the size conversion in program ZTIBCOPRG and we are having some issues.
    We changed the user to TIBCOUSA and the job would not run. 
    We have changed the user back to TIBCOADM.  It is running.
    KINDLY HELP ME WITH YOUR VALUABLE inputs.   YOUR HELP WILL BE HIGHLY APPRECIATED.
    I have checked for both users in AGR_USERS  table.
    The AGR_USERS is the old user and have many roles compared to userid TIBCOUSA.
    WHERE WE NEED TO SEE . IS it authorisation problem or the other user with whom unable to run the job ?
    or is this the error in the program ZTIBCOPRG which is not able to do size conversion and causing some issues.
    Thanks and Regards,

    Hi,
         after running the job with user id TIBCOUSA, it should be in cancelled state as per your comments.
    you just select the cancelled job and type JDBG in command box and enter it takes you to Debug mode.
    There you may get some information where it is failing.
    Sudheer. A

  • How to run the job under sys id

    Hello ,
    I wanted to run a job under sys id ( Batch user ) , as my authorisation is not sufficiant to run the repoting agent - Precalculation. Where as Batch user have all the roles for the same .
    I am in my login screen , and i wanted to run the job under batch user id ...could you please let me know how can i do it ?
    Regards,
    Manoj

    Hi,
    Try to schedule the job in background and see.
    Thanks,
    JituK

  • USER_SCHEDULER_JOBS has LAST_START_DATE as null even after running the jobs

    Hi,
    I have tried creating and running multiple Jobs using following statements, Jobs are executing the given procedure but USER_SCHEDULER_JOBS's last_start_date is null.
    //creation of job
    DBMS_SCHEDULER.CREATE_JOB (job_name => 'demo'||i,job_type => 'STORED_PROCEDURE',number_of_arguments => 2,job_action => 'POPULATE_DATA');
    //running the job using these commands..
    dbms_scheduler.set_job_argument_value(PROCESS_NAME,1,''||START_RANGE);
    dbms_scheduler.set_job_argument_value(PROCESS_NAME,2,''||END_RANGE);
    dbms_scheduler.set_job_argument_value(PROCESS_NAME,3,''||PROCESS_NAME);
    DBMS_SCHEDULER.RUN_JOB(PROCESS_NAME);
    I am able to see data getting getting populated by each job, but USER_SCHEDULER_JOBS has last_start_date value as null.
    Any help will be highly appreciated.
    Thanks,
    Vaseem Saeed.

    hi read this link, there is some explaination about start_date null:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e16760/d_sched.htm

  • Urgent run the job --SBIE0001 takes  long time more than two hours

    hi expert,
    we run the job which cocntian the program SBIE0001 it takes so along time,
    we use the job to eatra the date from our system to another satellite system, by checking the
    job this is one step takes the mainly time as below.
    88 LUWs confirmed and 88 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA
    any update will be appreciated. thanks in advance.

    If you have transaction ME30 active in yous system, run the program into in.
    It will give more information about how the time is lost.

  • Azure Compute Nodes not running the job

    I have an on-premise head node. I have joined 10 Azure Compute Nodes via the cloud service and storage account. I have uploaded the dlls directory to storage account and synced using hpcsync all the compute nodes. The Azure compute nodes are still not
    running the job. I see in the HPC Job Manager that the Cores In Use = 0. How should I resolve this issue?

    Hello,
    We are researching on the query and would get back to you soon on this.
    I apologize for the inconvenience and appreciate your time and patience in this matter.
    Regards,
    Azam khan

  • How to run the job using DBMS_SCHEDULER

    How to run the job using DBMS_SCHEDULER
    pleas give some sample Iam very new to DBMS_SCHEDULER

    Hi
    DBMS_SCHEDULER
    In Oracle 10g the DBMS_JOB package is replaced by the DBMS_SCHEDULER package. The DBMS_JOB package is now depricated and in Oracle 10g it's only provided for backward compatibility. From Oracle 10g the DBMS_JOB package should not be used any more, because is could not exist in a future version of Oracle.
    With DBMS_SCHEDULER Oracle procedures and functions can be executed. Also binary and shell-scripts can be scheduled.
    Rights
    If you have DBA rights you can do all the scheduling. For administering job scheduling you need the privileges belonging to the SCHEDULER_ADMIN role. To create and run jobs in your own schedule you need the 'CREATE JOB' privilege.
    With DBMS_JOB you needed to set an initialization parameter to start a job coordinator background process. With Oracle 10g DBMS_SCHEDULER this is not needed any more.
    If you want to user resource plans and/or consumer groups you need to set a system parameter:
    ALTER SYSTEM SET RESOURCE_LIMIT = TRUE;
    Baisc Parts: Job
    A job instructs the scheduler to run a specific program at a specific time on a specific date.
    Programs
    A program contains the code (or reference to the code ) that needs to be run to accomplish a task. It also contains parameters that should be passed to the program at runtime. And it?s an independent object that can referenced by many jobs
    Schedules
    A schedule contains a start date, an optional end date, and repeat interval with these elements; an execution schedule can be calculated.
    Windows
    A window identifies a recurring block of time during which a specific resource plan should be enabled to govern resource allocation for the database.
    Job groups
    A job group is a logical method of classifying jobs with similar characteristics.
    Window groups
    A window groups is a logical method of grouping windows. They simplify the management of windows by allowing the members of the group to be manipulated as one object. Unlike job groups, window groups don?t set default characteristics for windows that belong to the group.
    Using Job Scheduler
    SQL> drop table emp;
    SQL> Create table emp (eno int, esal int);
    SQL > begin
    dbms_scheduler.create_job (
    job_name => 'test_abc',
    job_type => 'PLSQL_BLOCK',
    job_action => 'update emp set esal=esal*10 ;',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=DAILY; INTERVAL=10',
    comments => 'Iam tesing scheduler');
    end;
    PL/SQL procedure successfully completed.
    Verification
    To verify that job was created, the DBA | ALL | USER_SCHEDULER_JOBS view can be queried.
    SQL> select job_name,enabled,run_count from user_scheduler_jobs;
    JOB_NAME ENABL RUN_COUNT
    TEST_abc FALSE 0
    Note :
    As you can see from the results, the job was indeed created, but is not enabled because the ENABLE attribute was not explicitly set in the CREATE_JOB procedure.
    Run your job
    SQL> begin
    2 dbms_scheduler.run_job('TEST_abc',TRUE);
    3* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> select job_name,enabled,run_count from user_scheduler_jobs;
    JOB_NAME ENABL RUN_COUNT
    TEST_ABC FALSE 0
    Copying Jobs
    SQL> begin
    2 dbms_scheduler.copy_job('TEST_ABC','NEW_TEST_ABC');
    3 END;
    4 /
    PL/SQL procedure successfully completed. Hope it will help you upto some level..!!
    Regards
    K

  • Error when we are running the job "AS ABAP - Initial Load" for a ABAP Syste

    Hi,
    We are getting the below error when we are running the job "AS ABAP - Initial Load" for a ABAP System.
    Pls note that we have maintained the below entry types to the Identieny Store & we are still getting the error.
    Request you to help me
    MX_TITLE_SUPPLEMENT
    MX_SALUTATION
    MX_NAME_PREFIX
    MX_ACADEMIC_TITLE
    Error----
    runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_ACADEMIC_TITLE!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_ACADEMIC_TITLE' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_ACADEMIC_TITLE!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_ACADEMIC_TITLE' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_NAME_PREFIX!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_NAME_PREFIX' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_NAME_PREFIX!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_NAME_PREFIX' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_SALUTATION!!Mr.!!EN)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_SALUTATION' AND ValText = 'Mr.' AND ValLocale = 'EN') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_TITLE_SUPPLEMENT!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_TITLE_SUPPLEMENT' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_ACADEMIC_TITLE!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_ACADEMIC_TITLE' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_ACADEMIC_TITLE!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_ACADEMIC_TITLE' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_NAME_PREFIX!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_NAME_PREFIX' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_NAME_PREFIX!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_NAME_PREFIX' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_SALUTATION!!Mr.!!EN)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_SALUTATION' AND ValText = 'Mr.' AND ValLocale = 'EN') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error runFunctionsInString($FUNCTION.sap_getHelpValKey(MX_TITLE_SUPPLEMENT!!)$$) got exception
    org.mozilla.javascript.EvaluatorException: uSelect(select ValKey from dbo.mxi_attrvaluehelp where ValId = 'MX_TITLE_SUPPLEMENT' AND ValText = '') got exception java.sql.SQLException: ORA-00942: table or view does not exist
    Error putNextEntry failed storingMANJUHB
    Exception from Add operation:com.sap.idm.ic.ToPassException: ToIDStore.addEntry failed storing entry 'MANJUHB'. IDStore returned error message: " Value not legal for this attribute:Attribute: MX_ACADEMIC_TITLE_2" when storing attribute 'MX_ACADEMIC_TITLE_2=$FUNCTION.sap_getHelpValKey(MX_ACADEMIC_TITLE!!)$$'
    Exception from Modify operation:com.sap.idm.ic.ToPassException: ToIDStore.modEntry failed updating entry 'MANJUHB'. IDStore returned error message: "Entry does not exist" when fetching entry

    The Probelm was resolved after editing the Script..... "sap_getHelpValKey.js"

  • Parallel run the job

    hi,
    kindly give the suggestion how to handle the following error while deleting the records through parallel execution of package,
    ORA-00060: deadlock detected while waiting for resource.
    by
    siva.

    kn_sivaraman wrote:
    hi,
    kindly give the suggestion how to handle the following error while deleting the records through parallel execution of package,
    ORA-00060: deadlock detected while waiting for resource.Deadlocks are an application problem.. not an Oracle problem. Application code written in such a way that it steps on its own toes.
    The solution is to fix the application code.
    Also, part of the solution is to make developers of this code very aware that the code is executed in a multi-processing and multi-user environment.. where there can be a number of other processes running, including some that run the very same piece of code.
    So code must be designed and written as thread-safe/multi-process safe. And if it is not possible for a specific code unit to be safe, then make it safe by forcing it to always only execute serially.
    And this basic rule is not unique to PL/SQL or Oracle development - but to any platform today (caveat - we assume that old "+single-process+" operating systems like MS-DOS is no longer widely used).
    Even when writing a Visual Basic Windows client (as what stops another copy of that client program to be loaded and executed at the same time).

  • Downloading the file in our PC , when running the job in Background

    Hi,
    We have an enquiry for below requirment.
    Our client runs some jobs in front end , but as the time taken to execute the JOB is more than 15 minutes  , he is getting timeout problem, so we want to run the same program in background.
    Generally the output of the report is to download the file into his desktop,  so even when he is running
    the same job in background he want it to be downloaded into his PC, instead of application servor.
      We created a test program similar to the requirment, and ran the job in foreground and the file could easily be downloaded to desktop. Then we ran the program in backgound - The job failed with an error message  Codepage could not be determined  - Message no. FES025.
    My Question is - is it possible to download the file into the desktop while running in background.
    Please help me .
    Thanks in advance.
    Vengal Rao.

    Please search the forum. This question has been asked and answered many times before.
    Rob

  • I need to run the job  every 8th of the month

    Hello,
    Can you please help me out to run the oracle job every 8th of the month.
    Thanks in advace
    Kind reagrds,
    Nick

    Untested, but I'd say the repeat_interval clause of dbms_scheduler.create_job should be something like:
    'FREQ=MONTHLY;BYMONTHDAY=8;'

  • Run the job for VL10A

    Hi Experts,
    Can any one tell me how to schedule the job for VL10A transaction .How to create the variant for whole transaction.Please advice me.Sure of reward points.
    Thanks in Advance.

    Hi Ajay,
    For planning the delivery creation in background processing you must
    •     activate a user role for immediate creation of deliveries (in the standard system, the immediate delivery creation is deactivated for all user roles for reasons of safety),
    •     create a selection variant for one of Transactions VL10*.
    Activation of the user role for background processing
    The user role controls the entire processing of the delivery list. Within Transactions VL10*, you can display and maintain the user role on the "User role" tab page. You can carry out the maintenance also via Transaction VL10CUA. Note 301578 describes how to make a user role ready for input.
    An F-code profile is linked to the user role. The F-code profile controls the internal process of the transaction. Two F-code profiles are provided in the standard system:
    •     0001 Display delivery list
    •     5001 Supply delivery list
    In the user role you want to use for background processing, you have to replace F-code profile (not "AllowedDialogFCodes") 0001 with profile 5001:
    1. Call Transaction VL10CUA for maintenance of the user roles.
    2. You might want to copy one of standard user roles 5001 to 5103 that is planned for processing in the background to a separate role in the customer namespace, for example, 9001 or Z***.
    3. Branch to the detail view of the user role and change the entry for the F-code profile from "Display delivery list" to "Supply delivery list".
    Creation of the selection variant
    1. Call the desired Transaction VL10* and branch to the "User role" tab page. Do not use Transaction SE38 or VL10BATCH for variant maintenance of VL10*.
    2. Here, enter the user role that you have maintained for background processing.
    Caution! If you use a user role with an F-code profile for the immediate creation of deliveries, you receive no dialog with a shipping due list but the deliveries are created immediately at the start of the selection!
    3. Enter the remaining selection criteria on the various other tab pages.
    4. Select function "Goto -> Variants -> Save as variant..." and save the selection criteria entered as a variant. You might classify the variant as "Only for background processing", in order to avoid a start of the delivery creation in the dialog by mistake.
    Reward points pls.
    Regards,
    Govind.

Maybe you are looking for

  • PO Backend Error

    Dear Experts, We have encountered an error in PO creation - Backend Error: Sum of quantities > 17,050 < larger than the total quantity. PO is created from a shopping cart, SHC qty is 17,050 and PO qty is only 34.  I've noticed that there were multipl

  • Oracle Query Tuning

    Hi, I am having difficulty with a particular issue. We have a column that is indexed, but we are looking just for the NULL columns and it is deciding to do a full table scan. Here is the query and the output from the explain plan. Much of our cost is

  • Localization/Indian languages

    Hello Friends, I am trying to localize my application for Indian languages. I have a few road blocks to discuss. 1. My changes in properties files does not reflect immediately. 2. Can anyone please tell me how I will get the locales corresponding to

  • Amavis / Spam help needed

    Hi All G5 X-Serve on Tiger OS X Server 10.4.x I updated my Amavis and SpamAssassin as directed at osx.topicdesk.com Since this move, no mail gets delivered. The error message in the queue is "delivery temporarily suspended: connect to 127.0.0.1[127.0

  • Linux Tools 4.0.0 is released

    I am pleased to announce that the 4.0.0 major release is now available from our update site. Details available in the N&N page [1]. This release is the Linux Tools contribution for Mars SR0. The tag v4.0.0 maps to commit e3de351ca7ffd1bf722c9f0e2e869