Time duration taken for a job to complete

Hi
How do I konw what is the time duration that has taken for any job to be completed  I am looking  in RSMO and i am able to see the start time in the header tab for a job .how do i see the completed time??
Thanks
Sheetal

Hi Sheetal,
Double click on the start time a popup box would appear in that you can watch the End time as well.
Also below the Start time you can watch Run time as well,ie the Total Time taken to complete the data load.
or
you can check in SM37,
Copy the Reuqest name from monitor screen and paste it in the SM37 enter the name of the person who scheduled it or enter* to select all users.
you can find the Job details of that particular request.
Hope this helps.
Regards,
Ravikanth

Similar Messages

  • Waiting for scheduling job to complete. Job ID...and it never completes

    I have created my first Publication. It's a pretty basic single source document, single Dynamic Recipients list publication.
    When I run it in Test mode (I haven't tried it in non-Test mode yet), the document(s) are never delivered.
    When I view the Log File, everything looks fine. The second and last entry in the log says
    "- The global delivery rule for this publication was met; publication processing will now begin."
    The Status Message I see in the Publication History is:
    "Waiting for scheduling job to complete. Job ID:3,879, name:Unviewed Invoices Report (Copy), kind:CrystalReport in Pending state (FBE 60509) [0 recipients processed.] "  and it never changes. I've tried this several times, creating new publications with the same source documents, and the same thing always happens.
    Any help would be appreciated.

    All of the servers were configured correctly.
    It turned out to be my source document, a report, had some field in it that BOE didn't like.
    I removed a bunch of fields and added them back, one by one, and couldn't make the error occur again.
    Go figure.

  • Runn time error "CNTL_ERROR" for batch job created for program RBDAPP01

    We have encounter run time error and the batch job for program RBDAPP01 was terminated.
    Information on where terminated
        Termination occurred in the ABAP program "CL_GUI_CUSTOM_CONTAINER=======CP" -
         in "CONSTRUCTOR".
        The main program was "RBDAPP01 ".
        In the source code you have the termination point in line 62
        of the (Include) program "CL_GUI_CUSTOM_CONTAINER=======CM001".
        The program "CL_GUI_CUSTOM_CONTAINER=======CP" was started as a background job.
    Can any member reachout help in identifying the reason.

    Hi Amol,
    Check the following link.
    Call Transaction 'VL32N' in background: termination with Exception
    Regards,
    Raju.

  • Maximum Time Trigger Email for Informatica Job

    We just start implement the job event notification in Tidal.
    We are in Tidal 5.3.1 with informatica adaptor. We set up the max and min time for the Job.
    I set up the Tidal event trigger that came out from the box - "Job running longer than its maximum time".
    associate with the email action for that event
    However, somehow even the job execution didn't exceed the maximum time we set up in the definition. It still triggers the email....
    And most interesting is the finish time doesn't match with what show in Tidal and the total runtime is always 60 seconds.
    Does anyone have similar issue ?
    Karen

    Hello Sampath,
    Note 553953 explains in details how to monitore specific jobs. After that you should configure the autoreaction metohd as described on the following online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/content.htm
    And finally, you should assign this method to the MTE in:
    RZ20
    SAP CCMS Monitor Templates
    Background Processing
    System Wide
    Background
    Background Job Monitoring
    <the job name>
    Select the Status one and click on Properties -> Methods and assign the method you have created.
    Regards,
    Tiago

  • Batch job scheduling based on Event AND for the job to complete

    I am trying to schedule a background job based on an event AND based on the job finishing itself.
    Example:
    Job name: Send_Message
    After Event: SAP_NEW_PROCESS Message
    Program:  Program xxxx
    I want that the Send_Message job only runs when the Event SAP_NEW_PROCESS message happens AND the Send_Message job is not running.
    Right now, I could only schedule it based on the event SAP_NEW_PROCESS Message which means that everytime this event happens the job runs and I end up having the job "Send_Message" in multilple intances where the others will immediately cancel since the first job is still running and so I end up with a lot of Cancelled job when it is not necessary to run them all when there is already 1 instance of the Job running.
    How do I set it up in SAP?

    Thanks but I am new to SAP having to set up a batch job.
    The Event "SAP_NEW_PROCESS_MESSAGES" is a standard SAP Event.  We used that such that when a new transaction comes in, the batch job will run but we don't want to run the batch job if the same batch job is already running.
    YOu mentioned that I should set up Job_0.  Do I need to create an ABAP prorgram to check if JOB_1 is running?  How do I set up Job_0?  What is the trigger for my Job_0 to run?
    You also said that I set up Job_1 and trigger that based on the outcome of Job_0 AND at the same time be triggered by the event "SAP_NEW_PROCESS_MESSAGES".  How do I set up  this Job_1 so that it can be triggered by both Job_0 and a new transaction coming in(SAP_NEW_PROCESS_MESSAGES).
    if you can provide me the step by step guide as I am new to this and I only know basic.
    The current set up I have is
    Job_1
    Job Start:
          After Event
                Event: SAP_NEW_PROCESS_MESSAGES
          Step 1: program to run RCOCB002
    I was thinking following your suggestion is this:
    Job_0
    Job Start
          After Event
                Event: SAP_NEW_PROCESS_MESSAGES
          Step 1: program to run - What will be my program to run?
    Job_1
    Job_Start
          After Event
                Event: What will be my trigger for Job_1 and how do I set it up?
          Step 1: program to run RCOCB002
    Edited by: Shirley Te on Mar 10, 2010 3:25 PM

  • Waiting for a Job to Complete

    Hi,
    How would people suggest waiting for a background process (a job submitted using APEX_PLSQL_JOB) to complete.
    I'm thinking of having an On Demand that can query the job status and then calling this from a piece of JavaScript which polls periodically (e.g. every 30 seconds using the setTimeout function).
    Does anyone have any pointers to something more elegant?
    Many thanks,
    Gareth.

    Hi
    Interesting one this, check out this link [http://www.oraclequirks.com/]
    Half way down the page on the left there's a link titled 'Yocoya's Flash Progress Bar Indicator Live Demo' that you might find useful.
    Cheers
    Ben

  • How much time it takes for a job status to get updated in to TBTCO table?

    Hi all,
    We have a program that fetches the Job count and job name from a third party tool(UC4) and then searches for the status of the job in the TBTCO table.
    In some rare cases we found that the TBTCO table had not updated with the Job details when the call was made to it.
    Do we have any SAP scheduler settings which determines after a particular time the status gets refreshed in the TBTCO table once the job is triggered?

    hi may be checking Sy-subrc and using wait for X seconds should be a convenient way to code.
    I doubt if there is any schedule to update the table..

  • OnAlarm Time duration setting for OnAlarm in Pick activity

    Hi,
    My internal sysnchronous transaction time is 120 sec. So when I call a PL/Sql procedure using the DB adapter synchronously, my process is throwing Timeout error. In order to come out from this I am thinking to have a Pick activity (similar like 108.Timeouts example) after invoking the DB and then in the PICK activity I want to specify some longer time. But I am wondering if I can give big amount like hours or days which is more than the default time? In this case I hope again the time out will happen in the Pick Activity? mmmmm, am I thinking right?
    Or the transaction won't expire unless the Alaram is triggered?
    --Khaleel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    It is not sensible to have a synchronous process with timeouts in hours or days, since the engine holds a thread in memory until it completes, you are therefore holding onto resources which prevents them from being used by other requests, and you will suffer from performance problems. This should really be made an asynchronous process.

  • Too much time is taken for my ipod 4th gen to sync

    My iPod is taking hours and hours to sync songs, and fixes?

    iPods do not work with "accounts."  They work with your iTunes library.  You don't have to set up a new iTunes library for each iPod.  One iTunes library can sync with as many iPods, iPhones, and iPads as your own, at the same time.  iTunes connects to and treats each device separately.
    However, if your iPod nano is set up for automatic syncing with an iTunes library that is NOT your current iTunes library, you cannot sync your current library to it without replacing its existing content.  Do you have access to the previous iTunes library, the one the iPod currently synced to?  If so, you should transfer your song files from that iTunes library to your current iTunes library.  Then, sync our iPod to your current iTunes library.  You can post back to get more info about the procedure.
    If you don't have access to that previous iTunes library, the approach is to first offload the song files from the iPod to your computer's drive, then add the song files to your current iTunes library.
    You cannot use iTunes to transfer song files from iPod to computer, except for songs purchased from the iTunes Store.  However, there are third-party methods and utilities that can transfer from iPod to computer.  If you do a Google search on something like "ipod transfer," you should get some links.
    You can then sync your iPod to your "consolidated" iTunes library.

  • How to show the processing time taken for a BPEL process in BAM report.

    Hi All,
    I have the data as below in the Data object. I would like to show the time taken for each order to complete in the report.
    instance Id     order Id     product Name     product Code     price     status     instance Time      updaterName
    1360010     ord004     Guitar     prod003     2000     requested     9/22/2008 12:12:11 PM     Invoke_InsertSalesOrder
    1360010     ord004     Guitar     prod003     2000     Approved     9/22/2008 12:15:11 PM     Invoke_OrderStatusUpdate
    This data comes from simple BPEL process where sensors are configured at the start and end of BPEL process. Also have a human task activity in between to create the time difference.
    In Enterprise link design studio, I tried to calculate the time difference using expression calculator and store it as calculated field. But that doesn't seems to work because when I execute the plan, second sensor data reaches only after human approval whereas first sensor data would be waiting for calculation and ultimately nothing comes into data object.
    How and where the calculation be done to show the processing time in the report. Please someone throw some light on this.
    Regards
    Jude.
    Edited by: user600726 on Sep 30, 2008 1:30 AM

    I would suggest modifying your data object so that the data can all be in a single row and use the sensor at the end of the process to upsert (update) the row created by the sensor at the start of the process. The time difference between two fields in the same row is then an easy calculation on a BAM report -- No EL plan should be needed.

  • Record time duration for fax in vxml

    I am going to get the time duration used for fax sending in vxml:
    <transfer name="mycall" destexpr="'fax://' + phone_num" bridge="false" connecttimeout="120s" maxtime="180s" cisco-longpound="true" cisco-mailtoaddress="'xxxx'" >
    <catch event="telephone.disconnect.transfer">
    <assign name="mydur" expr="mycall$.duration"/>
    <goto next="#timeCount"/>
    </catch>
    </transfer>
    <var name="startTime" expr="new Date();"/>
    <var name="endTime"/>
    <form id="timeCount">
    <block>
    <assign name="document.startTime" expr="startTime.getTime();"/>
    <assign name="document.startTime" expr="Number(startTime);"/>
    <assign name="document.endTime" expr="new Date();"/>
    <assign name="document.endTime" expr="endTime.getTime();"/>
    <assign name="document.endTime" expr="Number(endTime);"/>
    <assign name="mydur" expr="document.endTime - document.startTime;"/>
    </block>
    </form>
    But mycall$.duration is 0 after transferring fax.
    And even if I use codes to count time duration, the duration, mydur, is about the same regardless of the number of pages sent.
    Is it possible to use vxml to record time duration of fax?
    Thank you!

    Paste the following Config:
    sh ver
    sh run
    debug of one call demonstrating the problem :
    debug voip ivr all
    debug vxml all

  • How to determine the time duration of each job for a particular report

    Hi guys,
    I am facing a very interesting problem which I want to share with all of you-hoping to get some input from you
    enlightened fellas :).
    I have vendor and vendor sub-range maintained in one custom table. For each vendor I have got article site combination maintained in another table. The thing is I have to execute this program in background. Now for each vendor I may have only 1 article or multiple articles. So if I schedule the job for 60 min. say then for 1 article the time alloted will be too big and for multiple articles the time alloted may prove to be too small. Another thing from a functional point of view is a vendor which has 1 article today may have more articles added to his name tomorrow (if the customer likes his product the company may buy more from him). So the point is we have to dynamically adjust the time alloted for each job.
    I could not find any utility in ABAP which can do this.
    Can any of you please help me?
    Thanks a lot !
    Hasso.
    Edited by: Hasso14 on Apr 28, 2011 3:06 PM

    Exaactly-only I want to find the best time needed to finish for an article or multiple articles i.e I do not know how many articles will be available for each vendor beforehand before doing a select on the 2 tables. But once I know the number (maybe 1 or more than 1) I want to allot the best time for that article/lot of articles(maybe JOB_OPEN  technique ?).Also the number of articles may vary over time so the algorithm should take care of that too.-quite a tricky prob :)-I would request the others to see this reply which I think will clarify their doubts.
    Edited by: Hasso14 on Apr 28, 2011 9:03 PM

  • LO Extraction approx time duration for PO Items (2lis_02_itm)

    Hi All,
    We are supposed to use 2lis_02_itm which is a purchase order line items data and this has to be initialized in our organization as previously there were no one using it. But, as we have to use LO extraction for PO item, we have been trying to prepare the cut over plan on how many hours approximately do we need to complete the extraction.
    As there should not be any postings during the LO extraction for PO items, we need to request to down the system for that duration. So, we are trying to estimate the time required from the start till the end of extraction. The data that we have is around in 1.3 Million records in PO header table.
    We tried to extract to the setup table in a LVT system and it took 39 hours to complete.
    I would like to know, on any of your experience, how long will it take and how much was the data load for your case.
    I need your expertise advice on this and is there any way we can initialize the system without downing the system during extraction?
    Appreciate your replies .
    Thanks in advance.

    Hi,
      There is no way for us to predict the run time, since it varies from system to system according to memory and other conditions.
    Also the header table is not a real indication of your runtime, you need to look at the line items (EKPO table). This is because any LO set-up program, always fills the lines items and these have the most data.
    This is what I suggest.
    1) Take dumps of the document ranges in the EKPO table.
    2) Split above document ranges into even chunks. For eg doc# 1 -100 contains 500 items. Doc # 101 -150 contains 500 items. The items should be more or less the same number.
    3) Take a subset of these, say 1000 records and do a set-up run without blocking the documents( there is a check box in the program). Schedule the setup as a background job. In this way, you get the exact runtime of the program for a 1000 records.You can then predict the run time for the ranges mentioned in step 2.
    4) You then need to create parallel jobs, each job contains a different document range( this is because setup tables can be filled in parallel). By optimizing the number of items and then number of parallel jobs you can get a small a time as possible and minimize the downtime.
    5) Once the jobs have completed, you can run an init w/o data transfer and then unlock the system. You can then do repair  fulls while the system is up, since the repairs would be done from the setup tables. Once all the loads are completed, you can begin running your delta ( This would already have started being captured, the moment you ran the setup w/o data transfer.
    Regards.

  • SQL Server Agent daily job indicates completed but stored procedure and tables indicate otherwise -- 2nd time in 4 years also on Sunday?

    Hi
    We have scheduled job running a console application daily. For some reason on Sunday's only the scheduler says it ran successfully but no email confirmation, table entries and the normal processing occurs.
    This happens only on a Sunday and for no explained reason. No problem on the day before or after...
    I think this also happened with Daylight Savings adjustment. Has anyone else encountered this?
    Any ideas or suggestions
    Environment is:
    Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64)   Jun 28 2012 08:36:30   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    Thanks in advance
    George 

    Michelle 
    Thanks for your reply. I was out sick all last week.
    I too suspected our network and/or security features or maintenance.
    Me and my manager decided to include a text log file which we append certain key points for each iteration when the vb.net console app runs to hopefully determine what is happening sporadically. 
    I created many errors and scenarios ( DB and network connectivity, unable to send email) and they were caught and appended to the logfile so all I can do is wait to see when/if this occurs.
    Sincerely 
    George 
    NOTE:  DISREGARD THE "Failure Sending mail" exceptions they disabled it for security reasons and it only works for production jobs and special users  
    DailySerial Feed started at 11:48:34 AM
      Attempting DB Connection 11:48:34 AM
      DB Connection successful 11:48:34 AM
      completed successful 11:48:38 AM  Record count: 153 processed
    DailySerial Feed started at 11:49:37 AM
      Attempting DB Connection 11:49:37 AM
      DB Connection successful 11:49:37 AM
      completed successful 11:49:42 AM  Record count: 0 processed
      SendEmail failed 11:49:44 AM - Failure sending mail.
    DailySerial Feed started at 4:37:42 PM
      Attempting DB Connection 4:37:42 PM
      DB Connection successful 4:37:44 PM
      completed successfully 4:37:44 PM  Record count: 153 processed
      SendEmail failed 4:37:45 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.78:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    DailySerial Feed started at Monday12:50:29 PM
      Attempting DB Connection 12:50:29 PM
      DB Connection successful 12:50:29 PM
      completed successfully 12:50:30 PM  Record count: 153 processed
      SendEmail failed Monday12:50:31 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.78:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    DailySerial Feed started on Monday, March 23, 2015 - 2:31:40 PM
      Attempting DB Connection 2:31:40 PM
      Connection failed Monday 2:31:55 PM  for: server=ITDEVPTENSDEV\sqlserver2008r2yada;database=ICES;Trusted_Connection=True - A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found
    or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
      SendEmail failed Monday 2:31:55 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.70:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
      Rollback Exception 2:31:55 PM - unable to OPEN the DB ConnectionA network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct
    and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) -  - Connection established    
      SendEmail failed Monday 2:31:55 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.70:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    DailySerial Feed started on Monday, March 23, 2015 - 2:36:38 PM
      Attempting DB Connection 2:36:38 PM
      DB Connection successful 2:36:38 PM
      DailySerial feed completed 2:36:38 PM  Record count: 0 processed
      SendEmail failed Monday 2:36:38 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.70:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    DailySerial Feed started on Monday, March 23, 2015 - 2:37:03 PM
      Attempting DB Connection 2:37:03 PM
      DB Connection successful 2:37:03 PM
      DailySerial feed completed 2:37:03 PM  Record count: 153 processed
      SendEmail failed Monday 2:37:03 PM - Failure sending mail.
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.8.86.70:25
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    Imports System.IO
    Imports System.Net
    Imports System.Text
    Imports System.Data.SqlClient
    Imports System.Data.Common
    Public Module DailySerialFeed
        Dim attempts As Integer = 0
        Dim sb As New StringBuilder
        Dim myconnection As New SqlConnection
        Dim m_SqlConnStr As String = My.Settings.SqlConnStr
        Dim strCardAFCExportBatchIDGuid As String
        Dim LogMessage As String
        Dim TotalExtracted As Integer
        Public sSource As String = "DailySerialFeed"
        Public Slog As String = "Application"
        Public sEvent As String = ""
        Public ErrText As String
        Public sMachine As String = "."
        Dim mySqlTransaction As SqlTransaction
        Dim time As DateTime = DateTime.Now
        Dim format As String = "MMM ddd d HH:mm yyyy"
        Dim LogFile As StreamWriter   '  SFTPData\AFC\DailySerialFeedLog.TXT 
        Dim ExceptionString As String
        Public Sub Main()
            Try
                LogFile = New StreamWriter(My.Settings.LogFile, FileMode.Append) ' append to file 
                LogFile.WriteLine("")    '(Environment.NewLine)
                LogFile.WriteLine("DailySerial Feed started on " & Now.ToString("D") & " - " & Now.ToLongTimeString)
                strCardAFCExportBatchIDGuid = System.Guid.NewGuid().ToString
                LogFile.WriteLine("  Attempting DB Connection " & Now.ToLongTimeString)
                OpenDBConnection()
                LogFile.WriteLine("  DB Connection successful " & Now.ToLongTimeString)
                mySqlTransaction = myconnection.BeginTransaction("OuterTransaction")
                'PadSerialNumbers()  Lewycky 7/19/13  Zero digit padding for 8 or 9 digital serial numbers  Disabled                
                'RemoveZeroSerial() ' Lewycky 11/3/11 remove zero serial numbers from being sent to AFC now in FlagSerialforExtract module
                FlagSerialforExtract()
                ExtractFlaggedSerialFile()
                mySqlTransaction.Commit()
                CloseDBConnection()
                StageforFTPAndArchive()
                sb.AppendLine("  " & "DailySerial Feed completed. Record count: " & TotalExtracted & " processed")
                LogFile.WriteLine("  DailySerial feed completed " & Now.ToLongTimeString & "  Record count: " & TotalExtracted & " processed")
            Catch ex As Exception
                If Not mySqlTransaction Is Nothing Then
                    LogFile.WriteLine("  Rollback Exception " & Now.ToLongTimeString & " - " & ex.Message)
                    mySqlTransaction.Rollback("OuterTransaction")
                End If
                sb.AppendLine("  " & "Problem encountered with DailySerialFeed extract :" & ex.Message & " - " & ErrText)
                LogFile.WriteLine("  Rollback Exception " & Now.ToLongTimeString & " - " & ex.Message & " - " & " - " & ErrText)
            Finally
                SendEmail(RTrim(sb.ToString))
                ' if dbconnection is still open during exception/error force it closed
                If myconnection.State = ConnectionState.Open Then
                    LogFile.WriteLine("  Closing DB Connection(2) " & Now.ToLongTimeString & " - ")
                    CloseDBConnection()
                End If
                LogFile.Close()
            End Try
        End Sub
        Public Sub OpenDBConnection()
            myconnection = New SqlConnection(m_SqlConnStr)
            Try
                myconnection.Open()
            Catch ex As Exception
                Dim strErr As String = ex.Message
                LogFile.WriteLine("  Connection failed " & Now.ToString("dddd ") & Now.ToLongTimeString & "  for: " & My.Settings.SqlConnStr & " - " & strErr)
                SendEmail(strErr)
                Throw New System.Exception("unable to OPEN the DB Connection" & strErr)
            Finally
                ErrText = "Connection established    "
                'sb.AppendLine("Connection established   ")
            End Try
        End Sub
        Public Sub FlagSerialforExtract()
            ' Update the batch of records in CardAFCExport table with the GUID related to that batch created earlier
            ' Now included in the same Commmand - removal of any zero digit serial numbers previously in another module 
            Dim myCommand As New SqlCommand
            Try
                ' lewycky pull serial numbers prior to midnite  1 day lag 
                ' lewycky use the GUID created in the Main() for updating in dbo.CardAFCExport indetifying qualifying serial 
                '  numbers for this daily batch to ultimately be sent to AFC and to receive back detailed metrocard data
                myCommand = New SqlCommand("DELETE from CardAFCExport  where CAST(CardSerialNumber as bigint)= 0;Update CardAFCExport Set CardAFCExportBatchID = '" & strCardAFCExportBatchIDGuid & "' where
    CardAFCExportBatchID is null and CreatedDate < DATEADD(dd,0,datediff(dd,0,getdate()))", myconnection, mySqlTransaction)
                myCommand.ExecuteNonQuery()
            Catch ex As Exception
                Dim strErr As String = ex.Message
                ErrText = "unable to update the batch with its GUID  " & strErr & "  "
                sb.AppendLine("unable to update the batch with its GUID." & "  ")
                sb.AppendLine("Error Message : " & ex.Message)
                LogFile.WriteLine("  FlagSerialforExtract failed " & Now.ToLongTimeString & " - " & strErr)
                Throw New System.Exception(strErr)
            Finally
                ErrText = "Serial numbers flagged with GUID successfully   "
                'sb.AppendLine("Serial numbers flagged with GUID successfully   ")
            End Try
        End Sub
        'Public Sub PadSerialNumbers()   7/19/13 Lewycky Disabled per Serial numbers becoming duplicated if the enter with and without zeros
        '    Dim myCommand As New SqlCommand
        '    Try
        '        myCommand = New SqlCommand("update CardAFCExport set CardSerialNumber =  '0' + CardSerialNumber where CardSerialNumber in (SELECT CardSerialNumber FROM CardAFCExport where LEN(cardserialnumber) = 9 )",
    myconnection, mySqlTransaction)
        '        myCommand.ExecuteNonQuery()
        '        myCommand = New SqlCommand("update CardAFCExport set CardSerialNumber =  '00' + CardSerialNumber where CardSerialNumber in (SELECT CardSerialNumber FROM CardAFCExport where LEN(cardserialnumber) = 8 )",
    myconnection, mySqlTransaction)
        '        myCommand.ExecuteNonQuery()
        '    Catch ex As Exception
        '        Dim strErr As String = ex.Message
        '        ErrText = "unable to pad serial serial numbers" & strErr
        '        sb.AppendLine("unable to pad serial serial numbers" & "  ")
        '        sb.AppendLine("Error Message : " & ex.Message & "  ")
        '        SendEmail(strErr)
        '        Throw New System.Exception(strErr)
        '    Finally
        '        ErrText = "Serial numbers padded successfully   "
        '        sb.AppendLine("Serial numbers padded successfully   ")
        '    End Try
        'End Sub
        'Public Sub RemoveZeroSerial()
        '    now in the FlagSerialforExtract module 
        '    '  Zero Serial number deletion still needed ( 8 & 9 digit ) otherwise 999 records will be generated on ICES when AFC returns file
        '    Dim myCommand As New SqlCommand
        '    Try
        '        myCommand = New SqlCommand("DELETE from CardAFCExport  where CAST(CardSerialNumber as bigint)= 0", myconnection, mySqlTransaction)
        '        '        myCommand = New SqlCommand("delete from CardAFCExport where CardSerialNumber = '0000000000' ", myconnection, mySqlTransaction)
        '        myCommand.ExecuteNonQuery()
        '    Catch ex As Exception
        '        Dim strErr As String = ex.Message
        '        ErrText = "unable to remove Zero Serial Numbers" & strErr
        '        sb.AppendLine("unable to remove Zero Serial Numbers.")
        '        sb.AppendLine("Error Message : " & ex.Message)
        '        SendEmail(strErr)
        '        Throw New System.Exception(strErr)
        '    Finally
        '        ErrText = "Zero serial numbers removed   "
        '        sb.AppendLine("Zero serial numbers removed successfully   ")
        '    End Try
        'End Sub
        Public Sub ExtractFlaggedSerialFile()
            ' extract metrocard serial number feed in ascending order and w/o dupes 
            Dim column1 As String
            Dim TotalRecords As Integer = 0
            Dim myCommand As New SqlCommand
            Dim objStreamWriter As StreamWriter
            Try
                ' 7/19/13 - Lewycky modification to remove duplicates and omit the same serial number entered as a 8 or 9 digit number instead of the 
                '           required 10 digit for AFC w/o extra DML updates due to Serialnumber being a Unique value per batch 
                myCommand = New SqlCommand("SELECT DISTINCT RIGHT('00' + Cardserialnumber,10) Cardserialnumber FROM CardAFCExport where CardAFCExportBatchID = '" & strCardAFCExportBatchIDGuid & "' order by
    CardSerialNumber", myconnection, mySqlTransaction)
                '  myCommand = New SqlCommand("SELECT distinct CardSerialNumber FROM CardAFCExport where CardAFCExportBatchID = '" & strCardAFCExportBatchIDGuid & "' order by CardSerialNumber", myconnection,
    mySqlTransaction)
                myCommand.CommandType = CommandType.Text
                objStreamWriter = File.CreateText(My.Settings.AFCExportInterimFile.ToString)
                Dim myreader As SqlDataReader = myCommand.ExecuteReader
                While myreader.Read
                    column1 = myreader.Item("CardSerialNumber").ToString
                    objStreamWriter.WriteLine(column1)
                    TotalExtracted = TotalExtracted + 1
                End While
                myreader.Close()
                objStreamWriter.Close()
                ' Extract file is now created
                myCommand = New SqlCommand("INSERT INTO CardAFCExportBatch (CardAFCExportBatchID, TotalRecords, ExportedDate, CreatedDate, CreatedBy) values ( '" & strCardAFCExportBatchIDGuid & "', " +
    TotalExtracted.ToString + ", GETDATE(), GETDATE(), '00000000-0000-0000-0000-000000000000')", myconnection, mySqlTransaction)
                myCommand.ExecuteNonQuery()
            Catch ex As Exception
                Dim strErr As String = ex.Message
                ErrText = "unable to create extract from CardAFCExport  last input record " & TotalRecords & "' '" & strErr
                LogFile.WriteLine("  ExtractFlaggedSerialFile failed " & Now.ToLongTimeString & " - " & ErrText)
                LogMessage = ErrText
                sb.AppendLine(ErrText)
                sb.AppendLine("Error Message : " & ex.Message)
                SendEmail(LogMessage)
                Throw New System.Exception("unable to create extract from CardAFCExport  last record " & TotalRecords)
            Finally
                ErrText = "Batch Info updated & Extract created. Rec count: " & TotalExtracted
            End Try
        End Sub
        Public Sub StageforFTPAndArchive()
            'KD - Getting file ready for AFC ftp. Also archive the file with date time stamp.        
            Try
                Dim strFileName As String = Path.GetFileNameWithoutExtension(My.Settings.AFCExportInterimFile)
                Dim strDirectory As String = Path.GetDirectoryName(My.Settings.AFCExportInterimFile)
                Dim strTimeStamp As String = Now.ToString("MMddyyyyhhmmss")
                Dim strExtension As String = Path.GetExtension(My.Settings.AFCExportInterimFile)
                'KD : copy AFCSWIPE.TXT file to outgoing folder 
                System.IO.File.Copy(My.Settings.AFCExportInterimFile, My.Settings.AFCExportFile.ToString, True)
                'KD : make  yyyyMMDD_hhmmss_ICE_SWP.TXT file to outgoing folder for MCO (Randy Steiner)            
                System.IO.File.Copy(My.Settings.AFCExportInterimFile, My.Settings.AFCExportFilePath + Now.ToString("yyyyMMdd_hhmmss") + "_ICE_SWP.TXT", True)
                'KD : Archive file in archieve folder with date time stamp            
                System.IO.File.Move(My.Settings.AFCExportInterimFile, My.Settings.AFCExportArchivePath + strFileName + "_" + strTimeStamp + strExtension)
            Catch ex As Exception
                sb.AppendLine("Error occurred in StageforFTPAndArchive." + Chr(13) + Chr(10))
                sb.AppendLine("Error Message : " & ex.Message + Chr(13) + Chr(10))
                LogFile.WriteLine("  StageforFTPAndArchive failed " & Now.ToLongTimeString & " - " & ex.Message)
                Throw ex
            End Try
        End Sub
        Sub SendEmail(ByVal msg As String)
            ' Dim myWebRequest As WebRequest
            ' Dim myStreamReader As StreamReader
            Dim strSubject, strBody As String
            Dim myMailMessage As Mail.MailMessage
            Dim mySmtpClient As Mail.SmtpClient
            strBody = msg
            ' Get subject from settings and replace placeholder with current date
            strSubject = My.Settings.EmailSubject
            strSubject = strSubject.Replace("<date>", FormatDateTime(Now(), DateFormat.ShortDate))
            Try
                myMailMessage = New Mail.MailMessage(My.Settings.EmailFrom, My.Settings.EmailTo, strSubject, strBody)
                If My.Settings.EmailCC <> "" Then myMailMessage.CC.Add(My.Settings.EmailCC)
                myMailMessage.IsBodyHtml = My.Settings.EmailHtml
                ' Send email
                mySmtpClient = New Mail.SmtpClient()
                mySmtpClient.Host = My.Settings.SmtpServer()
                mySmtpClient.Send(myMailMessage)
            Catch ex As Exception
                Console.Write("could not send Mail-" & ex.Message)
                'ExceptionString = "Exception type " & ex.GetType.ToString & Environment.NewLine & "Exception message: " & ex.Message + Environment.NewLine
                '& "Stack trace: " + ex.StackTrace + Environment.NewLine;
                'LogFile.WriteLine(ExceptionString)
                'LogFile.WriteLine("  SendEmail failed " & Now.ToLongTimeString & " - " & ex.Message.ToString & ex.InnerException.ToString)
                ' w.o stack trace ?
                LogFile.WriteLine("  SendEmail failed " & Now.ToString("dddd ") & Now.ToLongTimeString & " - " & ex.Message.ToString & Environment.NewLine & (DirectCast(ex.InnerException,
    System.Exception).InnerException.ToString))
            End Try
        End Sub
        Public Sub CloseDBConnection()
            Try
                myconnection.Close()
            Catch ex As Exception
                Dim strErr As String = ex.Message
                LogFile.WriteLine("  CloseDBConnection failed " & Now.ToString("dddd ") & Now.ToLongTimeString & " for: " & My.Settings.SqlConnStr & " - " & strErr)
                Throw New System.Exception("unable to CLOSE the DB Connection" & strErr)
            Finally
                ErrText = " DB Conn closed & Serial Feed completed normally    "
            End Try
        End Sub
    End Module

  • Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi,
    I believe this would be your Prod system, so don't just cancel it but look at the job log. If it is still processing then don't kill it and wait for the change run to complete but if you can see that nothing is happening and it is stuck for a long time then you can go ahead and cancel it.
    But please be sure, as these kind of jobs can create problems if you cancel them in the middle of a job.
    Regards,
    Arminder Singh

Maybe you are looking for