Code to know whether the Scheduled App Engine ran to success or not

Your rating: None Average: 3.5 (2 votes)

  If &MYRQST.Status = 0 Then /* if Schedule status is success */

      &LOOP = 0;
      While &LOOP = 0
         SQLExec("SELECT A.DISTSTATUS, A.RUNSTATUSDESCR FROM PS_PMN_PRCSLIST A WHERE A.PRCSNAME = :1 AND A.PRCSINSTANCE = (SELECT MAX(B.PRCSINSTANCE) FROM PS_PMN_PRCSLIST B WHERE B.PRCSNAME = A.PRCSNAME)", &MyAppName, &POSTED, &STATUS);
         
         If &STATUS = "Success" And
               &POSTED = 5 Then /* Posted */
            &LOOP = 1
         End-If;
         
         If &STATUS = "Success" And /* Not Posted */
               &POSTED = 4 Then
            &LOOP = 2
         End-If;
         
         If &STATUS = "No Success" Or
               &STATUS = "Error" Then
            &LOOP = 3;
         End-If;
         
      End-While;
     
      If &LOOP = 1 Then
            MessageBox(0, "", 27333, 594, "");  /* Success Msg */
      Else
         If &LOOP = 2 Or
               &LOOP = 3 Then
            MessageBox(0, "", 27333, 595, "");  /* Failed Error Msg */
         End-If;
      End-If; /* If &LOOP = 1 Then */
End-If;

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
7 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.