Process Scheduler

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

  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 */

Process Scheduler Run Status (RUNSTATUS) Values

Process scheduler status is stored as numeric values behind the RUNSTATUS field. So, here are the values corresponding to each value.

FIELDVALUE XLATSHORTNAME 
---------- ------------- 
1          Cancel    
2          Delete    
3          Error     
4          Hold      
5          Queued    
6          Initiated 
7          Processing
8          Cancelled 
9          Success   
10         No Success
11         Posted    
12         Not Posted
13         Resend    
14         Posting   
15         Generated 
16         Pending