ASF Utilities and Services

This document covers the following topics:


Introduction

The ASF Utilities and Services are a set of functions which can be started from the ASF Utilities and Services Menu (Main Menu option "A").

The ASF Utilities are used for the management of an ASF system. This includes:

  • "Condensing" of nucleus records to generate averages and/or differences.

  • Transferring (loading) records from a foreign ASF system.

  • Synchronizing the store times of ASF records.

  • Maintenance of the user exits such as the displaying of delta values instead of cumulative values.

  • Demonstrate the use of the Application Programming Interface (API).

The ASF Services are used for the maintenance of an ASF environment. This includes:

  • Display the ASF version and correction status.

  • Maintain the ASF System file settings.

  • Maintain the User Profiles.

  • The diagnosis of ASF with the SYSRDC debugger or with the ASF internal trace facility.

ASF Utilities and Services Menu

graphics/04_01_utilities_services.png

Figure 4-1: ASF Utilities and Services

18:59:42          *** A D A B A S  Statistics Facility ***          2008-01-23
USERID              - ASF Utilities and Services Menu  -            MUM00001  
                                                                               
                 Code                 Service                                  
               -------  ---------------------------------------                
                  A     Condense records to average records                    
                  D     Condense records to delta records                      
                  S     Synchronize / regenerate store times                   
                  T     Transfer from foreign ASF system                       
                  V     ASF Version Information                                
                  F     ASF System File Maintenance                            
                  P     Profile Maintenance                                    
                  X     Userexit Maintenance                                   
                  I     ASF Application Program Interface                      
                 1/2    API Example 1/2                                        
                 R/M    SYSRDC Debugger / ASF Trace Maintenance                
                 ./?    Terminate / Help                                       
               -------  ---------------------------------------                
     Enter code:  _                                                            
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-2: Menu for ASF Utilities and Services

Purpose

The menu lists the available ASF Utilities and Services. You can select one of the listed items by typing the corresponding one-letter code in the "Enter code" field. When you have entered the input data, press ENTER to activate the function.

Screen selection

This menu is reached by selecting the service code "A" in the Main Menu.

Description

The following table lists the utilities and services available.

Code Description
A Condense records to average or modified average records on a daily, weekly or monthly basis.
D Condense records to difference records on a daily, weekly or monthly basis.
S Synchronize the store times of nucleus records, or regenerate the original store times in records which were previously synchronized.
T Transfer (load) records from a foreign ASF system.
V Receive information about the current installed ASF version, the last correction applied, the ASF system file numbers, and more.
F Switch to another ASF environment by changing the ASF system file settings (ASF Data and ASF Profiles).
P Maintain the General User Profile, the e-Mail Profile and the Con-nect Profile.
X Maintain the ASF User Exits such as "Display delta values". The ASF User Exit menu is described in the section User Exit Maintenance Menu.
I Test the Application Programming Interface (API) subprogram ASFGET01 to retrieve and display ASF records.
1 Run the API example 1.
2 Run the API example 2.
R Analyze ASF with the SYSRDC debugger.
M Debug ASF with the ASF Trace Facility.

Condensing Nucleus Records

General

Since the proper use of condensed records can be very beneficial in the management of your ASF system, the following section has been included as a guide to usage.

ASF offers the utility functions "Condense Records to Average Records" and "Condense Records to Delta Records", both of which generate new "condensed" records which contains averages and/or differences of the ASF data fields in a set of nucleus records. The following paragraphs contain general information concerning the purpose of such condensed records.

In an ASF system, nucleus records are typically stored daily at the end of the online operation. Over the period of 1 month, this results in about 20 daily records (one record per weekday). If you wish to make an evaluation over a longer period of time, for example 6 months, this would require the data from about 120 nucleus records. In many cases, however, it would be sufficient to use a representative set of data for each month, based on the average values of each of the individual ASF data fields.

For this purpose, the utility function "Condense records to average records" is provided. This function generates new records, each containing average values from a set of nucleus records which were created over a given period of time, for example one week or one month.

In an environment in which the nucleus is shut down and restarted every day, average values can be calculated for cumulative ASF data fields (such as READ ASSO) as well as for non-cumulative ASF data fields (such as ASSO USED). Records containing such average values are called average records. If, however, the nucleus is run in a 24-hour environment (no daily shutdown), it is meaningless to calculate average values for the cumulative ASF data fields, since these values are not reset to 0 every day in this environment. Therefore, in order to generate a representative set of data for a given period of time (for example, one week or one month) in a 24-hour environment, differences (instead of averages) are calculated for the cumulative ASF data fields and averages are calculated for the non-cumulative ASF data fields. Records containing this combination of average and difference values are called modified average records.

In an environment with a daily shutdown, you can generate either average records or modified average records. In a 24-hour environment, only modified average records can be used, since it is not meaningful to calculate average values for cumulative ASF data fields in this environment.

For some special calculations it can be useful to summarize the differences which have occurred in the ASF data fields over a given period. For this purpose, the utility function "Condense records to delta records" is provided. With this function, differences are calculated for both cumulative and non-cumulative ASF data fields in 24-hour environments as well as in environments with a daily nucleus shutdown. The records thus created are called difference records. Unlike the average records discussed above, such difference records are not representative of the values of the ASF data fields during the time period; they express only how values have changed.

The following examples show the circumstances in which condensed records are generated.

Example 1: Daily Nucleus Shutdown

graphics/04_03_daily_shut.png

Figure 4-3: Example with daily nucleus shutdown.

Figure 4-3 shows in graphical form the values which were recorded on a daily basis over the period of 1 week for the cumulative ASF data field READ ASSO and the non-cumulative ASF data field ASSO USED. The values were recorded in an environment where the nucleus was shut down and restarted every day.

For the field READ ASSO, and for all other cumulative ASF data fields, there are two ways to "condense" the values:

  • The average daily value can be calculated from Monday to Sunday, or

  • the difference from Sunday to Sunday can be calculated, thereby giving the total number of ASSO reads for the week.

For the field ASSO USED, and for all other non-cumulative ASF data fields, there are also two ways to condense the values:

  • The average daily value can be calculated from Monday to Sunday, or

  • the difference from Sunday to Sunday can be calculated, thereby giving the increase in Associator space allocation during the week.

If you select the utility function "Condense Records to Average Records", average values as described in this example are calculated for all cumulative and non-cumulative ASF data fields. The records which are generated are average records.

Similarly, if you select the utility function "Condense Records to Delta Records", differences as described in this example are calculated for all cumulative and non-cumulative ASF data fields. The records which are generated are difference records (also called delta records).

graphics/04_04_24_hour.png

Figure 4-4: Example for 24-hour environment (no daily nucleus shutdown).

Figure 4-4 shows in graphical form the values which were recorded on a daily basis over the period of 1 week for the cumulative ASF data field READ ASSO and the non-cumulative ASF data field ASSO USED. The values were recorded in an environment where the nucleus was run continuously in a 24-hour environment.

For the field READ ASSO, and for all other cumulative ASF data fields, there is only one meaningful way to condense the values:

  • The difference from Sunday to Sunday can be calculated, thereby giving the total number of Associator reads for the week.

For the field ASSO USED, and for all other non-cumulative ASF data fields, the same possibilities exist as for running in an environment with a daily shutdown, so meaningful averages and differences can be calculated.

Here, the utility function "Condense Records to Delta Records" can be used for both cumulative and non-cumulative ASF data fields.

However, since average values are only meaningful for the non-cumulative ASF data fields in a 24-hour environment, the utility function "Condense Records to Average Records" should be used with the field "24-hr environment" marked, resulting in the following processing:

  • Averages are calculated for the non-cumulative ASF data fields.

  • Differences are calculated for the cumulative ASF data fields.

The records which result are modified average records, and they contain a combination of average values for the non-cumulative ASF data fields and differences for the cumulative data fields.

Summary of the Condensed Record Types

Average Records:

  • Suitable for databases with a daily shut down, not suitable for databases in a 24-hour environment.

  • The condensed records summarize the nucleus records over a given period of time (for example, 1 month).

Difference Records:

  • Suitable for databases with a daily shut down and for databases in a 24-hour environment.

  • The condensed data represents only changes (for example, ASSO USED = 0) in ASF data fields over a period of time. Such data can be useful for special applications, but since absolute values are missing, the data in such records is not entirely representative.

Modified Average Records:

  • Suitable for databases with a daily shut down and for databases in a 24-hour environment.

  • The condensed records contain average values for non-cumulative ASF data fields and differences for cumulative data fields.

  • The condensed records summarize the nucleus records over a given period of time (for example, 1 month).

When planning your ASF system, you should choose only one of these methods. If you are running your database in a 24-hour environment, there is only one choice, namely modified average records. If you shut down and restart the nucleus every day, you can choose any of the methods. Average records have the advantage that the values calculated for the cumulative ASF data fields such as READ ASSO are the daily average values which you already know from the Adabas utility ADAREP or the nucleus end session summary. Furthermore, ASF can calculate these average values faster than if the nucleus is run in a 24-hour environment.

Method

The basic administrative method for creating condensed records for use in evaluations is:

  • Run the appropriate condense function to access all the nucleus records stored for a given period, for example 1 month, and generate new condensed records containing average and/or differences for the ASF data fields.

  • Generate the condensed records for a given period of time, for example 1 month, at the start of the next period.

  • Assign a special Store Type to the condensed records, so that they can be used in all of the available 10 types of ASF evaluations (see the description of the special Store Types later in this section).

Delta values displayed by the User Exit

When you activate the first user function of ASFUEX01, delta (difference) values are displayed in every evaluation. This function is described in details in the section Displaying Delta Values. We outline here the difference between condensing records and the values displayed with the user exit ASFUEX01:

  • The user exit shows the difference of two succeeding ASF record. It does not "condense" multiple records into one.

  • The user exit shows only virtual values, i.e. the values are calculated while the evaluation runs. No records are stored on the ASF Data file.

  • The user exit processes only cumulative values. Non-cumulative values remain and are displayed as they are.

  • The user exit works as-is for daily shut down and 24-hour environments. It can compare databases of both types in one evaluation.

  • The user exit can be modified, e.g. to display differences of non-cumulative fields. But in general, the delivered user exit should be sufficient.

  • No special procedure is required for the generating of the delta values with the user exit. It is just a "switch on and see".

Condense Records to Average Records

 18:21:41          *** A D A B A S Statistics Facility ***           2008-01-24
 USERID        - Condensing nucleus records to average records -     MSV00001  
                                                                               
                                                                               
                   Code                 Service                                
                 -------  -------------------------------------                
                    S     Start condensing                                     
                    ?     Help                                                 
                    .     Terminate                                            
                 -------  -------------------------------------                
       Enter code : _                                                          
                                                                               
   Snapshots from : __________ , 00:00  to  __________ , 23:59                 
    Store profile : ________________    ID:                                    
       Store type : __                                                         
24 hr environment : _                   <=  delta method for cumulative fields 
                                                                               
Generate st. type : __                      Condensing period : __             
 Reduced on DB-ID : _____                   Restart from reduced DB-ID : _     
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-5: Menu for condensing nucleus records to average records.

Purpose

This menu is used for generating average records or modified average records. Average records contain daily, weekly or monthly average values of ASF data fields. Modified average records are similar to average records, but for cumulative ASF data fields a difference is calculated instead of an average. Therefore, each modified average record contains a mixture of average and difference values.

Screen selection

This menu is reached by selecting the service code "A" in the ASF Utilities Menu.

Description

ASF reads the nucleus records which meet the selection criteria, and generates new average records which contain the averages of the individual numerical ASF data fields. If you mark the field "24 hr environment", modified average records are generated instead of average records. The period of time to which each condensed record refers is defined in the input field "Condensing period". In each condensed record, the non-numerical ASF data fields are set to the values from the last nucleus record processed for the condensed record.

Daily Shutdown/24-Hour Environment

A distinction is made between a 24-hour environment (the nucleus runs continuously) and daily shutdown (the nucleus is shut down and restarted every day).

For operation with a daily shutdown, in which cumulative ASF data fields such as READ ASSO are reset to 0 every day at nucleus startup, records are condensed so that averages are calculated for both cumulative and non-cumulative ASF data fields. Such records are called average records.

In a 24-hour environment, the nucleus runs continuously, so cumulative ASF data fields such as READ ASSO are NOT reset to 0 every day. In this case it is meaningless to calculate average values for the cumulative ASF data fields, so instead the records are condensed so that

  • Differences are calculated for the cumulative ASF data fields and

  • averages are calculated for the non-cumulative ASF data fields.

Such records are called modified average records.

Note:
The function Condense Records to Delta Records (Code D), described later in this section, generates a third type of condensed record, namely difference records.

Special ASF Data Fields for Condensed Records

ASF writes values into the following special ASF data fields of the condensed records:

ASF Data Field Description
CONDENSED FROM D

For average records, this contains the date of the first selected nucleus record in the specified period.

For difference records and modified average records, this contains the date of the most recent nucleus record before the start of the selected period.

CONDENSED TO DAT For average records, modified average records and difference records, this contains the date of the last selected nucleus record in the specified period.
RECORD TYPE

This field indicates the method (average, modified average or difference) and the time period (day, week, month or entire period) which was used to generate the condensed record.

The values for monthly condensed records are:

AverMonth average records

AvDelMonth modified average records

DeltaMonth difference records

Corresponding values exist for Week, Day and FromTo (entire period).

STORE-DATE For monthly condensed records, this field is set to the 15th of the month. For weekly condensed records, this field is set to the date of the Wednesday of the week.
STORE-TIME ASF always sets this field to 12:00.
SYNC-DATE (same as STORE-DATE).
SYNC-TIME (same as STORE-TIME).

Service Codes

Code S: Start condensing

Select this code to start condensing nucleus records to average records or modified average records.

Input field description

Enter code:

The code of the service you wish to activate.

Snapshots from ... to:

The time frame (starting date/time and end date/time) for which condensed records are to be generated.

You can specify the date in either absolute or relative format. For further details, refer to the section Absolute and Relative Date Format.

The time frame should be big enough for the condensing period selected. For a condensing period "DA" it should cover the next day, for "WE" the next Monday, for "MO" the first day of the next month.

Store profile:

The Store Type used by the Store Program while the data was being collected. Type "*" to get an active help list.

Store type:

The Store Type used by the Store Program while the data was being collected. Type "*" to get an active help list.

24 hr environment

If you mark this field, ASF generates modified average records, which contain average values for non-cumulative ASF data fields and difference values for cumulative ASF data fields.

If you do not mark this field, ASF generates average records, which contain average values for both cumulative and non-cumulative ASF data fields.

Generate st. type

The Store Type which ASF assigns to the generated records.

Software AG recommends you to use Store Types whose names begin with a special character such as "+", "&" or "#", in order to differentiate between condensed records and nucleus or trend records. The following Store Types are predefined in ASF for average records and modified average records:

Store Type Description
+D daily modified average records (24-hour environment)
+F one modified average record (24-hour environment) for the entire period
+M monthly modified average records (24-hour environment)
+W weekly modified average records (24-hour environment)
#D daily average records, nucleus restarted daily
#F one average record for the entire period, nucleus restarted daily
#M monthly average records, nucleus restarted daily
#W weekly average records, nucleus restarted daily

Condensing period

The unit of time which each condensed record represents. Valid values are: DA (daily), WE (weekly), MO (monthly), and FT (from-to). Type "*" to get an active help list.

If you specify DA, ASF generates one condensed record for each 24-hour period in the entire period.

If you specify WE, ASF generates one condensed record for each 7-day period (Monday to Sunday) in the entire period.

If you specify MO, ASF generates one condensed record for each calendar month in the entire period.

If you specify FT, ASF generates one condensed record for the entire period.

Reduced on DB-ID

If you enter a database ID in this optional input field, then data will be stored only for the database specified. The database ID must be one of those defined in the Store Profile.

If, however, you mark the field "Restart from reduced DB-ID", the ID you specify in the field "Reduced on DB-ID" is the ID of the database at which ASF restarts processing after a previous run of the function was aborted. You can determine the database ID at which the previous run was aborted by examining the job output from that run.

Restart from reduced DB-ID

Mark this field if you want to restart a previously aborted run of the condense function. Specify the ID of the database with which ASF is to restart in the field "Reduced on DB-ID".

Condense Records to Delta Records

18:22:45             *** A D A B A S Statistics Facility ***           2008-01-24
USERID           - Condensing nucleus records to delta records -       MSV10001  
                                                                               
                                                                               
                   Code                 Service                                
                 -------  -------------------------------------                
                    S     Start condensing                                     
                    ?     Help                                                 
                    .     Terminate                                            
                 -------  -------------------------------------                
       Enter code : _                                                          
                                                                               
   Snapshots from : __________ , 00:00  to  __________ , 23:59                 
    Store profile : ________________    ID:                                    
       Store type : __                                                         
      Nucleus end : EN end nucleus      <=  store type of nucleus-end records  
                                                                               
Generate st. type : __                      Condensing period : __             
 Reduced on DB-ID : _____                   Restart from reduced DB-ID : _     
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-6: Menu for condensing nucleus records to delta records.

Purpose

The menu is used for generating difference records (also called delta records). These records contain daily, weekly or monthly difference values of ASF data fields. A single difference record can also be generated for the entire period.

Screen selection

This menu is reached by selecting the service code "D" in the ASF Utilities Menu.

Description

ASF reads the nucleus records which meet the selection criteria, and generates new records which contain daily, weekly or monthly differences of the individual numerical ASF data fields. The period of time to which each difference record refers is defined in the input field "Condensing period". In each condensed record, the non-numerical ASF data fields are set to blanks if the value has not changed, or to "* changed *" if the value has changed. If the field is not long enough to contain all of this text, a substring (for example "* chan" for a 6-character field) is used instead.

Special ASF Data Fields for Condensed Records

ASF writes values into the following special ASF data fields of the condensed records:

ASF Data Field Description
CONDENSED FROM D

For average records, this contains the date of the first selected nucleus record in the specified period.

For difference records and modified average records, this contains the date of the most recent nucleus record before the start of the selected period.

CONDENSED TO DAT For average records, modified average records and difference records, this contains the date of the last selected nucleus record in the specified period.
RECORD TYPE

This field indicates the method (average, modified average or difference) and the time period (day, week, month or entire period) which was used to generate the condensed record.

The values for monthly condensed records are:

AverMonth: average records

AvDelMonth: modified average records

DeltaMonth: difference records

Corresponding values exist for Week, Day and FromTo (entire period).

STORE-DATE For monthly condensed records, this field is set to the 15th of the month. For weekly condensed records, this field is set to the date of the Wednesday of the week.
STORE-TIME ASF always sets this field to 12:00.
SYNC-DATE (same as STORE-DATE).
SYNC-TIME (same as STORE-TIME).

Service Codes

Code S: Start condensing

Select this code to start condensing nucleus records to difference records.

Input field description

Enter code:

The code of the service you wish to activate.

Snapshots from ... to:

The time frame (starting date/time and end date/time) for which condensed records are to be generated.

You can specify the date in either absolute or relative format. For further details, refer to the section Absolute and Relative Date Format.

The time frame should be big enough for the condensing period selected. For a condensing period "DA" it should cover the next day, for "WE" the next Monday, for "MO" the first day of the next month.

Store Profile:

The name of the Store Profile which was used by the Store Program while the data was being collected. Type "*" to get an active help list.

Store type:

The Store Type used by the Store Program while the data was being collected. Type "*" to get an active help list.

Nucleus end:

The Store Type of explicit nucleus end or of the refresh nucleus records, should any such records exist.

If no explicit nucleus end records are written during the nucleus shutdown procedure, inaccuracies of up to 5% (for the cumulative ASF data fields) can occur in the calculation of monthly difference records. This is because, even in a 24-hour environment, the nucleus must occasionally be shut down, and information concerning the cumulative ASF data fields is lost if no explicit nucleus end records are stored.

For example, if the nucleus is shut down at 11:25 and restarted at 11:40, the daily nucleus records written at 18:00 include only values for the cumulative ASF data fields from 11:40 onwards, so data for approximately half a day is lost. If, however, explicit Nucleus End records are written during the shutdown procedure, no data is lost.

Generate st. type

The Store Type which ASF assigns to the generated records. Software AG recommends you to use Store Types whose names begin with a special character such as "+", "&" or "#", in order to differentiate between condensed records and nucleus or trend records. The following Store Types are predefined in ASF for condensed difference records:

Store Type Description
&D daily difference records
&F one difference record for the entire period
&M monthly difference records
&W weekly difference records

Condensing period

The unit of time which each condensed record represents. Valid values are: DA (daily), WE (weekly), MO (monthly), and FT (from-to). Type "*" to get an active help list.

If you specify DA, ASF generates one condensed record for each 24-hour period in the overall time frame.

If you specify WE, ASF generates one condensed record for each 7-day period (Monday to Sunday) in the overall time frame.

If you specify MO, ASF generates one condensed record for each calendar month in the overall time frame.

If you specify FT, ASF generates one condensed record for the entire time frame.

Reduced on DB-ID

If you enter a database ID in this optional input field, then data will be stored only for the database specified. The database ID must be one of those defined in the Store Profile.

If, however, the field "Restart from reduced DB-ID" is marked, the field "Reduced on DB-ID" contains the ID of the database at which ASF should restart processing after a previous run of the function was aborted.

Restart from reduced DB-ID

Mark this field if you want to restart a previously aborted run of the condense function. Specify the ID of the database with which ASF is to restart in the field "Reduced on DB-ID".

Synchronize Store Times of Nucleus Records

18:23:39          *** A D A B A S Statistics Facility ***           2008-01-24
USERID         - Synchronize store times of nucleus records -       MSS20001  
                                                                               
                   Code                 Service                                
                 -------  -------------------------------------                
                    S     Synchronize store times                              
                    R     Regenerate store times                               
                    ?     Help                                                 
                    .     Terminate                                            
                 -------  -------------------------------------                
       Enter code : _                                                          
                                                                               
   Snapshots from : __________ , 00:00  to  __________ , 23:59                 
Single storage in : 00:00 h to 00:00 h     Same day as 'Single storage' from   
Generate timestmp : 00:00 h                Same day as 'Single storage' from   
                                                                               
    Store profile : ________________   ID:                                     
       Store type : __                                                         
 Reduced on DB-ID : _____                                                      
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-7: Menu for synchronizing store times of nucleus records

Purpose

The menu is used for synchronizing the store times of nucleus records, or for regenerating the original store times in records which were previously synchronized.

Screen selection

This menu is reached by selecting the service code "S" in the ASF Utilities Menu.

Description

When records are synchronized, their original store times are modified to a new, common store time. This is useful in cases where ASF records have been created with slightly different store times, even though they belong logically to the same set of measurements (for example, if records from a remote ASF system are loaded into the database on the local system).

When records are synchronized, the ASF data fields STORE-DATE and STORE-TIME in each of the records are modified to the synchronized time. However, the ASF data fields REAL-STORE-DATE and REAL-STORE-TIME in each record are not modified; these fields always contain the original date and time when the record was created.

When records are regenerated, the ASF data fields STORE-DATE and STORE-TIME of each record are changed back to the original, unsynchronized store times stored in the ASF data fields REAL-STORE-DATE and REAL-STORE-TIME.

Service Codes

Code S: Start condensing

Select this code to synchronize the store times.

Code R: Start condensing

Select this code to regenerate the original store times in records which were previously synchronized.

Input field description

Enter code:

The code of the service you wish to activate.

Snapshots from ... to:

The time frame (starting date/time and end date/time) for which records are to be synchronized or regenerated.

You can specify the date in either absolute or relative format. For further details, refer to the section Absolute and Relative Date Format.

Note:
Relative dates are especially useful when used in the Workplan (see Option P in the Main Menu).

Single storage in ... to:

For the synchronize function, this is the range of time (starting time to end time) which will be treated as a single, common time.

For the regenerate function, this is the range of time of the records before they were synchronized.

Generate timestamp:

For the synchronize function, this is the new, common time for all records being synchronized.

If the regenerate function is being used, all records which were previously synchronized to this time will be modified to contain the original, unsynchronized time.

Store Profile:

The name of the Store Profile which was used by the Store Program while the records were being collected. Type "*" to get an active help list.

Store type:

The Store Type used by the Store Program while the records were being collected. Type "*" to get an active help list.

Reduced on DB-ID

If you enter a database ID in this optional input field, records will be synchronized or regenerated only for the database specified. The database ID must be one of those defined in the Store Profile.

Transfer from Foreign ASF System

18:25:17          *** A D A B A S  Statistics Facility ***          2008-01-24
USERID              - Transfer from foreign ASF system -            MTFS0001  
                                                                               
                                                                               
                                                                               
                   Code                 Service                                
                 -------  --------------------------------------               
                    S     Start transfer from foreign ASF system               
                    ?     Help                                                 
                    .     Terminate                                            
                 -------  --------------------------------------               
                                                                               
       Enter code : _                                                          
                                                                               
Store profile (id): ________________                                           
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-8: Menu for transferring data from a foreign ASF system.

Purpose

This function allows ASF records from a foreign ASF system to be loaded into the local ASF system. The records which are loaded from the foreign system are unloaded on the foreign ASF system by the EXPORT function. When the records are loaded into the local ASF system, the Store Profile ID stored in each record is changed from the original value on the foreign ASF system to the ID of the Store Profile specified in the mask. This is necessary because the internal ID of the Store Profile is different in different ASF systems, even if the name is the same.

It is recommended to use the same Store Profile name on all foreign ASF systems for data which will be later loaded with a common Store Profile name into the local system. This will simplify the administrative task involved.

This function runs only in batch mode with most TP monitors, since input data is read from a work file.

Note:
You cannot import ASF records which have been exported by an ASF 1.2 or earlier system.

Screen selection

This menu is reached by selecting the service code "T" in the ASF Utilities Menu.

Service Codes

Code S: Start transfer from foreign ASF system

Select this code to load data from a foreign ASF system into the local ASF system.

Input field description

Enter code:

The code of the service you wish to activate.

Store profile (ID):

The name of the Store Profile which ASF will assign to records loaded into the local ASF database. If you enter a valid Store Profile name, ASF automatically displays the internal ID of the Store Profile.

ASF Version Information

 Product ........: ADABAS Statistics Facility (ASF) 
 Version ........: 8.1.1                            
 Catalog Date ...: 2008-01-17                       
                                                    
 Last Correction : ASF81101                         
 Last Corr. Date : 2008-01-21                       
                                                    
 User ...........: USERID                              
 Library ........: SYSASF                         
 Natural Version : 04.02.04                         
 ASF Data .......: 1424   / 14                      
 ASF Profiles ...: 1424   / 15

Figure 4-9: ASF Version Information

Purpose

This screen provides information about the current installed ASF version and environment.

Screen selection

This screen is reached

  • by selecting the service code "V" in the ASF Utilities and Services menu;

  • by typing the command "VERSION" in the direct command line of any screen;

  • by starting the Natural program "VERSION" in the SYSASF library.

Description

The following information is provided in the ASF Version Information screen:

Code Description
Product Product name and abbreviation.
Version Current used ASF version.
Catalog Date Catalog date of the current used version.
Last Correction Name of the last correction applied to ASF. See the section ASF Corrections in the ASF Installation documentation for more information on ASF corrections.
Last Corr. Date Catalog date of the last correction applied.
User Current user Id.
Library Current library.
Natural Version Natural version in use.
ASF Data DBID and file number of the ASF Data system file.
ASF Profiles DBID and file number of the ASF Profiles system file.

ASF System File Maintenance

17:17:35          *** A D A B A S  Statistics Facility ***          2008-01-25
USERID                      - System File Maintenance -                MLFILE    
                                                                               
                                                                               
                                                                               
                                                                               
 Current values ....:       ASF Data      1424 / 14                            
                            ASF Profiles  1424 / 15                            
                                                                               
 New values ........:       ASF Data     _1424 / 14___                         
                            ASF Profiles _1424 / 15___                         
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
 Enter the new DBID / FNR combinations.                                        
                                                                               
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help        Term              Save                                Menu

Figure 4-10: Menu for ASF System File Maintenance

Purpose

During the installation of ASF, you have defined in the Natural parameter module, which file numbers are used for the ASF system files (see the section Step 1: Customizing Natural in the ASF Installation documentation). This screen shows you the database ID and file number of the currently used ASF Data and ASF Profiles files. If there is more than one pair of ASF system files in your environment, you can access the other ASF system files by overwriting the corresponding "New values".

Screen selection

This screen is reached

  • by selecting the service code "F" in the ASF Utilities and Services menu;

  • by typing the command "LFILE" in the direct command line of any screen;

  • by starting the Natural program "LFILE" in the SYSASF library.

Description

There are two Natural system files for ASF, namely the ASF Data file and the ASF Profiles file. The line "Current values" displays the currently used database ID and file numbers of the ASF system files. In the line "New values", you can specify another DBID/FNR combination for the ASF system files.

This function may also be used as temporary solution if ASF has been started and the ASF system files are not yet defined in the Natural parameter module.

You save the modifications by pressing the PF6 key. You leave the screen with PF3 (back to where you came from) or with PF12 (display the ASF Main Menu). If you have modified the ASF system file values and you leave the screen without pressing PF6 before, ASF will ask you whether you want to save your modifications.

The new values for the ASF system files are only valid for your current Natural session. If you open a new Natural session, the values specified in the Natural parameter module will be taken. Other Natural users are not affected by your modifications.

User Profile Maintenance

Purpose:

The User Profile defines a set of defaults which affect the behavior of ASF. Three screens are available for defining the User Profile:

  • In the General User Profile you specify general default parameters.

  • In the e-Mail Profile you specify information required for sending Critical Reports as e-mails.

  • In the Con-nect Profile you specify information required for sending Critical Reports as memos to Con-nect cabinets (if you are using Con-nect).

Screen selection

The General User Profile is reached by selecting the service code "P" in the ASF Utilities and Services menu or by typing the command "PROFILE" in the direct command line of any screen. From here you reach the e-Mail Profile by pressing PF7 and the Con-nect Profile by pressing PF8.

graphics/04_11_pro_navi.png

Figure 4-11: User Profile Navigation

This section covers the following topics:

General User Profile

18:26:26          *** A D A B A S  Statistics Facility ***          2008-01-25
USERID              - ASF Utilities and Services Menu  -            MUM00001  
                                                                               
        +----------< Define user-profile for user STANDARD >------------+      
        !                                                               !      
        ! Date format        : 2           (1=YYYY-MM-DD,2=DD.MM.YYYY)  !      
        ! Decimal character  : .           Separating sign   : ,        !      
        ! Kilo if > 1000     : N (Y/N)     Mega if > 1000 k  : N (Y/N)  !      
        ! Stay after save    : Y (Y/N)     Keep environment  : Y (Y/N)  !      
        !                                                               !      
        ! Printer name       : PDEFAULT    Char. per line    : 80_      !      
        ! Left margin        : 3__         Print one document: Y (Y/N)  !      
        ! Batch output       : 2           (1=seqfile,2=sysout)         !      
        !                                                               !      
        ! Limit CPU-units    : 1800___     Limit ADA-calls   : 1800___  !      
        ! Get Num.rec.loaded : Y (Y/N)     Accuracy level    : 10       !      
        ! Not used           : N (Y/N)     Start with menu   : Y (Y/N)  !      
        !                                                               !      
     En +---------------------------------------------------------------+      
                                                                               
     Direct command ==> ______________________________________________________ 
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term              User  eMail CONNE                   Menu

Figure 4-12: Menu for General User Profile Maintenance

Screen selection

The General User Profile is reached

  • by selecting the service code "P" in the ASF Utilities and Services menu;

  • by typing the command "PROFILE" or "PROFILE STANDARD" or "PROFILE username" in the direct command line of any screen;

  • by pressing PF6 in the e-Mail Profile or in the Con-nect Profile.

The PROFILE command selects the profile which contains your own defaults. The PROFILE STANDARD command selects the profile which contains the defaults for new users. The PROFILE username command selects the profile for the user username.

Input field description

Date Format:

Type 1 to get the format YYYY-MM-DD (US format), or type 2 to get the format DD.MM.YYYY (European format).

Decimal character:

You can choose a period "." or a comma "," as the decimal character to be used when floating point numbers are printed in the Evaluation Reports.

Separating sign:

You can specify a comma or a period to separate groups of three digits which are displayed to the left of the decimal character. If you leave the field empty, no separating sign will be used.

Kilo if > 1000

If this is set to "Y", then certain numerical values greater than 1000 will be displayed using the K notation. Thus 25000 will be replaced by 25 K. Values less than 1000 will be rounded off, so that 25800 gives 26 K, whereas 25499 gives 25 K.

Mega if > 1000 K

If this is set to "Y", then certain values greater than 1 000 000 will be displayed using the M notation. Thus 2 000 000 will be replaced by 2 M. Values less than 1 million will be rounded, so that 2 600 000 gives 3 M, whereas 2 499 000 gives 2 M.

Stay after save:

This allows you to control the behavior of the SAVE function (PF6 key) in all subsequent screens. If you specify "N", then pressing PF6 in subsequent screens to perform the SAVE function performs not only the SAVE function but also automatically deselects the screen. If you specify "Y", then subsequent screens are not automatically deselected when you press PF6 to perform the SAVE function.

Keep environment:

This feature allows you to retain dialogue data from one run of the ASF Menu System to the next. Dialogue data are the values which you enter in the input fields of the ASF menus, for example Evaluation Profiles, Store Profiles, Time Intervals, Store Types. Normally when you terminate ASF, the values in these fields are lost. However, if you specify "Y" in the Keep Environment field of the User Profile, these values are retained and inserted automatically into the appropriate input fields at the start of the next run of ASF. Specify "N" to switch off this option.

Printer name:

The name of the printer to be used for all printer output.

Char per line

The number of characters per line to be used on the printer. The only valid values are 80 and 132. This value is required by ASF to determine the number of data columns which can be displayed in a printed report.

Left margin:

The size of the left margin to be used in printer reports, expressed as a number of characters.

Print one document

If this is set to "Y" (the default value), then printer output is generated without information pages being printed between each two pages of the generated report.

Batch output:

If you specify "1", all printed output is directed to your specified or default output channel. If you specify "2", output is directed to the system spool queue.

Limit CPU-units

A value restricting the amount of CPU time to be allowed during an evaluation.

Limit ADA-calls

A value restricting the number of Adabas calls to be allowed during an evaluation.

Get Num rec loaded

If "Y" is specified, the ASF data field "Number of records loaded" is activated and can be displayed in the Evaluations.

Accuracy level

Critical Trend Reports will not display any ASF fields whose computed accuracy lies below the given figure. The default value is 0.

(Not used)

(This field is reserved for future use)

Start with menu

Specify "Y" if you want the ASF Main Menu to be displayed when ASF Menu System is started or "N" if you want the Workplan to be selected automatically instead.

E-Mail Profile

18:32:23          *** A D A B A S  Statistics Facility ***          2008-01-25
USERID              - ASF Utilities and Services Menu  -            MUM00001  
                                                                               
        +----------< Define e-Mail Profile for user STANDARD >--------- +      
        !                                                               !      
        ! Critical reports are written in SMTP format to Workfile 1     !      
        ! (if output medium 'PC-File' is marked with 'E').              !      
        !                                                               !      
        ! Sending Domain Name:                                          !      
        ! From :                                                        !      
        ! To(1):                                                        !      
        ! To(2):                                                        !      
        ! To(3):                                                        !      
        ! Only if the critical report contains fields:                  !      
        ! Standard text in the mail:                                    !      
        !                                                               !      
        !                                                               !      
        !                                                               !      
     En !                                                               !      
        +---------------------------------------------------------------+      
     Direct command ==> ______________________________________________________ 
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term              User  eMail CONNE                   Menu

Figure 4-13: Menu for Define e-Mail Profile

Screen selection

The e-Mail Profile is reached by pressing PF7 in the General User Profile or in the Con-nect Profile.

Purpose

When you run a Critical Report with the input field "PC-File" marked with an "E", ASF writes the output in SMTP format into the Workfile 1. Beside the report itself, the receiver(s) and sender address and a standard text as specified in the e-Mail Profile are supplied. The e-mail addresses are used by SMTP to mail the report. For more details, see the section Sending a Critical Report as e-Mail.

Input field description:

Sending Domain Name

This specifies the domain name of the SMTP server. It must be the same as given in the "DEST" field in the SMTP job. Ask your system administrator for the SMTP domain name used in your environment.

From

This e-mail address is used in the mail as sender address. Error messages from the e-mail system (delivery failed etc.), are returned to this address as well.

To (1-3)

You can specify up to three receiver addresses. How to specify the "@" (at) sign, depends on your local codepage. Ask your system administrator for the character corresponding to the at-sign in your environment.

Only if the critical report contains fields

If you mark this field, the output of a Critical Report is sent as e-mail only if at least one critical field is reported in the Critical Report.

Standard text in the mail

When a Critical Report is sent as e-mail, the text specified for this field is sent as an accompanying note.

Con-nect Profile

18:32:23          *** A D A B A S  Statistics Facility ***          2008-01-25
USERID              - ASF Utilities and Services Menu  -            MUM00001  
                                                                               
        +----------< Define CONNECT Profile for user  STANDARD >------- +      
        !                                                               !      
        ! Critical reports are to be sent as memos to the following     !      
        ! CONNECT cabinets (if output medium 'Printer' is marked)       !      
        !                                                               !      
        ! Cabinets........: ________  ________  ________                !      
        ! Only if the critical report contains fields: _                !      
        !                                                               !      
        ! Standard text in the memos:                                   !      
        !                                                               !      
        ! _____________________________________________________________ !      
        ! _____________________________________________________________ !      
        ! _____________________________________________________________ !      
        ! _____________________________________________________________ !      
        !                                                               !      
     En +---------------------------------------------------------------+      
        +---------------------------------------------------------------+      
     Direct command ==> ______________________________________________________ 
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term              User  eMail CONNE                   Menu

Figure 4-14: Menu for Define Con-nect Profile

Screen selection

The Con-nect Profile is reached by pressing PF8 in the General User Profile or in the e-Mail Profile.

Purpose

When you run a Critical Report with the input field "printer" marked (see the section Sending a Critical Report to Con-nect Cabinets) ASF sends the output as a memo into the Con-nect cabinets which you specify here in addition to printing the output on the specified output device. A copy of the memo can be found in the out-basket of the cabinet "SYSASF".

Input field description:

Cabinets

You can specify up to three Con-nect cabinets. If a cabinet does not exist, the memo is still sent to the other cabinets.

Note:
When the Critical Report is sent to a Con-nect cabinet, it is created firstly as a temporary document in SYSASF and sent from there as a memo to the Con-nect cabinet. The temporary document in SYSASF is subsequently deleted.

Only if the critical report contains fields

If you mark this field, the output of a Critical Report is sent to the named Con-nect cabinets only if at least one critical field is reported in the Critical Report.

Standard text in the memos

When a Critical Report is sent as a memo to a Con-nect cabinet, the text specified for this field is sent as an accompanying note with the memo.

User Exit Maintenance

The User Exit maintenance is described in the section User Exit Maintenance Menu.

ASF Application Program Interface (API) Test Menu

18:27:12          *** A D A B A S  Statistics Facility ***          2008-01-24
USERID                    - API test interface -                    MAT00001  
                                                                               
                                                                               
                                                                               
               Enter code : __ (00=INIT,01=TDF,02=DFT)                         
               Store type : __                                                 
    Store profile name/id : ________________  _____                            
            Time interval : __________ , 00:00  to  __________ , 23:59         
                  DB/File : _____  _____                                       
                   Origin : ___                                                
         Date format code : _                                                  
Display format (optional) : Dec.sign: _ Th.sign: _ Kilotrans: _ Megatrans: _   
           No. of records : _12                                                
                                                                               
        Field names/units : ________________  __                               
                            ________________  __                               
                            ________________  __                               
                            ________________  __                               
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term                                                  Menu

Figure 4-15: Menu for testing the API

Purpose

This menu allows you to try out some features of the Application Program Interface (API). It is in no way intended to demonstrate the full capability of the API.

The selection criteria that you enter are passed internally to a test program which calls the API subroutine ASFGET01 to retrieve records from the ASF database.

The test program displays a key consisting of fields returned by ASFGET01 for each retrieved record, namely: the database ID, the file ID, the creation date and time of the record, the Store Profile ID and the Store Type.

If more records are retrieved than can be displayed on one screen, you can use the ENTER key to page forwards to the end of the list. Each time you press ENTER, a new call of ASFGET01 is issued.

Refer to the section Application Programming Interface for details of writing applications using the API.

Screen selection

This menu is reached by selecting the service code "I" in the ASF Utilities Menu.

Input field description

Enter code:

The valid values for this field are 00, 01 and 02. If you are using the API Test Interface for the first time for a given set of selection criteria, you must specify the value 00 for this field. This causes the test program to perform the ASFGET01 initialization which is always required when using new selection criteria.

If you specify the value 01 for this field, the key which is displayed for each retrieved record is shown in the format: time, database ID and file ID.

If you specify the value 02 for this field, the key which is displayed for each retrieved record is shown in the format: database ID, file ID and time.

Store type:

The Store Type used by the Store Program while the data was being collected. Type "*" to get an active help list.

Store profile name/ID:

The name and/or the ID of the Store Profile which was used by the Store Program while the data was being collected. You must supply at least one of these fields. If you supply both of these fields, the Store Profile name is ignored. Type "*" to get an active help list.

Time interval ... to:

The starting date/time and the end date/time of the time frame to be used.

You can specify the date in either absolute or relative format. For further details, refer to the section Absolute and Relative Date Format in the Menu System.

DB/File

The database ID and file ID of the records to be retrieved.

Origin

The origin of the records to be retrieved.

The choices are: NU (nucleus data only), TR (trend data only) and ALL (both nucleus and trend data). Type "*" to get an active help list.

Date Format Code

The format to be used for the display of dates. Specify "1" for the format YYYY-MM-DD or "2" for the format DD.MM.YYYY.

Dec. sign

The decimal separating character to be used in numerical output. Valid values are the period (".") and the comma (","). The decimal separating character must be different from the thousands separating character.

Th. sign

The thousands separating character to be used in numerical output. Valid values are the period (".") and the comma (","). The thousands separating character must be different from the decimal separating character.

Kilotrans

If you mark this field, numerical values greater than 1000 are displayed in the K notation.

Megatrans

If you mark this field, numerical values greater than 1000K are displayed in the M notation.

No. of records

The maximum number of records to be retrieved per call of ASFGET01 by the test program. Because of the limitations of the test program, this value cannot exceed 12.

Field names/units

The names of the ASF data fields and their units of measurement. The test program allows you to specify a maximum of 4 ASF data fields.

Type "*" to get an active help list.

API Example 1

This feature displays the output of the sample program PEXAMPL1. The following output is displayed:

                    ***  A D A B A S  STATISTICS FACILITY ***
                        Space used for selected databases
                   (Application Program Interface - Example 1)


   Date: 1993-03-15

   DB    DB-Name          Asso (blocks)     DB Data (blocks)       Sum (blocks)
   ----------------------------------------------------------------------------
   16    DB016-ALSBA                  7.384            34.523            41.907
   17    DB017-ANWEN                 96.653           367.584           464.237
   19    A-BEHOERDE                 197.888           265.792           463.680
   26    SPL-MIRROR                  63.189           195.942           259.131
   27    DB027-ALSBA                 48.552           146.454           195.006
   36    DB036-ALSBA                 93.039           197.004           290.043
   37    ENTIRE-ALSB                203.762           238.106           441.868
   ----------------------------------------------------------------------------
                                                       Total:         2.155.872

Figure 4-16: Output of Sample Program PEXAMPL1

The source code of the PEXAMPL1 program can be found on the SYSASF library.

The source code of PEXAMPL1 is as follows:

*************** ADABAS Statistics Facility (ASF) **********************
* Program ....: PEXAMPL1
* Description : DEMONSTRATION OF THE API (ASFGET01):
*               SPACE USED FOR SELECTED DATABASES
***********************************************************************
* (C) COPYRIGHT 2007 by SOFTWARE AG, Darmstadt (Germany)
***********************************************************************
DEFINE DATA
LOCAL
1 #P-FKTCODE              (A2)
1 #P-INPUT-PARAMETER
  2 #P-SELECTION-CRITERIA (A67)    
  2 REDEFINE #P-SELECTION-CRITERIA
    3 #P-FROM-DATE        (A10)    
    3 #P-FROM-TIME        (A5)
    3 #P-TO-DATE          (A10)    
    3 #P-TO-TIME          (A5)
    3 #P-DAT-FORMAT-CODE  (A1)
    3 #P-STORE-PROFILE   (A16)
    3 #P-STORE-PROFILE-ID (A5)     
    3 #P-STORE-TYPE       (A2)
    3 #P-ORIGIN           (A3)
    3 #P-DB               (A5)
    3 #P-FILE             (A5)
  2 #P-FORMAT             (A4)
  2 REDEFINE #P-FORMAT
    3 #P-DECIMAL-SIGN    (A1)
    3 #P-THOUSAND-SIGN   (A1)
    3 #P-KILO-TRANSFORMATION (A1)
    3 #P-MEGA-TRANSFORMATION (A1)
  2 #P-NR-RECORDS           (N3)
  2 #P-FIELD-NAMES   (A16/1:150)
  2 #P-UNITS          (A2/1:150)
  2 #P-RESERVE             (A30)
1 #P-OUTPUT-PARAMETER
  2 #P-FIELD-DATA    (A18/1:150)   
  2 #P-ADDITIONS1   (A250)
  2 #P-ADDITIONS2   (A250)
1 #P-RETURN
  2 #P-RETURNCODE           (N2)
  2 #P-ASF-MSG-NR           (N4)
  2 #P-ASF-MSG             (A60)
  2 #P-WRONG-VALUE         (A32)
  2 #P-PARAM-NO             (N3)
1 #P-WORK                 (A114)
1 #P-TRACE                (A5)
*
1 #M-ASSO       (N7/1:7)
1 #M-DATA       (N7/1:7)
1 #M-DATE        (A10)                   
1 #M-DB          (A5/1:7)   INIT <'16','17','19','26','27','36','37'>
1 #M-DBNAME     (A16/1:7)
1 #M-SUM        (N7/1:7)
1 #M-TOTAL-SUM  (N7)
1 #M-TEXT       (A75)
*
1 #I-DB          (P3)
*
END-DEFINE
*
* MOVE 'TRACE' TO #P-TRACE  /* trace asfget01 if desired
*
FOR #I-DB 1 TO 7
*
  MOVE '00' TO #P-FKTCODE
  CALLNAT 'ASFGET01' #P-FKTCODE #P-INPUT-PARAMETER
    #P-OUTPUT-PARAMETER #P-RETURN #P-WORK #P-TRACE
*
  MOVE '02'              TO #P-FKTCODE
  MOVE '1993-03-15'      TO #P-FROM-DATE /* SAG201097
  MOVE '00:00'           TO #P-FROM-TIME
  MOVE '1993-03-15'      TO #P-TO-DATE   /* SAG201097
  MOVE '1'               TO #P-DAT-FORMAT-CODE
  MOVE 'NEW-TEST-DB-ALL' TO #P-STORE-PROFILE
  MOVE 'DA'              TO #P-STORE-TYPE
  MOVE 'NU'              TO #P-ORIGIN
  MOVE #M-DB(#I-DB)      TO #P-DB
  MOVE 1                 TO #P-NR-RECORDS
  MOVE 'DB-NAME'         TO #P-FIELD-NAMES(1)
  MOVE 'ASSO USED'       TO #P-FIELD-NAMES(2)
  MOVE 'DATA USED'       TO #P-FIELD-NAMES(3)              
  MOVE 'BL'              TO #P-UNITS(2)
  MOVE 'BL'              TO #P-UNITS(3)
*
  CALLNAT 'ASFGET01' #P-FKTCODE #P-INPUT-PARAMETER
    #P-OUTPUT-PARAMETER #P-RETURN #P-WORK #P-TRACE
*
  IF #P-RETURNCODE = 1
    IF #P-ASF-MSG <> ' '                                   
      COMPRESS 'ASF' #P-ASF-MSG-NR
        INTO #M-TEXT LEAVING NO
      COMPRESS #M-TEXT #P-ASF-MSG
        INTO #M-TEXT
    ELSE
      MOVE 'Please change sample program PEXAMPL1 according '-
        'to your collected ASF data.'
        TO #M-TEXT
    END-IF
    ESCAPE BOTTOM
  END-IF
*
  MOVE #P-FIELD-DATA(2)      TO #M-DBNAME(#I-DB)
  COMPUTE #M-ASSO(#I-DB) = VAL(#P-FIELD-DATA(3))
  COMPUTE #M-DATA(#I-DB) = VAL(#P-FIELD-DATA(4))
  COMPUTE #M-SUM(#I-DB) = VAL(#P-FIELD-DATA(3)) +
    VAL(#P-FIELD-DATA(4))
  ADD #M-SUM(#I-DB) TO #M-TOTAL-SUM
*
END-FOR
*
MOVE #P-FROM-DATE TO #M-DATE
INPUT USING MAP 'MEXAMPL1'
*
END

API Example 2

        ***  A D A B A S  STATISTICS FACILITY ***       
   Overview of disk space and IO for a six month period 
       (Application Program Interface - Example 2)      
                                                        
                                                        
                                                        
                                                        
            Asso/Data(blocks)          IOs on A/D/W     
 --------------------------------------------------     
  1992 Sep         2.186.840             1.689.672      
       Oct         2.305.699             1.586.855      
       Nov         2.414.520             1.928.323      
                                                        
       Dec         2.305.854             1.041.419      
  1993 Jan         2.300.059             1.777.810      
       Feb         2.177.879             1.388.148      
 --------------------------------------------------     
                                                        
                  13.690.851             9.412.227

Figure 4-17: Output of Sample Program PEXAMPL2

The source code of the PEXAMPL2 program can be found in the SYSASF library.

The source code of PEXAMPL2 is as follows:

*************** ADABAS Statistics Facility (ASF) **********************
* Program ....: PEXAMPL2
* Description : DEMONSTRATION OF THE API (ASFGET01):
*               OVERVIEW OF DISK SPACE AND IO FOR
*               A SIX MONTH PERIOD
***********************************************************************
* (C) COPYRIGHT 2007 by SOFTWARE AG, Darmstadt (Germany)
***********************************************************************
DEFINE DATA
LOCAL
1 #P-FKTCODE              (A2)
1 #P-INPUT-PARAMETER
  2 #P-SELECTION-CRITERIA (A67)    
  2 REDEFINE #P-SELECTION-CRITERIA
    3 #P-FROM-DATE        (A10)    
    3 #P-FROM-TIME        (A5)
    3 #P-TO-DATE          (A10)    
    3 #P-TO-TIME          (A5)
    3 #P-DAT-FORMAT-CODE  (A1)
    3 #P-STORE-PROFILE   (A16)
    3 #P-STORE-PROFILE-ID (A5)     
    3 #P-STORE-TYPE       (A2)
    3 #P-ORIGIN           (A3)
    3 #P-DB               (A5)
    3 #P-FILE             (A5)
  2 #P-FORMAT             (A4)
  2 REDEFINE #P-FORMAT
    3 #P-DECIMAL-SIGN    (A1)
    3 #P-THOUSAND-SIGN   (A1)
    3 #P-KILO-TRANSFORMATION (A1)
    3 #P-MEGA-TRANSFORMATION (A1)
  2 #P-NR-RECORDS           (N3)
  2 #P-FIELD-NAMES   (A16/1:150)
  2 #P-UNITS          (A2/1:150)
  2 #P-RESERVE             (A30)
1 #P-OUTPUT-PARAMETER
  2 #P-FIELD-DATA    (A18/1:150)   
  2 #P-ADDITIONS1   (A250)
  2 #P-ADDITIONS2   (A250)
1 #P-RETURN
  2 #P-RETURNCODE           (N2)
  2 #P-ASF-MSG-NR           (N4)
  2 #P-ASF-MSG             (A60)
  2 #P-WRONG-VALUE         (A32)
  2 #P-PARAM-NO             (N3)
1 #P-WORK                 (A114)
*
1 #M-IO        (N8/1:6)
1 #M-SPACE     (N8/1:6)
1 #M-SUM-IO    (N8)
1 #M-SUM-SPACE (N8)
1 #M-YEAR      (A4/1:6) INIT <'1992','    ','    ','    ','1993','    '>
1 #M-MONTH     (A3/1:6) INIT <'Sep','Oct','Nov','Dec','Jan','Feb'>
1 #M-TEXT      (A75)
*
1 #I-MONTH      (P3)
1 #I-DB         (P3)
*
1 #W-DBS    (A5/1:7)  INIT <'16','17','19','26','27','36','37'>
1 #W-MONTHS (A2/1:6)  INIT <'09','10','11','12','01','02'>
1 #W-YEAR   (A4/1:6)  INIT <'1992','1992','1992','1992','1993','1993'>
*
END-DEFINE
*
*
F. FOR #I-MONTH 1 TO 6
*
  FOR #I-DB 1 TO 7
*
    MOVE '00' TO #P-FKTCODE
    CALLNAT 'ASFGET01' #P-FKTCODE #P-INPUT-PARAMETER
      #P-OUTPUT-PARAMETER #P-RETURN #P-WORK
*
    MOVE '02'              TO #P-FKTCODE
    COMPRESS #W-YEAR(#I-MONTH) '-' #W-MONTHS(#I-MONTH) '-01'
      INTO #P-FROM-DATE LEAVING NO
    MOVE '1'               TO #P-DAT-FORMAT-CODE
    MOVE 'NEW-TEST-DB-ALL' TO #P-STORE-PROFILE
    MOVE '#M'              TO #P-STORE-TYPE
    MOVE 'NU'              TO #P-ORIGIN
    MOVE #W-DBS(#I-DB)     TO #P-DB
    MOVE 1                 TO #P-NR-RECORDS
    MOVE 'ASSO USED'       TO #P-FIELD-NAMES(1)
    MOVE 'DATA USED'       TO #P-FIELD-NAMES(2)            
    MOVE 'READ ASSO'       TO #P-FIELD-NAMES(3)
    MOVE 'READ DATA'       TO #P-FIELD-NAMES(4)
    MOVE 'READ WORK'       TO #P-FIELD-NAMES(5)
    MOVE 'WRITE ASSO'      TO #P-FIELD-NAMES(6)
    MOVE 'WRITE DATA'      TO #P-FIELD-NAMES(7)
    MOVE 'WRITE WORK'      TO #P-FIELD-NAMES(8)
    MOVE 'BL'              TO #P-UNITS(1)
    MOVE 'BL'              TO #P-UNITS(2)
*
    CALLNAT 'ASFGET01' #P-FKTCODE #P-INPUT-PARAMETER
      #P-OUTPUT-PARAMETER #P-RETURN #P-WORK
*
    IF #P-RETURNCODE = 1
      IF #P-ASF-MSG <> ' '                                   
        COMPRESS 'ASF' #P-ASF-MSG-NR
          INTO #M-TEXT LEAVING NO
        COMPRESS #M-TEXT #P-ASF-MSG
          INTO #M-TEXT
      ELSE
        MOVE 'Please change sample program PEXAMPL1 according '-
          'to your collected ASF data.'
          TO #M-TEXT
      END-IF
      ESCAPE BOTTOM (F.)
    END-IF
*
    COMPUTE #M-SPACE(#I-MONTH) =
      #M-SPACE(#I-MONTH)    +
      VAL(#P-FIELD-DATA(2)) +
      VAL(#P-FIELD-DATA(3))
*
    COMPUTE #M-IO(#I-MONTH) =
      #M-IO(#I-MONTH)    +
      VAL(#P-FIELD-DATA(4)) +
      VAL(#P-FIELD-DATA(5)) +
      VAL(#P-FIELD-DATA(6)) +
      VAL(#P-FIELD-DATA(7)) +
      VAL(#P-FIELD-DATA(8)) +
      VAL(#P-FIELD-DATA(9))
*
  END-FOR
*
  ADD #M-SPACE(#I-MONTH) TO #M-SUM-SPACE
  ADD #M-IO(#I-MONTH) TO #M-SUM-IO
*
END-FOR
*
INPUT USING MAP 'MEXAMPL2'
*
END

Interface to SYSRDC

The Natural Data Collection Utility SYSRDC supplies monitoring and accounting data for certain events within Natural. The SYSRDC utility is described in detail in the Natural Utilities Manual for Mainframes. Please refer to this manual for any question regarding the installation or activation of SYSRDC, or the meaning of the various event types and data fields collected by SYSRDC.

The SYSRDC trace buffer records the data in wrap-around mode. You will therefore find only the last events in the buffer. The number of events which fit in the buffer depends on the setting of the corresponding Natural parameter.

For the monitoring of ASF, there are some services available. The corresponding programs which are used as interface to SYSRDC are on the delivered SYSASF library.

When the SYSRDC buffer is allocated, the data collection is performed automatically at the start of Natural by default. ASF writes user records into the SYSRDC buffer when it starts, when a Natural error occurs and for each direct command entered. In case of a failure of ASF, you can provide Software AG support with information collected by SYSRDC, e.g., you can download the requested data and send it to your Software AG technical support representative.

Although the ASF SYSRDC Interface is primarily intended for debugging ASF failures, you may use it for other Natural applications as well.

18:35:26              ***** NATURAL SYSRDC UTILITY *****             2008-01-25
User USERID                      - Main Menu -                         XRDCMAIM
Trace started                                                                  
                                                                                
                       Code   Function                                          
                                                                                
                        R     Restart trace                                     
                        S     Stop trace                                        
                        I     Show record information                           
                        L     List trace records                                
                        E     Select trace events                               
                        D     Download trace records                            
                        P     Print trace records                               
                        ?     Help                                              
                        .     Exit                                              
                                                                                
         Code ......... _                                                       
         From record .. 1_____ to record .. 999999                              
                                                                                
                                                                                
                                                                                
 Command ===>                                                                   
 Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
       Help        Exit  Start Stop  Flip  Info  List  EvSel Down  Print Canc

Figure 4-18: The SYSRDC Main Menu

Purpose

This screen is used to maintain the Natural SYSRDC utility. The current status of SYSRDC is displayed. SYSRDC can be started, stopped and the SYSRDC event types can be set. The SYSRDC buffer data can be listed on the screen, printed or downloaded to the PC.

Screen selection

This screen is reached

  • by selecting the service code "R" in the ASF Utilities and Services menu;

  • by typing the command "RDC" in the direct command line of any screen;

  • by starting the Natural program "RDC" in the SYSASF library.

Input field description

Code:

Enter the code of the service you wish to activate. The codes available and their meaning are listed below.

From record ... to record:

Each record in the SYSRDC buffer has a sequence number, starting with "1" for the oldest record. The event selection does not affect the line numbers. You specify here the range of SYSRDC records to be downloaded or printed. If you list the SYSRDC records, the list will start with the "from record". Nevertheless you can view all records by paging up or down. When the SYSRDC debugging is stopped, the "to record" field contains the number of the last record in the buffer by default.

Command:

The SYSRDC Interface uses its own set of direct commands. Move the cursor into the "Command" field and press PF1, to receive the list of direct command supplied and their meaning.

Service Codes

R: Restart trace

Select this service to (re-)start the SYSRDC data collecting. Before the SYSRDC data collecting is started, the SYSRDC buffer is cleared automatically. You have to confirm this action in a pop-up window, so that you do not accidently clear the buffer. If only specific SYSRDC event types should be collected, select these types with the service "E" before restarting the trace.

S: Stop trace

Select this service to stop the SYSRDC data collecting. You have to confirm this action in a pop-up window, so that you do not accidently stop the data collecting.

I: Show record information

This service displays detailed information on the record specified in the "From record" field. Before the record is displayed, the SYSRDC trace recording is stopped automatically. You have to confirm this action in a pop-up window, so that you do not accidently stop the recording.

L: List trace records

Select this service to list the content of the SYSRDC buffer. Beside the General Information and the Time Information, there is one tab for the information concerning each event type. Before the SYSRDC buffer is listed, the SYSRDC trace recording is stopped automatically. You have to confirm this action in a pop-up window, so that you do not accidently stop the recording.

E: Select trace events

Select this service to select the SYSRDC events to be traced or listed.

D: Download trace records

Download the SYSRDC buffer to the PC. You have to confirm this action in a pop-up window, so that you do not accidently download data.

P: Print trace records

Print the SYSRDC buffer. You have to confirm this action in a pop-up window, so that you do not accidently print data. Additionally you must specify the printer environment. This is because the SYSRDC interface has no access to the SYSASF settings.

Tracing ASF

ASF provides an internal trace facility which offers up to 16 different types of debugging (not all are used so far). Various direct commands are available to perform trace functions like start a specific trace type or stop the tracing. These direct commands are described later in detail. The same trace functions can be performed from the ASF Trace Maintenance menu.

When the ASF internal trace is activated, it writes additional information on the screen. This information helps Software AG support to analyze failures of ASF.

18:34:53          *** A D A B A S  Statistics Facility ***          2008-01-25
USERID                     - Trace Maintenance -                    MTRACE01  
                                                                               
 Mk  Nr Description                       Mk  Nr Description                   
 --- -- ------------------------------    --- -- ------------------------------
  _   1 Program trace                      _   9 N/A                           
  _   2 General trace information          _  10 N/A                           
  _   3 Overflow and error situations      _  11 N/A                           
  _   4 Formatted trace information        _  12 N/A                           
  _   5 Special Debugging                  _  13 N/A                           
  _   6 Full store trace                   _  14 N/A                           
  _   7 User exit trace                    _  15 N/A                           
  _   8 N/A                                _  16 N/A                           
                                                                               
  Program to be traced : ALL                                                   
  Program counter......: 0000000                                               
                                                                               
                                                                               
                                                                               
                                                                               
     Direct command ==> _______________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  More  Term  Off   On    Selct                               Menu

Figure 4-19: Menu for the ASF Trace Maintenance

Purpose

This screen is used to maintain the ASF internal trace facility. Selected trace types can be started or stopped, the ASF program to be traced can be specified and the trace counter can be set.

Screen selection

This screen is reached

  • by selecting the service code "M" in the ASF Utilities and Services menu;

  • by typing the command "TRACE" in the direct command line of any screen;

  • by starting the Natural program "RDC" in the SYSASF library.

Description

The ASF Trace Maintenance menu outlines the possible trace types of the ASF internal trace facility. You can activate a selected trace type by marking it with an "X". You can switch on all trace types by pressing PF5, or switch off all trace types by pressing PF4.

The following traces are available:

  1. Program trace – ASF displays the name of each Natural object that it executes. Additionally the counter, the object type (e.g. “program”), and the level are displayed.

  2. General trace information – ASF displays various information about the currently performed task. For example when reading the ASF Data file for an evaluation, the value searched and the value found are displayed.

  3. Overflow and error situations – In some calculations where an overflow occurs (number too large), the overflow is caught by ASF and the highest possible number (depending on the format) is substituted. When trace level 3 is activated, ASF displays the real value together with the substitute.

  4. Formatted trace information – Some specific trace data is displayed in a formatted output.

  5. Special Debugging – Selected information is displayed only.

  6. Full store trace – The value of most ASF fields is displayed when ASF performs the store function.

  7. User exit trace – You can use this trace type to debug the user exit ASFUEX01. In the program, the parameter #P-TRACE is true when this trace type is set

The other trace levels are currently not used.

When the ASF trace has been activated, the trace information is written to the screen. Page through this information by pressing ENTER until you reach the next ASF screen.

When you have marked the desired trace types, press PF6 for the selection before pressing PF3, otherwise ASF ignores your changes and returns to the calling screen.

The tracing remains active until you deactivate it in the ASF Trace Maintenance, with the direct command "TRACE OFF", or until the end of the Natural session. Other ASF users are not affected, when you activate or deactivate the trace facility.

Input field description

Program to be traced:

The tracing can be restricted to a specific ASF program by specifying the program name in this field. If you specify "ALL", all ASF programs will be traced, which is the default.

Program counter:

If any ASF trace level is activated, the ASF internal trace counter is increased as soon as an ASF program is started. This counter is displayed with the Program Trace (type 1). You can set the counter to any value by overwriting this field.

Direct Commands and Programs

There are several Direct Commands available for tracing ASF. Additionally there are some programs delivered in the SYSASF library to maintain the ASF trace facility from "outside", i.e. before you start ASF itself.

Direct Command Program Purpose
TRACE   Display the Trace Maintenance Menu.
TRACE ?   Display the current status of the trace mode.
TRACE COUNT   Reset the trace program counter.
TRACE NAME prog   Restrict the tracing to the program prog. If prog is omitted or set to ALL, all programs will be traced.
TRACE OFF TRACEOFF Stop the trace mode. All trace types (1 to 16) are deactivated. The trace counter is reset.
TRACE ON TRACE-ON Start the trace mode. All trace types (1 to 16) are activated.
TRACE PROG TRACE-P Start the "Program" trace level. ASF writes the name of each Natural program, subprogram, subroutine etc. that it executes. This is the same as "TRACE 1".
TRACE n TRACE-N Start the trace type n, where n is the trace type number from 1 to 16 as described above. When you start the program TRACE-N, it will ask you which trace type (mode) should be started.
TRACE OFF   Stop the trace. All trace types (1 to 16) are deactivated. The trace counter reset.