Explaining the DMWRKJRN command in iCluster
If you haven’t started using the DMWRKJRN command that was introduced at 5.2 TL1 and are still relying on DMXtras HDLTJRNRCV, it’s time to embrace the present! HDLTJRNRCV was very useful, with lots of capabilities for specifying journal retention and for handling remote journals, but DMWRKJRN offers much much more.
The context sensitive help for the command over simplifies things a bit “The Work with Journals (DMWKJRN) command displays a list of journals and their attributes.” What it really does is provide a slick front end to the iCluster equivalent of HDLTJRNRCV – the DLTHAJRCV command. The command provides a display screen to show you all of the journals that are eligible to be worked on, in essence providing a filter to allow you to work on either a subset of the journals on your system or even all journals. The command is shown in the screen shot below.
The first parameter is JRN – consisting of the journal name and library. The journal name can be *ALL for all journals in the specified library (or library list or *ALL libraries), *ALLDATA for all database journals (in other words QAUDJRN is excluded) or a specific or even a generic journal name like PROD* for all journals beginning with PROD. The library can be specific or a number of library list options like *LIBL (all libraries in the library list for the current session), *CURLIB (the current library or QGPL if there is no current library), *USRLIBL (for the current library if it exists plus all libraries in the user portion of the library list) or *ALLUSR (for all user libraries on the system) and finally *ALL for all libraries on the system.
The second parameter is FILTER – where you specify any filtering capabilities. These filters apply to only journals that match the JRN parameter in the command. The parameter has 2 pieces …Check iCluster (*YES or *NO) and Check user exit (*YES or *NO). The defaults are *YES – check iCluster and *NO do not use a user exit to filter journals. This means only journals used by iCluster for replication that match the JRN parameter will be displayed. If both parameters are *NO, then you just get journals that match the JRN parameter. If Check user exit is *YES then the last parameter will be used to call a user exit to determine what journals should be passed to the command for matching the JRN parameter in the command. See the post on Dec 10 2013 for details on the user exit or look at the sample exits JRNEXIT1/JRNEXIT2 in QACLSRC in the ICLUSTER library. Finally if both parameters are yes, then it’s an OR situation, if the journal is used by iCluster OR it satisfies the user exit, it will be passed to the JRN parameter.
So to summarize, everything goes back to the first parameter JRN. Whatever journal names are the result of checking for iCluster use or checking the user exit, are passed to the JRN parameter and only those journals passed that match the JRN parameter are displayed.
To keep things simple for your first pass, use the command DMWRKJRN JRN(*ALL/*ALL) FILTER(*NO) to see everything, but note it may take some time if you have a lot of journals on your system!