IBM Support

PTFs: Comparing PTFs between Systems

Troubleshooting


Problem

This document provides a sample SQL for comparing PTFs between systems.

Resolving The Problem

To determine whether all PTFs are on one system, on the operating system command line for each system type the following:

Note: This command can be limited to one or more specific products rather than all products by replacing the LICPGM parameter value *ALL with a specific product name; for example, 5769999 or 5722SS1. In addition, the wanted output depends on the SQL statement used. In the following example, the compare is against only a specific LPP and PTFs on the system. There is no further qualification to show if the PTFs are superseded, Temporarily Applied, Permanently Applied, Not Applied, and so on. Further criteria must be specified.

DSPPTF LICPGM(*ALL) OUTPUT(*OUTFILE) OUTFILE(LIB/OUTFILE)

Press the Enter key.

In this case, System A named the output file ptfa. System b named the output file ptfb. Move both files to the same system.

Find an SQL interface such as STRSQL or System i Navigator. Run SQL scripts, and run the following statement:

select a.SCPPID, a.SCPTFID
from lib/ptfa a exception join lib/ptfb b
on a.scptfid = b.scptfid


This query produces the following output that shows all PTFs on System A that are not on System B:
 
LIC PGM PTF
5722999 MF27652
5722999 MF27621
5722999 MF27597
5722999 MF27559
5722999 MF27513
5722999 MF27455
5722999 MF27452
5722999 MF27432
5722999 MF27349
5722999 MF27344

A reverse of the statement as follows shows all PTFs on System B that are not on System A:

select a.SCPPID, a.SCPTFID
from lib/ptfb a exception join lib/ptfa b
on a.scptfid = b.scptfid


The same procedure can also be done with Query/400 as the following screens show. To start Query/400, on the operating system command-line type the following and press the Enter key:

WRKQRY
 
                              Work with Queries                            
                                                                           
 Type choices, press Enter.                                                
                                                                           
   Option  . . . . . .   1              1=Create, 2=Change, 3=Copy, 4=Delete
                                        5=Display, 6=Print definition      
                                        8=Run in batch, 9=Run              
   Query . . . . . . .   PTFDiff        Name, F4 for list                  
     Library . . . . .     lib          Name, *LIBL, F4 for list            


From the following screen, flag the same options with 1 as shown, and press the Enter key.
Define the Query                    
                                                                     
 Query . . . . . . :   PTFDIFF           Option  . . . . . :   CREATE
   Library . . . . :     LIB             CCSID . . . . . . :      37  
                                                                     
 Type options, press Enter.  Press F21 to select all.                
   1=Select                                                          
                                                                     
 Opt    Query Definition Option                                      
  1     Specify file selections                                      
        Define result fields                                          
  1     Select and sequence fields                                    
        Select records                                                
        Select sort fields                                            
        Select collating sequence                                    
        Specify report column formatting                              
        Select report summary functions                              
        Define report breaks                                          
        Select output type and output form                            
        Specify processing options  

Press F9 to specify an extra file selection. Type both files as shown:
Specify File Selections                  
                                                                     
 Type choices, press Enter.  Press F9 to specify an additional        
   file selection.                                                    
                                                                     
   File . . . . . . . . .   PTFA           Name, F4 for list          
     Library  . . . . . .     LIB          Name, *LIBL, F4 for list  
   Member . . . . . . . .   *FIRST         Name, *FIRST, F4 for list  
   Format . . . . . . . .   QSCPTF         Name, *FIRST, F4 for list  
   File ID  . . . . . . .   T01            A-Z99, *ID                
                                                                     
   File . . . . . . . . .   PTFB           Name, F4 for list          
     Library  . . . . . .     LIB          Name, *LIBL, F4 for list  
   Member . . . . . . . .   *FIRST         Name, *FIRST, F4 for list  
   Format . . . . . . . .   QSCPTF         Name, *FIRST, F4 for list  
   File ID  . . . . . . .   T02            A-Z99, *ID


To change the type of join, type 3 as shown:
 
Specify Type of Join                            
                                                                             
 Type choice, press Enter.                                                    
                                                                             
   Type of join . . . . . . . .   3      1=Matched records                    
                                         2=Matched records with primary file  
                                         3=Unmatched records with primary file


Complete the following screen as shown:
 
 Specify How to Join Files                          
                                                                               
  Type comparisons to show how file selections are related, press Enter.        
    Tests:  EQ, NE, LE, GE, LT, GT                                              
                                                                               
  Field             Test     Field                                              
  T01.SCPTFID       EQ       T02.SCPTFID  
                    EQ                    
                    EQ                    
                    EQ                    
                    EQ                                                                                                    


                                                                          Bottom
                                                                                 
  Field           Text                                                  Len  Dec
  T01.SCCENTRY    Century                                                 1    
  T01.SCDATE      Date                                                    6    
  T01.SCTIME      Time                                                    6    
  T01.SCSRLNBR    Machine serial number                                   8    
  T01.SCXPFID     System licensed program                                 7  
 
Select and Sequence Fields                          
                                                                               
  Type sequence number (0-9999) for the names of up to 500 fields to            
    appear in the report, press Enter.                                          
                                                                               
  Seq   Field             Text                                          Len  Dec
        T01.SCCENTRY      Century                                         1    
        T01.SCDATE        Date                                            6    
        T01.SCTIME        Time                                            6    
        T01.SCSRLNBR      Machine serial number                           8    
        T01.SCXPFID       System licensed program                         7    
        T01.SCXPFREL      System release should be obtained from SCX      3    
        T01.SCXPFMOD      System release should be obtained from SCX      3    
        T01.SCXPFDAT      System release date                             6    
        T01.SCLIB         Library                                        10    
  10    T01.SCPPID        Licensed program                                7    
  20    T01.SCPTFID       PTF                                             7    
        T01.SCPPREL       PTF release should be obtained from SCPTFV      6    


At this point, you can save or run the query report.

Note: If System i Navigator is available, use of Management Central is also an option to compare PTFs between systems.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

25790327

Document Information

Modified date:
18 December 2019

UID

nas8N1017110