I need to know the difference between Multifetch and Prefetch. I have read the documentation and I am confused.
Can I use MultiFetch in batch jobs running on Z/OS?
For Multifetch in batch jobs, do I need any special parameters in my JCL.
Which is more efficient Multifetch or PreFetch?
Can I use Multifetch in CICS online programs?
What is the difference between PREFETCH = YES and PREFETCH = OLD
I coded a batch job and put in production.
I used MultiFetch 10 on a read statement against a Adabas file.
Here is the main loop:
READ MULTI-FETCH 10 INS-UV1 BY INS-POLICY-EXP-DATE = #START-DATE
IF INS-UV1.INS-POLICY-EXP-DATE > #END-DATE
ESCAPE BOTTOM /* last rec for date range
END-IF
Ignore cancelled policy.
IF INS-UV1.INS-POLICY-CANCL-DATE > 0
ESCAPE TOP
END-IF
RESET APPL-UV1 ENDRS-UV1 #APPL-FOUND#REPORT-PI#REPORT-INS #OUT-INSE-REC#ENDRS-KEY
PERFORM FIND-APPLICATION
IF #APPL-FOUND
PERFORM FIND-ENDRS
END-IF
PERFORM WRITE-EXTRACT-RECORD
END-READ /* Ins-policy read
This seems to work, but I did not code in the JCL any PREFETCH Commands. Do I need them? Am i really doing a MULTIFETCH in this batch program or is it being ignored.
PREFETCH is invoked via JCL. Multifetch may be invoked via JCL or at the statement level in Natural.
Yes, of course. Via JCL or Natural statements.
Via JCL, you specify PREFETCH=YES. For statement-level Multi-fetch, this JCL parameter is not necessary.
Under zOS, Prefetch can perform better.
Yes, at the Natural statement level.
PREFETCH=YES invokes (the newer) Multi-fetch; PREFETCH=OLD invokes (the older) PREFETCH.
To verify that Multi-fetch is being applied (batch or on-line), issue the TEST DBLOG command before and after running/executing your program. Look at the OP column of the report. An M signifies a Multi-fetched/physical call; a < signifies a logical call.
I believe that the statement-level specification will override the batch specification. You can verify this with TEST DBLOG (and then report back to us).
Both Prefetch and Multi-fetch are implementations of Adabas read-ahead processing. Adabas retrieves multiple records for each physical call, thereby reducing overhead. The end result for you is much shorter batch job elapsed times.