Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Display Last IPL Date/Time
has no ratings.
Published: 18 Jan 2012
Revised: 23 Jan 2013 - 4138 days ago
Last viewed on: 22 May 2024 (14286 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Display Last IPL Date/Time Published by: Bob Cozzi on 18 Jan 2012 view comments(3)

I found this shortcut today while looking for the last IPL Date/Time on the system.

The old "Start CPF" (SCPF) job's start date/time is it.


Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bdietz400
Premium member *
columbus, oh
Comment on: Display Last IPL Date/Time
Posted: 12 years 4 months 5 days 11 hours 12 minutes ago

Here is the one I created years ago:

 DCL        VAR(&DATA) TYPE(*CHAR) LEN(150)                   
 DCL        VAR(&BIN) TYPE(*CHAR) LEN(4) VALUE(X'00000096')   
 DCL        VAR(&CEN) TYPE(*CHAR) LEN(1)                      
 DCL        VAR(&YY) TYPE(*CHAR) LEN(2)                       
 DCL        VAR(&MM) TYPE(*CHAR) LEN(2)                       
 DCL        VAR(&DD) TYPE(*CHAR) LEN(2)                       
 DCL        VAR(&HH) TYPE(*CHAR) LEN(2)                       
 DCL        VAR(&M) TYPE(*CHAR) LEN(2)                        
 DCL        VAR(&SS) TYPE(*CHAR) LEN(2)                       
 DCL        VAR(&FMT) TYPE(*CHAR) LEN(8) VALUE('JOBI0400')    
 DCL        VAR(&JOB) TYPE(*CHAR) LEN(26) +                   
              VALUE('SCPF      QSYS      000000')             
 DCL        VAR(&JOBI) TYPE(*CHAR) LEN(16)                    
 CHGVAR     VAR(&CEN) VALUE(%SST(&DATA 63 1))                 
 CHGVAR     VAR(&YY) VALUE(%SST(&DATA 64 2))                  
 CHGVAR     VAR(&MM) VALUE(%SST(&DATA 66 2))                  
 CHGVAR     VAR(&DD) VALUE(%SST(&DATA 68 2))                  
 CHGVAR     VAR(&HH) VALUE(%SST(&DATA 70 2))                  
CHGVAR     VAR(&M) VALUE(%SST(&DATA 72 2))                
CHGVAR     VAR(&SS) VALUE(%SST(&DATA 74 2))               
SNDPGMMSG  MSG('The system was last IPL''d on ' || &MM +  
             || '/' || &DD || '/' || &YY || ' at ' || +   
             &HH || ':' || &M || ':' || &SS || '.')       

Posted by: Viking
Premium member *
Comment on: Display Last IPL Date/Time
Posted: 12 years 4 months 5 days 10 hours 13 minutes ago

Bob, yup that date/time seems correct on our system.

bdietz400, here's the rpg I have from somewhere way back when that also uses QUSRJOBI:


      //  Display last IPL Date/Time

     d #msg            s             50A   inz

     D #data           s            150A   Inz
     D #bin            s              4A   Inz(X'00000096')
     D #fmt            s              8A   Inz('JOBI0400')
     D #job            s             26A   Inz('SCPF      QSYS      000000')
     D #jobi           s             16A   Inz

      // Prototype for qusrjobi
     D qusrjobi        PR                  EXTPGM('QUSRJOBI')
     D #data                        150A
     D #bin                           4A
     D #fmt                           8A
     D #job                          26A
     D #jobi                         16A


        qusrjobi ( #data : #bin : #fmt : #job : #jobi );

        #msg = 'Last IPL: ' + %subst(#data:66:2) + '/'
                            + %subst(#data:68:2) + '/'
                            + %subst(#data:64:2) + ' at '
                            + %subst(#data:70:2) + ':'
                            + %subst(#data:72:2) + ':'
                            + %subst(#data:74:2) + '.';

        DSPLY %trim(#msg);

        *inlr = *on;




Posted by: bobcozzi
Site Admin ****
Comment on: Display Last IPL Date/Time
Posted: 12 years 4 months 5 days 9 hours 22 minutes ago

Looks like the QUSRJOBI API is another way to get to it too. I find that I so seldom need to know that info, that using the DSPJOB command is good enough--but good to know we can use the API inside a program  if necessary.