can I check how do I obtain the listing of AS400 OS-specific (not program changes) changes or patches applied on an AS400 system for the year? What are the commands that I should run? Thanks!
At the most basic level, OS level patches
are retrieved for review in this way:
==> DSPPTF LICPGM( 5761SS1 ) OUTPUT(*OUTFILE) OUTFILE(QTEMP/PTF)
The example LICPGM() value is for IBM i 6.1. The value should be changed to match the OS VRM that is currently active. The OUTFILE() can be in whatever library you choose and have whatever valid name you want. I used library QTEMP for my convenience.
Then I ran STRSQL to access interactive SQL. (That was in the same job because of the nature of QTEMP.) I ran this SQL statement:
SELECT SCPTFID, SCSTATUS, SCENST, SCENDT, SCSTDATE
FROM qtemp.ptf
WHERE SCENST <> 'S'
and date(
substr(SCSTDATE,1,6)
concat '20'
concat substr(SCSTDATE,7)
) > '2014-12-31'
and SCPTFID like 'SI%'
Technically, that can miss some "changes" because it leaves 'superseded' PTFs out of the list. It's possible to load and apply a PTF, and then supersede it with a new PTF, and that would leave that intermediate PTF off of the list. If you really need a complete chain of changes (which could become exceedingly complex), you'd want to run a more complex sequence on some appropriate schedule to capture sequences of changes.
Also, the PTFs on the list will be those that had a status change after '2014-12-31'. (If it should be restricted only to '2015', an additional date test should be added to the WHERE-clause to exclude early 2016.) Such a change might simply be from 'Temporarily applied' to 'Permanently applied'. The PTF might have been in 'temporary' status for a long time so that no actual behavior changed but only the status changed. Again, if more specific detail is needed, a more complex script should be done on a schedule.
Note that reviewing only OS level patches
ignores a huge part of the functioning of your system. The behavior of the VM can have much wider and more critical impact, as can changes to various run-time environments and to DB2. The OS relies on those just as your applications do. And the OS itself is somewhat limited compared to some other OSes. For example, the OS isn't even aware of individual DASD (disk) units. Those are handled below the OS level.
Also, "patches", or PTFs, are one kind of "OS change". Another kind of "change" could be something such as a change to the QSYSLIBL system value. A "change" like that could be much more critical than most PTFs would be.
Finally, the above simply lists the PTFs. In order to learn what a given PTF does, it's necessary to study its cover letter. To retrieve cover letters, additional steps are needed.
It's possible to be far more detailed in what the process does, but this is perhaps the simplest starting point.