APIs (Application Programmer Interfaces) for Faver 2 VSE
search cancel

APIs (Application Programmer Interfaces) for Faver 2 VSE

book

Article ID: 38217

calendar_today

Updated On:

Products

FAVER VSAM Data Protection

Issue/Introduction

In order to provide the ultimate in flexibility and adaptability, the selection of data sets for backup and restore can be accomplished using the FAVER2 Application Programmer Interface (API).  FAVER2 provides execs that you can call from your own execs in order to make comprehensive backup/restore decisions. FAVER2 API  also includes several general purpose execs you can use to create custom reports. And you can build your own interfaces to other products that provide execs and/or REXX ADDRESS environments.

FAVER2 Execs and USER Execs

There are two types of execs within FAVER2. We describe the two types as FAVER2 execs and USER execs.

FAVER2 execs are those that are already created for you within FAVER2. You just call the desired exec and it will perform that function. For example, the F2STORE exec performs the store function. Using the various parameters with each exec enables you to determine the specifics of what that exec will do. 

USER execs are those that you create. Using the power of REXX, you can create execs that can do just about anything within FAVER2. Once you create an exec, you can call it like any of the FAVER2 execs to perform that function. Some examples of user execs are shown in Chapter 8, "CA-FAVER2 Toolkit" of the CA-FAVER 2 for VSE User Guide

 

Environment

Component: FAVER2

Resolution

Executing the Execs


The execs must be compiled before they can be executed. We recommend to compile using
GSPDSU and to specify PDS SYS$MON in your standard labels.
Once compiled, you may execute the execs in batch by REXXBAT.
The following example executes the USER Exec called TEST after it was compiled.
 
// JOB EXECUTE MY EXEC    
// LIBDEF *,SEARCH=(TECLIB3.CA-FAVER2,TECLIB3.GSSLIB)
// EXEC REXXBAT                            
TEST        
/*

FAVER2 Execs and USER Execs combined may unleash the ultimate in Flexibility and adaptability.

The sample below will show the code required to create a USER Exec that will also makes use of
the REXX CALL command to call Faver2 Execs in creating your own USER exec.

Sample 1 - F2NOTEXP

F2NOTEXP only backs up data sets that have not expired. F2NOTEXP accepts a single volser as
a parameter. All SAM data sets are stored from the specified pack. You could modify this exec
to backup LIBR and DAM data sets, but ISAM and VSAM objects must be filtered out.

This exec will also use FAVER2 Execs:

. F2VTOC : Obtain a pack's volume table of contents.
. F2STORE : Back-up original disk datasets to the COPY file.
. F2PRINT : Print a line of output.
. F2XREF : Print the condition code cross-reference and command statistics.

/* F2NOTEXP */                                                    
CALL F2VTOC VOLSER                                                
  IF RESULT > 0 THEN EXIT RESULT                                  
     YEAR = SUBSTR(DATE('S'),1,2)                                 
      DO NUMBER = 1 TO &VTOC.0                                    
    EXPIRE_DATE = YEAR||&VTOC.F1EXPDT.NUMBER                      
    EXPIRE_DATE = DATE('B',EXPIRE_DATE)                           
  IF EXPIRE_DATE > DATE ('B') & &VTOC.F1FTYPE.NUMBER='SAM' THEN DO
CALL F2STORE                                                      
    'VOL('||VOLSER||')DSN('||&VTOC.F1DSN.NUMBER||')'              
    IF RESULT > 4 THEN EXIT RESULT                                
    END                                                           
END                                                               
CALL F2PRINT                                                      
CALL F2XREF                                                       
EXIT 0

Additional Information

Each of the FAVER2 execs are described in Chapter 5 "CA-FAVER2 API Reference" of the Faver 2 for VSE User Guide.