Mass update sequence numbers of like CPY library types
Summary: Create a basket of all like CPY library types (or a subset of them) for all application IDs (or a subset of them). Then use ASC's basket processing to assign a sequence number to each of the selected library types (in A.A.2).
Notes:
- A similar approach can be used for like LOD library types (just use likeType value '2' instead of '1' in the scenario below.
- The CMNSQNO utility (REXX and CNTL) that comes with CMN/ZMF can also be used to perform updates to sequence numbers of library types. Though the functionality of CMNSQNO is rather limited (and hardcoded), due to which various customizations may be required prior to using it. Moreover it doesn't take into account that an application might be busy or locked (in use) ...
Scenario:
Step 0: Find the XML service available for updating the sequence number of a library type, using ASC's XML search facilities (similar to the search described in Find the XML service to update the appl in use flag). The result of this should be that XML service LIBTYPE/APL/UPDATE can be used for it, i.e. via XML input tag librarySequenceNo.
Step 1: Create a basket of all impacted application IDs, using XML service APPL/PARMS/LIST. This basket should only contain these (output) tags:
- applName (application ID)
- isApplLocked (application locked flag)
- isApplBusy (application in use flag)
Review the content of the basket to ensure that there is no application that is locked or in use (if needed unlock such applications or reset their in use flag, and recreate the same basket until there are no more applications that are in use or locked).
Step 2: Add all (new) sequence numbers for the selected library types in global administration (option A.G.2). The fastest way to do so is probably just using ISPF option A.G.2. However if there are dozens of like CPY library types to be updated, it might be a good idea to create a basket using XML service LIBTYPE/GBL/LIST and then update the sequence numbers in A.G.2 by launching a basket to execute XML service LIBTYPE/GBL/UPDATE (similar to steps 4 to 7 below, though without tag applName).
Step 3: Create a basket of all impacted application IDs (only application ID is needed), using XML service APPL/PARMS/LIST. This basket should only contain (output) tag applName (application mnemonics).
Step 4: Use the basket from step 3 as input to create a new basket containing all impacted library types in A.A.2, using XML service LIBTYPE/APL/LIST. This basket should only contain these (output) tags:
- applName (application ID)
- libType (library type)
- likeType (like attribute)
- librarySequenceNo (current SEQ NO, which may be blank)
Step 5: Edit the basket from step 4 to only retain basket records of library types that are like CPY, i.e. the basket records with likeType=1 (about 3 ISPF edit commands should be sufficient to find those records and eliminate all records that are not like CPY). If needed (to simplify the ISPF edit commands), temporary transform the basket format from variable length columns to fixed width columns.
Step 6: For the remaining records in the basket from step 5, issue appropriate ISPF commands to assign the desired SEQ NO value for each library type (about 3 ISPF edit commands for each libtype should be sufficient to do so). If in step 3 the basket format was temporary transformed from variable length columns to fixed width columns, then transform it back from fixed width columns to variable length columns.
Step 7: Launch the (edited) basket from step 6 to execute XML service LIBTYPE/APL/UPDATE for all impacted like CPY libtypes in all impacted applications, which will actually update the SEQ NO for each library type. Using basket processing option "stop on error" the processing will be interrupted in case an application ID is encountered that is locked or in use again (since step 1). In that case reset the lock or in use flag for such application, and restart the basket processing from the fa