Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Sat Dec 28, 2002 6:34 pm Post subject:
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.
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 ).
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