ADASEL Scenarios

This document provides some discussion of specific ADASEL scenarios:


Selecting End Transaction (ET) Information

You can select end transaction (ET) information from the protection log (PLOG) using the Adabas ADASEL utility. The SELECT statement parameter, ETCMD, allows you to select only ET information for an ADASEL run. ET information is not included if you specify SELECT ALL.

Note:
ET information is not field or transaction-specific; it is user-specific. So if you specify ETCMD in your ADASEL SELECT statement, you must also specify the FROM USER keywords.

Here is an example of the ETCMD parameter in a SELECT statement:

SELECT ETCMD FROM USER                                    
DISPLAY USERTID SESSNUM USERID CMDCOUNT

These statements would generate output similar to the following report:

SEL072-PROCESSING SELECTION REQUESTS --                                              
                                                                                     
SNR   FNR       ISN       USERTID               ET         2013-08-08 10:56:07       
 1                       0000000000000000                                            
      USERTID                                                                        
      SESSNUM 61                                                                     
      USERID                                                                         
      CMDCOUNT 3                                                                     
. . .

Selecting Data by Command Sequence Number

You can use the Adabas ADASEL utility's CMDCOUNT keyword to select and display data from the protection log data set (PLOG) based on the command sequence number. The CMDCOUNT keyword can be used in ADASEL’s DISPLAY statement as well as in value-criterion of ADASEL’s WITH or IF statements.

  • When CMDCOUNT is specified in the value criterion of the WITH or IF statements, the command sequence number can be used to select PLOG records based on their CMDCOUNT values.

  • When CMDCOUNT is specified in the DISPLAY statement, the command sequence number appears in the printed output produced by the ADASEL utility.

In addition, the CMDCOUNT value is stored in any EXTENDED or EXTRACT output produced by ADASEL’s OUTPUT statement. For more information about the layout of the ADASEL’S OUTPUT instruction, read OUTPUT Instruction; for more information about the EXTENDED and EXTRACT output formats of the OUTPUT instruction, read EXTENDED Output and EXTRACT Output.

Note:
The command sequence number in an Adabas PLOG is not unique. There may be multiple occurrences of this number in your PLOG data set. To ensure accurate data selection and processing, we recommend that you select on the date or time values in addition to the command sequence number. The date and time values are also stored in the EXTENDED output produced by the OUTPUT statement. Read Extended Output, for more information.

In the following ADASEL utility statements, records are selected if the command sequence number is less than 13. Once selected, the transaction user ID (TID) and user ID of the users who added, deleted, or updated the records are displayed in addition to the command sequence number and the Adabas session number of each record.

SELECT ALL FROM USER IF CMDCOUNT < 13     
DISPLAY USERTID SESSNUM USERID CMDCOUNT         

Here is sample of the output produced by such ADASEL statements:

SEL072-PROCESSING SELECTION REQUESTS --                                              
                                                                                     
SNR   FNR       ISN       USERTID               ET         2013-08-08 10:56:07       
 1                       0000000000000000                                            
      USERTID                                                                        
      SESSNUM 61                                                                     
      USERID                                                                         
      CMDCOUNT 3                                                                     

Selecting Data by Adabas Session Number

You can use the Adabas ADASEL utility's SESSNUM keyword to select and display data from the protection log data set (PLOG) based on the Adabas session number. The SESSNUM keyword can be used in ADASEL’s DISPLAY statement as well as in value-criterion of ADASEL’s WITH or IF statements.

  • When SESSNUM is specified in the value criterion of the WITH or IF statements, the Adabas session number can be used to select PLOG records based on their SESSNUM values.

  • When SESSNUM is specified in the DISPLAY statement, the Adabas session number appears in the printed output produced by the ADASEL utility.

In addition, the SESSNUM value is stored in any EXTENDED or EXTRACT output produced by ADASEL’s OUTPUT statement. For more information about the layout of the ADASEL’S OUTPUT instruction, read OUTPUT Instruction; for more information about the EXTENDED and EXTRACT output formats of the OUTPUT instruction, read EXTENDED Output and EXTRACT Output.

In the following ADASEL utility statements, records are selected if the Adabas session numbers are less than 1000. Once selected, the transaction user ID (TID) and user ID of the users who added, deleted, or updated the records are displayed in addition to the command sequence number and the Adabas session number of each record. In addition, records written to the PLOG with a C5 command are displayed.

SELECT ALL FROM USER WITH SESSNUM < 1000   
DISPLAY USERTID SESSNUM USERID CMDCOUNT USERDATA  

Here is sample of the output produced by such ADASEL statements:

SEL072-PROCESSING SELECTION REQUESTS --           
SNR   FNR       ISN       USERTID              NEWREC - AI 2013-08-08 10:56:07       
 1     10       2001     E4F0F0F100000000                                            
      USERTID U001                                                                   
      SESSNUM 61                                                                     
      USERID                                                                         
      CMDCOUNT 4                                                                     
              --- USERDATA UNAVAILABLE ---                                           

Selecting Fields for an Output File

The Adabas ADASEL utility can be used for:

Selecting Fields from the PLOG for the EXPAn Data Set

Field names can be specified on the OUTPUT statement with the LOGINFO format, the EXTENDED, the EXTRACT format, or with no format (the default). Field name specifications must be made in the same format as field names are specified in ADASEL’s DISPLAY instruction. In addition, field names should be specified after the EXPAn parameter in the order in which you want the fields written.

Consider the following ADASEL utility statement:

SELECT ALL FROM 24 OUTPUT EXTENDED TO EXPA1 CA FA1 HA2 HB1(3-5) HB2(6-8)

This statement selects all records for file 24 and will use the EXTENDED prefix and write the output to the data set identified in the JCL as EXPA1. The output will include the ISN (by default) and each decompressed field specified in the statement. When you specify fields to be written to EXPA1, the PLOG record output is replaced by the field information requested.

In the original decompressed record, the MU, PE and PE/MU fields include count indicators. However, these count indicators are not included in the output record produced by ADASEL OUTPUT. Instead, each field is treated as a separate entry and is placed in sequential order. This means that, based on the example above, the record written to EXPA1 would have the following format:

common-flds extended-flds isn CA FA1 HA2 HB1(3) HB1(4) HB1(5) HB2(6) HB2(7) HB2(8)

The ISN is four bytes and each field has the length specified for it in the FDT.

Here is sample output from such a run:

SEL070-PROCESSING REQUEST STATEMENTS—
SELECT ALL FROM 24 OUTPUT EXTENDED TO EXPA1 CA FA1 HA2 HB1(3-5) HB2(6-8)  
END                                          
SEL071-SELECTION REQUEST NUMBER:   1         
SEL072-PROCESSING SELECTION REQUESTS --      
SEL073-PROCESSING STATISTICS --              
NUM.PROTECTION BLOCK(S) READ:    58          
SELECTION REQUEST -- 1                       
   NUM.REC(S) READ:              4           
   NUM.LOGICAL REC(S) READ:      4           
   NUM.DS SEG(S) REJECTED:       0           
   NUM.REC(S) OUTPUT:            4 
SEL074-END OF JOB --               
Warning:
If you specify an MU, PE, or PE/MU field range, and only part of that range exists in the PLOG, ADASEL will generate filler fields in the OUTPUT record for the fields missing in the PLOG. For example, if you specify HA1-99 in your ADASEL input statement, but only four occurrences of field HA exist in the PLOG, then your OUTPUT record would be "…HA1 HA2 HA3 HA4" and 95 more occurrences of the HA field that would be generated and stored, but comprised of a default padding character appropriate to the field type. In addition, if you select a PE, MU or PE/MU field with the 1-N option (thus selecting all of the member fields of the PE, MU or PE/MU field), you may exceed the length of the EXPAn output buffer, resulting in error SEL105.

Obtaining Counts for MU, PE, and PE/MU Fields

Specify the CNT parameter before any MU, PE, or MU/PE field in the PLOG record to obtain the count for that field. The CNT parameter is only valid after the EXPAn parameter and only before a valid MU, PE, or MU/PE field name.

For an MU or PE field, a two-byte binary counter is output; for a PE/MU field, a four-byte binary counter is output, with the first two bytes used as the counter for the PE and the remaining two bytes used as the counter for the MU.

Consider the following sample OUTPUT statement:

OUTPUT EXTENDED TO EXPA1 AA CNT AF AF1-10

The output data set produced by this OUTPUT statement would have the EXTENDED prefix, then field AA, a two-byte count for field AF (taken from the decompressed PLOG record), and then the values for occurrences 1 through 10 of field AF. If the PLOG only has four occurrences of field AF, ADASEL would pad the remaining six occurrences with a default padding character.

Selecting Special Update Commands

You can select special update commands (delete and insert commands split or migrated) normally reported as a delete and update. The nucleus still works as usual but sets an indicator in the PLOG records so that ADASEL can identify the split or migrated updates. Parameters are available that must be set to explicitly select this behavior. If they are not set, the standard behavior is used. The parameters SPECUPD and RECSYNC explicitly request this functionality.

SPECUPD

This is an additional specification to the selection option (ALL, AI, BI, DELETED, NEW, NEWDEL, UPDATED) which will identify any command that originated as an update and flagged as a split or migrated record.

The PLOG records that have been ‘flagged’ as split, will now show SPCUPD instead of UPDATE.

RECSYNC

RECSYNC specifies that the BI and AI images will be displayed together. When the records are split, the AI image may not follow directly after the BI on the PLOG. RECSYNC will cause ADASEL to hold off reporting the BI SPCUPD until it finds the AI counterpart that matches it. It places the record in a buffer and then processes the two records back to back. This means that data displayed or written out might actually be in a different order than these records occurred on the PLOG.

RECSYNC cannot be specified without SPECUPD being specified. The main difference is, that SPECUPD alone will give you the special updates in the exact order they are written on the PLOG. Specifying SPECUPD with RECSYNC will match the BI and AI before reporting the special update, possibly altering the original location of the records on the PLOG.

The RECSYNC process is achieved by buffering the BI until the AI is found. The buffer can retain up to 10 records originally. If ten records are being retained, and an additional record must be added, then the holding table or buffer is extended by ten records. This buffer continues to be extended if necessary.

Each extension of the table requires approximately 320K of storage. Therefore, please keep in mind that using RECSYNC can cause additional memory allocation. However, the initial GETMAIN is not done until actually needed and the first split is encountered. The RECSYNC parameter also introduces a SEL134 message indicating that a BI/AI pair was found or that an unmatched BI or AI was found, depending if the split occurred over a PLOG switch.

RECSYNC replaces RECORDS in the ADASEL syntax, when it is desired.

Below are examples using the new SPECUPD and RECSYNC parameters.

Consider the following sample SELECT statement:

SELECT ALL SPECUPD RECSYNC FROM FILE 100   
DISPLAY ISN                                 
END

Select all records from file 100 that were added, deleted, or updated and display the ISN. Special updates should be identified. Only display the special update commands when a pair (BI/AI) is found.

Example output:

SEL134 RECSYNC paired BI/AI follows                                             
                                                                                
SNR   FNR       ISN       USERTID              SPCUPD - BI 2015-04-28 22:30:34  
 1    100        6       E4F0F0F600000000                                       
      ISN     6                                                                 
                                                                                
SNR   FNR       ISN       USERTID              SPCUPD - AI 2015-04-28 22:30:34  
 1    100        6       E4F0F0F600000000                                       
      ISN     6                                                                 
                                                                                
SNR   FNR       ISN       USERTID              UPDATE - BI 2015-04-28 22:30:34  
 1    100        7       E4F0F0F700000000                                       
      ISN     7                                                                 
                                                                                
SNR   FNR       ISN       USERTID              UPDATE - AI 2015-04-28 22:30:34  
 1    100        7       E4F0F0F700000000                                       
      ISN     7                                                                 

Consider the following sample SELECT statement:

SELECT ALL SPECUPD RECORDS FROM FILE 3 
DISPLAY AE                              
END

Select all records from file 3 that were added, deleted, or updated. Display the special updates as they occur on the PLOG. The BI and AI may have other PLOG records between them, depending on the nucleus activity and amount of thread switches.

Example output:

SNR   FNR       ISN       USERTID              UPDATE - BI 2015-03-26 15:55:07 
 1     3         1        C014C014                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              UPDATE - AI 2015-03-26 15:55:07 
 1     3         1        C014C014                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              UPDATE - BI 2015-03-26 15:55:07 
 1     3         6        C018C018                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              UPDATE - AI 2015-03-26 15:55:07 
 1     3         6        C018C018                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              SPCUPD - BI 2015-03-26 15:55:07 
 1     3         5        C019C019                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              SPCUPD - AI 2015-03-26 15:55:07 
 1     3         5        C019C019                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              SPCUPD - BI 2015-03-26 15:55:07 
 1     3         2        C021C021                                             
      AE                                                                       
                                                                               
SNR   FNR       ISN       USERTID              SPCUPD - AI 2015-03-26 15:55:07 
 1     3         2        C021C021                                             
      AE