How to Create and Use Logical Views in CA-View

Document ID : KB000053921
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document is a brief overview of how to create and use logical views in CA-View.

Solution:

In CA-View, there are two types of views for a report, the Native view and a logical view.

The Native view displays the full report content.

A Logical view allows for customizing the way that View displays a report, without in any way altering the original data.

A Logical view can also provide a basic level of security, since the System Administrator can restrict users to only being able to use certain views.

There are three types of logical views:

  • PUBLIC view applies to only one report. There can be either unrestricted or restricted access, where the view is accessible to only specified users.
  • A PRIVATE view also applies to only one report. In this case, a user can create a personal view, and no other users can access that view.
  • A GLOBAL view applies across many reports, based on a generic Report ID specification.


The major use of logical views is in defining indexes, which is only performed on PUBLIC or GLOBAL views. An index defined to a PRIVATE view must match an index definition for a GLOBAL or PUBLIC view.

Creating a Logical View using the "VIEW COLS" Command
------------------------------------------------------

The first, and most simple, method of creating a logical view, which contains fewer options, is from the report browse, using the "VIEW COLS" command:

     CA-View Browse - REPORT01 ---- Rec 000000000 Pg 0000001.001 Lock 00 Col 001 080 
     Command ===> VIEW COLS                                        Scroll ===> PAGE 
    ********************************* Top of Data ********************************** 
    .SARPAGE 1                       DS=SYSPRINT.REXXSTEP.        /0000102          
    ... 

Using "VIEW COLS" results in the following partial definition elements. After the elements are entered, press [F3] to save the definition:

   CA-View Browse - REPORT01 ---- Rec 000000000 Pg 0000001.001 Lock 00 Col 001 080 
   Command ===>                                                  Scroll ===> PAGE 
     PSLINE    =>             PSCOL       =>             PSLEN       =>          
     EXCL RECS =>    H1 =>    H2 =>    H3 =>    H4 =>    H5 =>    H6 =>         
 ................................................................................ 
 Y............................................................................... 
 
 ********************************* Top of Data ********************************** 
 .SARPAGE 1                       DS=SYSPRINT.REXXSTEP.        /0000102          
 ... 
  • PSLINE, PSCOL, and PSLEN are used for the field to be indexed (PS - page separation). They are the line, the column start and length of the field.

  • EXCL RECS is the number of records to be excluded from the top of each page of the view.

  • H1 through H6 are six fields representing view column headings.

Creating a Logical View from a Report or the View Selection List
----------------------------------------------------------------

The second, and more comprehensive, method of creating a logical view begins by either browsing a report or by accessing the View Selection List.

  • From the report browse, you start by typing "VIEW" on the Command line:
          CA-View Browse - ABCCXCDE ---- Rec 000000000 Pg 0000001.001 Lock 00 Col 001 080 
           Command ===> VIEW                                             Scroll ===> PAGE 
          ********************************* Top of Data ********************************** 
          .                       DS=SYSUT2  .STEP1   .        /0000102                   
          .                      J E S 2  J O B  L O G  --  S Y S T E M  9 K 0 2  --  N O 
          .                                                                               
          .12.24.12 JOB36152 ---- TUESDAY,   17 JUL 2007 ----                             
          .12.24.12 JOB36152  IRR010I  USERID PBAY26   IS ASSIGNED TO THIS JOB.           
          .12.24.20 JOB36152  ICH70001I PBAY26   LAST ACCESS AT 12:23:41 ON TUESDAY, JULY 
          ... 
    NOTE: Accessing the View Definition this way, you will have the ability to create a Private view.

  • To access the View Selection List, type the "DEF VIEW" command, from the View Primary panel:
           CA-View ALL -- Primary Selection for PUBLIC.VIEWVD01 --------------------- 
           Command ===> DEF VIEW                                                    
     
           Sysout ID     ===> *                                                     
           Select By     ===> R                     (R, I, IL, or IR)               
           Index Name  ===>               Value ===>                              
                            ===>                       ===>                              
                            ===>                       ===>                              
                            ===>                       ===>                              
           ...  
    NOTE: Accessing the View Definition this way, you will NOT have the ability to create a Private view.

    From the command, you will be taken to the View Selection List panel:

         CA-View ALL ---------------- View Selection List ------------------------------ 
          Command ===>                                                 Scroll ===> PAGE
    
    Sel View ID Num Acc Description AAVIEW01 001 PUB TEST LOGICAL VIEW ASHDP100* 001 GBL ...
    You can then select an existing logical view by either placing an "S" to the left of it, in the list:

         Sel View ID                          Num Acc Description                        
          s  AAVIEW01                       001  PUB TEST LOGICAL VIEW     
    Or you can create a new logical view by typing "S viewname" on the Command line:

          CA-View ALL ---------------- View Selection List ------------------------------ 
          Command ===> S ASHDP100*                                      Scroll ===> PAGE 
    Sel View ID Num Acc Description AAVIEW01 001 PUB TEST LOGICAL VIEW ASHDP100* 001 GBL ...

View Definition Panel and its Fields
------------------------------------

Using either the browse or access method, you get the View Definition panel:

      CA-View ALL ------------------ View Definition -------------------------------- 
       Command ===>                                                                        
       View ID          ===> ASHDP100*                                              
       View Number   ===> 1                  Filter Name ===> 
       Private           ===> N  (Y/N)                 
       Description      ===>                                                                
       Display Attributes (Y/N):                                                      
          Default View        ===> N       Lock Left Column   ===> N                   
          Carriage Controls  ===> Y                                                   
       Data Extraction By Page:                                                       
          Pages   to Exclude  ===>        (Pages are excluded from top of file  )      
          Records to Exclude ===>        (Records are excluded from top of page)      
          Records to Display  ===>        (Leave blank for entire page)                      
       To select the following, enter the 1-character code on the command line:       
            H - Define primary heading         P - Define page separation criteria     
            C - Define column specifications  L - Define color specifications         

The fields on the View Definition panel are defined as follows:

. View ID -- The logical view ID name
View Number -- The number of the logical view, within the ID name
Filter Name -- The name of a filter associated with the view
Description -- A description on the logical view
Private (Y/N) -- Indicates if a logical view is to be private

NOTE: This field appears only when you are defining a logical View from within the browse of a report. When you create a view via the View Definition panel, you will not be shown this field.

Default View (N/Y) -- N: Not a default view;
Y: Make a default view.
Lock Left Column (N/Y) -- N: Left column can scroll off the screen;
Y: Prevents left column from scrolling off the screen.
Carriage Controls (Y/N) -- Y: Displays carriage control characters
N: Removes carriage control characters

Pages to Exclude -- Specify the number of pages you would like to exclude from the beginning of the report browse.

Records to Exclude -- Specify the number of records that you would like to exclude from the beginning of the report browse.

Records to Display -- Specify the number of records you would like to display on each page of the report browse.

NOTE: The number of "records" is different from the number of "lines" in that carriage control is not taken into account. Any double or triple spacing control character is ignored and each line is taken as it is presented.

Defining Fixed Headings
-----------------------

You can define fixed headings that will appear when you browse a report.
This is accomplished by typing "H" on the Command line:

       CA-View ALL ------------------ View Definition -------------------------------- 
       Command ===> H                                                                        
       View ID          ===> ASHDP100*                                              
       View Number   ===> 1                  Filter Name ===>                  
       Description     ===>                                                          
       ...       
       To select the following, enter the 1-character code on the command line:       
            H - Define primary heading         P - Define page separation criteria     
            C - Define column specifications  L - Define color specifications   

On the resulting panel, you can define a fixed heading by identifying its contents:

      CA-View ALL ------------------ View Definition ------------- Row 00001 of 00010 
       Command ===>                                                  Scroll ===> PAGE 
 
       View ID  ---> ASHDP100*                                                      
 
       Scroll Heading  ===> NO    (Specify Yes or No)                                 
 
       Primary Heading Specifications:                                                
       Sel Rec Pos Len Clr Hlt Text                                                   
            rrr   ppp lll                         
  • Scroll Heading (NO/YES) -- Prevents or allows the primary report heading from scrolling left or right.

    Rec -- The number of the record, on the logical page, from which data will
    be extracted for the heading.
    Pos -- The starting column number of the data to be extracted for the heading.
    Len -- The length of the data to be extracted for the heading.
    Clr -- The color to be used for the heading.
    Hlt -- Specifies whether highlighting is to be used for the heading.
    Text -- Specifies text for the heading. The text should be enclosed in
    single quotes.

Multiple headings can be defined for the logical view by defining multiple lines for the primary headings.

Defining Column Specifications
------------------------------

You can define sub-fields of data to be shown in the logical view by defining column specifications.
This is accomplished by typing "C" on the Command line:

       CA-View ALL ------------------ View Definition -------------------------------- 
       Command ===> C                                                                        
       
       View ID          ===> ASHDP100*                                              
       View Number   ===> 1                  Filter Name ===>                  
       Description     ===>                                                          
       ...       
       To select the following, enter the 1-character code on the command line:       
            H - Define primary heading         P - Define page separation criteria     
            C - Define column specifications  L - Define color specifications   

On the resulting panel, sub-fields are defined:

 CA-View ALL ------------------ View Definition ------------- Row 00001 of 00002 
       Command ===>                                             Scroll ===> PAGE 
 
       View ID  ---> ASHDP100*                                                      
 
       Default column heading record numbers and coloring information:                
         HED1 =>      HED2 =>      HED3 =>      HED4 =>      HED5 =>      HED6 =>     
         CLR1 =>      CLR2 =>      CLR3 =>      CLR4 =>      CLR5 =>      CLR6 =>     
         HLT1 =>      HLT2 =>      HLT3 =>      HLT4 =>      HLT5 =>      HLT6 =>     
       ...                                                                             
  • HED1 through HED6: Represent lines one through six in the default column headings.

  • CLR1 through CLR6: For each heading defined, a color attribute is assigned.

  • HLT1 through HLT6: For each heading defined, a highlight attribute is assigned.

Also on the panel, the columns of extracted data are defined:

...
Column Specifications:
Sel Pos Len Hdg Clr Hlt Text
. Pos -- The starting column number of the data to be extracted for display.
Len -- The length of the data to be displayed.
Hdg -- Y - Indicates that a custom heading was defined for the column.
-- - Indicates a custom heading was not defined.
Clr -- Specifies the color to be used for the column.
Hlt -- Specifies the highlighting to be used for the column.
Text -- Specifies constant text to appear in the column.

  • Multiple lines of columns can be defined, for what is to be shown in the logical view.

You can customize (that is, isolate and/or rearrange) what columns of data are being presented in the Column Specifications:

     ... 
      Column Specifications:      
     Sel Pos Len Hdg Clr Hlt Text 
           1  10 
          21  10 
          11  10 

In the above, only the first 30 columns of each line are presented. The data which originally occupied columns 11 through 20 is presented after the data in columns 21 through 30. The results are below:

      ********************************* Top of Data ********************************** 
      .Pg      1 01/27/2009 Ln      1 
      .Pg      1 01/27/2009 Ln      2 
      .Pg      1 01/27/2009 Ln      3 
      .Pg      1 01/27/2009 Ln      4 

Creation of Indexes
-------------------

The most-widely used option for logical views is the creation of indexes.

You begin defining indexes by typing "P" (for Page Separation Criteria) on the View Definition Command line:

       CA-View ALL ------------------ View Definition -------------------------------- 
       Command ===> P                                                                        
       View ID          ===> ASHDP100*                                              
       View Number   ===> 1                  Filter Name ===>                  
       Description      ===>                                                          
       ...       
       To select the following, enter the 1-character code on the command line:       
            H - Define primary heading         P - Define page separation criteria     
            C - Define column specifications  L - Define color specifications   

In the Search Specifications, you identify where the data to be indexed on is located.

In the Extraction Specifications, you identify what data will be extracted and used for the Index values and as to what will be the Index name.

       CA-View ALL -------- View Definition - Indexing Criteria --- Row 00001 of 0000 
       Command ===>                                                  Scroll ===> PAGE 
 
       View ID  ---> ABCCXCDE                                                        
       Cross Report Index ===> NO    (Specify YES or NO )                            
 
       Search Specifications:                                                        
          Begin  End  Begin    End                                                    
      Sel Line  Line  Column  Column  Op Text                 T R       
      Extraction Specifications:                Left    Upper                        
      Sel Index    Line  Column  Length Extract Justify Case                         

In the Search Specifications, you identify:

      Search Specifications:                                                        
         Begin  End   Begin   End                                                    
      Sel Line  Line  Column  Column  Op Text                 T R 

The beginning and ending lines.

  • The beginning and ending columns.

  • The operator: EQ (equal), NE (not equal), LK (like).

  • The text to be matched in either exact content (used with EQ or NE) or as to content type (# - numeric character, @ - alphabetic character, = - any character, etc.)
  • T is used to indicate multiple occurrences on a page:

  • Blank - for a single occurrence

  • M - for multiple occurrences.

  • R is used to indicate a "reference" character in the Extraction Specifications (for example, @).
In the Extraction Specifications, you identify:

Extraction Specifications: Left Upper
Sel Index Line Column Length Extract Justify Case

  • The Index Name.

  • The specific or relative line of the data to be extracted.

  • The specific or relative column of the data to be extracted.

  • The length of the data to be extracted.
  • The Extract option:


    . FIRST - Extract when a value changes


    . ALL - Extract all values (the default)


    . NBLK - Extract only non-blank occurrences

  • If the data is to be left-justified:


    . NO - Retains data as it is found (the default)


    . YES - Removes leading blanks
  • If the data is to be forced to upper case (capital) characters


    . NO - Retains data as it is found (the default)


    . YES - Forces data to upper case

A "reference" character (for example, @) is used as an anchor point, rather than a static location, to identify where the index text can be found:
          Extraction Specifications:                    Left    Upper                        
          Sel Index      Line   Column   Length Extract Justify Case             
              INDEX01    @+5      @+30    10     ALL     NO      NO 

For the above, when a text match is made per the Search Specifications, the index value can be found on subsequent pages, from the designated point, up to 5 lines lower and up to 30 columns further right.

This is most helpful when the indexed field does not appear on the same line or in the same columns in each occurrence.

After all the characteristics of the logical view have been defined, press [F3] until you are returned to the original View Definition panel.

On the Command line, you then save the logical view, designating a number for that view (starting with 1).

      CA-View ALL ------------------ View Definition -------------------------------- 
       Command ===> SAVE 1                                                                  
 
       View ID          ===> AAVIEW01                                              
       View Number   ===>              Filter Name ===> FILT01                  
                                       Secured     ===> N  (Y/N)        
       ...     

To then apply the logical view to the report, return to the Sysout Selection panel, and type "I" in the Select column:

      CA-View ALL --------------- Sysout Selection List ----------------------------- 
       Command ===>                                                  Scroll ===> PAGE         
       Sel  Sysout ID                        Arch Date  Time    Loc       Lines   Pages 
       ==>  *                                  *         *       *          *        *       
        I    ABCCXCDE                       10/11/2007 09:39  PERM       4483        3  
       ... 

After you then press [Enter], you will see the message "JCL created" in the top right corner:

       CA-View ALL --------------- Sysout Selection List ---------------- JCL created 
       Command ===>                                                  Scroll ===> PAGE        
       Sel  Sysout ID                        Arch Date   Time   Loc       Lines   Pages 
       ==>  *                                 *           *      *           *       *      
            ABCCXCDE                        10/11/2007 09:39 PERM         4483       3  
       ...  

To submit the JCL to create the index, type "SUB" on the Command line:

       CA-View ALL --------------- Sysout Selection List ----------------------------- 
       Command ===> SUB                                               Scroll ===> PAGE       
       Sel  Sysout ID                        Arch Date   Time  Loc       Lines   Pages 
       ==>  *                                 *            *    *            *       *      
              ABCCXCDE                       10/11/2007 09:39 PERM        4483       3  
       ... 

After pressing [Enter], the below panel will prompt for your job card:

       CA-View ALL ----------------- BATCH JOB JCL ----------------------------------- 
       COMMAND ===>                                                                  
 
       JOB STATEMENT INFORMATION:                                                     
         ===> //XXXXXXXX JOB ... 
         ===> //  

After pressing [Enter], the index job will be submitted.

To ensure that an index was created for the report, return to the Sysout Selection List and scroll to the right until you find the D T O I columns.

A "Y" in the I column indicates that an index was created:

       CA-View ALL --------------- Sysout Selection List ----------------------------- 
       Command ===>                                                  Scroll ===> PAGE 
 
       Sel  Sysout ID                        D T O I  ERO ID                          
       ==>  *                                * * * * *                               
              ABCCXCDE                       Y B    Y *                               
       ... 

Browsing Reports Using a Logical View
-------------------------------------

After a logical view (and index) are created, you can select View reports not only by their ID, but you can also select them based on their Index Name and Index Value.

Note: To select a report based on Index Name and/or Index Value, a logical view must specify YES in Cross-Report Indexing.

       CA-View ALL -- Primary Selection for PUBLIC.VIEWVD01 -------------------------- 
       Command ===>                                                   
 
       Sysout ID     ===> ABCCXCDE                                  
       Select By     ===> I                 (R, I, IL, or IR)    
       Index Name  ===> IDX1          Value ===> STATION000001 
                        ===>                          ===>          
                        ===>                          ===>            
                        ===>                          ===>    
       ... 

Selecting a report, using the below criteria:

       Sysout ID     ===> ABCCXCDE              
       Select By     ===> I                 (R, I, IL, or IR)     
       Index Name  ===> IDX1               Value ===> 

Results in the following list:

       CA-View ALL ---------------- Index Selection List ----------------------------- 
       Command ===>                                                   Scroll ===> PAGE 
 
      Sel IDX1                                                                     
          STATION000001        
          STATION000002            
          STATION000003    

Selecting a report, Using the below criteria:

      Sysout ID     ===> ABCCXCDE                                                           
      Select By     ===> R                   (R, I, IL, or IR)  
      Index Name    ===>                    Value ===>  

May result in the following list:

       CA-View ALL ---------------- View Selection List ----------- Row 00001 of 00002 
       Command ===>                                                  Scroll ===> PAGE   
         ID    ---> ABCCXCDE                                                          
         Index Value ===>                 
          Sel Num Acc View ID                     Description       
          000   PUB ABCCXCDE                      NATIVE BROWSE     
          001   PUB ABCCXCDE                      LOGICAL VIEW 1      

In the above list, the number 000 refers to the Native browse of the report, and the number 001 refers to the report version presented as is customized by logical view 001.

If you select a logical view, you will then be presented with a list similar to the following:

       CA-View ALL ------------- Page Index Selection List --------------------------- 
       Command ===>                                                   Scroll ===> PAGE 
 
         ID     ---> ABCCXCDE              
 
      Sel IDX1                                                                     
          *** ALL PAGES ***       
          STATION000001          
          STATION000002      
          STATION000003       

The "*** ALL PAGES ***" entry is similar to the native browse in that all pages of a report will be presented. Selecting one of the index values, under the index name, will display the pages that contain that value.

The above is only a brief overview of how to create logical views in CA-View.

For further information, please go to Chapter 7 of the View r11 Online User Guide.