Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4002436
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:01:44+00:00 2026-05-20T08:01:44+00:00

I need to find a way to create an alert that will alert me

  • 0

I need to find a way to create an alert that will alert me of the elapsed time of a non-sql batch job. The information on the batch job is recorded in the database.

I have a table named F986110 that records the submission time of these batch jobs. The date is recorded in the JCSBMDATE field as a six number value 1YYDDD, where YY = the last two digits of the current year and DDD is the current day numbered from Jan 1. For example, Feb 25, 2011 would be 111056. The time is recorded in the JCSBMTIME column in a military style hhmmss format, but no leading 0 for times before 10am. There is also a status column that indicates processing (P), waiting (W), and done (D).

My task is to send an alert out for all jobs that are in P or W status for longer than 15 minutes. I’ve been banging my head against this for some time. I’ve found a lot of good stuff that is pointing me in the right direction but having to parse the system time, compare it to each record returned, and alerting on those (if any) that match is beyond my skills.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:01:44+00:00Added an answer on May 20, 2026 at 8:01 am

    Convert JCSBMDATE (1YYDDD) and JCSBMTIME to datetime

    declare @t table (JCSBMDATE char(6),JCSBMTIME varchar(6))
    insert @t select '111056', '104602'
    insert @t select '199365', '81602'
    
    select dateadd(d,
                   right(JCSBMDATE,3)-1,
                   convert(datetime,'01/01/' + substring(JCSBMDATE,2,2),3)) +
           convert(datetime, stuff(
                             stuff(JCSBMTIME,
                                   len(JCSBMTIME)-3,0,':'),
                                   len(JCSBMTIME),0,':'))
    from @t
    

    Reverse conversion which is more index friendly

    select '1' +
           right(year(getdate()),2) +
           right(1000+datepart(dy, getdate()),3) as JCSBMDATE,
           right(1+replace(convert(char(8),getdate(),8),':',''),6) as JCSBMTIME
    

    You can easily adjust getdate() with dateadd(mi,-15,getdate()) to get JCSBMDATE and JCSBMTIME values 15 minutes ago.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to find a way to create a movable (at run time) picture
I need to find some way of displaying a drop-down menu that depending on
I need to find a way how to create files from specific folder in
Good people - I need some help to find a way to create an
I need to create an out-of-process COM server (.exe) in C# that will be
I need to find an efficient way to create a list of sequential words
I need to find a way of grouping rows that occur within 5 minutes
I am using primefaces datatable with clickable rows and I need to find way
I need to find a way to get actual page size in Google Chrome.
I need to find a way to check if the mouse moves in c#,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.