SQL for RALL command
search cancel

SQL for RALL command

book

Article ID: 378446

calendar_today

Updated On:

Products

Jobtrac

Issue/Introduction

What is the SQL to use to pull all data for the RALL command?

Resolution

//*                                                      
//* LIST JOBTRAC JOBS LIKE RALL                          
//*                                                      
//SQLEXEC EXEC PGM=DBSQLPR,                              
//      PARM='PRTWIDTH=999,INPUTWIDTH=72,ROWLIMIT=9999'  
//STEPLIB  DD DISP=SHR,DSN=hlq.CUSLIB                    
//         DD DISP=SHR,DSN=hlq.CAAXLOAD                  
//SYSPRINT DD SYSOUT=*                                   
//STDERR   DD SYSOUT=*                                   
//STDOUT   DD SYSOUT=*                                   
//OPTIONS  DD DUMMY                                      
//SYSIN DD *                                             
SELECT JOBNAME                                          
       FROM SYSUSR.CAHD_0161_EVT                         
       WHERE HIST_IND = 'N';                             

The example below just show the Jobname.  You can run the job with an "*" to see all of the fields available for the SQL report:

SELECT *                      
       FROM SYSUSR.CAHD_0161_EVT     
       WHERE HIST_IND = 'N';         

Then you put the fields separated by commas you would like to see: 

SELECT JOBNAME, OSD, JOB_NUMBER                      
       FROM SYSUSR.CAHD_0161_EVT     
       WHERE HIST_IND = 'N';         

The RALL command formats some of the fields after reading them from the database and you will not see the time like "AS-AP": or Current Status "COMPLETE" from the SQL report. 

Additional Information