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

APIs (Application Programmer Interfaces) for CA Faver 2 for VSE

book

Article ID: 38217

calendar_today

Updated On:

Products

FAVER VSAM Data Protection

Issue/Introduction

Summary:

In order to provide the ultimate in flexibility and adaptability, the selection of data sets for backup and restore can be accomplished using the CA-FAVER2 Application Programmer Interface (API). CA-FAVER2 provides execs that you can call from your own execs in order to make comprehensive backup/restore decisions. FAVER2 API  CA-FAVER2 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.

CA-FAVER2 Execs and USER Execs

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

CA-FAVER2 execs are those that are already created for you within CA-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 CA-FAVER2. Once you create an exec, you can call it like any of the CA-FAVER2 execs to perform that function. Some examples of user execs are shown in Chapter 8, "CA-FAVER2 Toolkit."

 

Instructions:  

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                                                                                                                                                                                                                                    /*

CA-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 CA-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 CA-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 */

arg volser                                                                                                                                                                                                                            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 CA-FAVER2 execs are described in detail in Chapter 5, "CA-FAVER2 API Reference."

Linke to documentation https://support.ca.com/cadocs/1/d001151e.pdf

Environment

Release:
Component: FAVER2