MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CAF vs IKJEFT01

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
nthamizh
Beginner


Joined: 26 Dec 2002
Posts: 2
Topics: 1

PostPosted: Sat Dec 28, 2002 3:10 pm    Post subject: CAF vs IKJEFT01 Reply with quote

HI,
Can any one tell the difference in executing a DB2 program thru IKJEFT01 and thru CAF.

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12360
Topics: 75
Location: San Jose

PostPosted: Sat Dec 28, 2002 6:34 pm    Post subject: Reply with quote

nthamizh,

Running a DB2 program with IKJEFT01 is with the DSN command processor which is nothing but a TSO command processor that runs in TSO foreground or under TSO in JES-initiated batch. It uses the TSO attachment facility to access DB2.You can use the DSN command processor implicitly during program development for functions such as:


  • Using the declarations generator (DCLGEN)

  • Running the BIND, REBIND, and FREE subcommands on DB2 plans and packages for your program

  • Using SPUFI (SQL Processor Using File Input) to test some of the SQL functions in the program



The adavantages of the DSN command processor is that it runs with the TSO terminal monitor program (TMP). Because the TMP runs in either foreground or background, DSN applications run interactively or as batch jobs. Also it gives the following services.

  • Automatic connection to DB2
  • Attention key support
  • Translation of return codes into error messages


The disadvantages of the DSN command processor are:

  • When using DSN services, your application runs under the control of DSN. Because TSO executes the ATTACH macro to start DSN, and DSN executes the ATTACH macro to start a part of itself, your application gains control two task levels below that of TSO.
  • If DB2 is down, your application cannot begin to run.
  • If DB2 terminates, your application also terminates.
  • An application can use only one plan.


CALL ATTACHMENT FACILITY(CAF): It is an attachment facility which is a part of the DB2 code that allows other programs to connect to and use DB2 to process SQL statements, commands, or instrumentation facility interface (IFI) calls. With the call attachment facility (CAF), your application program can establish and control its own connection to DB2. Programs that run in MVS batch, TSO foreground, and TSO background can use CAF.

The advantages of a program using CAF can:



  • Access DB2 from MVS address spaces where TSO, IMS, or CICS do not exist.

  • Access DB2 from multiple MVS tasks in an address space.

  • Access the DB2 IFI.

  • Run when DB2 is down (though it cannot run SQL when DB2 is down).

  • Run with or without the TSO terminal monitor program (TMP).

  • Run without being a subtask of the DSN command processor (or of any DB2 code).

  • Run above or below the 16-megabyte line. (The CAF code resides below the line.)

  • Establish an explicit connection to DB2, through a CALL interface, with control over the exact state of the connection.

  • Establish an implicit connection to DB2, by using SQL statements or IFI calls without first calling CAF, with a default plan name and subsystem identifier.

  • Verify that your application is using the correct release of DB2.

  • Supply event control blocks (ECBs), for DB2 to post, that signal start-up or termination.

  • Intercept return codes, reason codes, and abend codes from DB2 and translate them into messages as desired.


Finally from the programmer point of view :

The main advantage of using TSO batch (IKJEFT*) is ease of coding. You save the step of having to call the Call Attach Facility (or another DB2 connection facility) to specify the DB2 subsystem to connect to and plan name you want to use. Obviously, the DSN/RUN commands handle this for you.

CAF has it edge when it comes to flexibility.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Sat Dec 28, 2002 10:59 pm    Post subject: Reply with quote

One of the main advantages of using CAF is the ability to determine the Plan Name at Execution Time as opposed to having to declare it when the JCL stream is created or submitted ( i.e. having to specify the plan in the input control statements provided by the SYSTSIN DDNAME ).
Back to top
View user's profile Send private message
nthamizh
Beginner


Joined: 26 Dec 2002
Posts: 2
Topics: 1

PostPosted: Sun Dec 29, 2002 3:34 am    Post subject: Reply with quote

Thanks Kolusu, for the informative write-up.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group