FD interception technique


The FD Interception Technique allows QUICKSTART to manage sequential file activity with a minimum of program changes. The changes required are a replacement of the standard COBOL OPEN and CLOSE verbs with COBOL COPY verbs. These changes are shown below.

  • Replace each COBOL OPEN INPUT verb with the following:COPY QSOPENI REPLACING MYFD BY yourfd
    OR
    COPY QSOPNADV REPLACING MYFD BY yourfd

    for variable length files when the AWO compiler option is used.
    where yourfd is the COBOL FD name of the file to OPEN or CLOSE.

  • Replace each COBOL OPEN OUTPUT verb with one of the following:COPY QSOPENO REPLACING MYFD BY yourfd
    for normal output sequential files
    OR
    COPY QSOPNADV REPLACING MYFD BY yourfd
    for sequential files that use the AFTER ADVANCING/POSITIONING clause of the WRITE verb, or for Variable length files when the AWO compiler option is used, or for files with EXTERNAL attribute.
    where yourfd is the COBOL FD name of the file to OPEN or CLOSE.
  • Replace each COBOL CLOSE verb with one of the following:COPY QSCLOSE REPLACING MYFD BY yourfd
    for normal output sequential files
    OR
    COPY QSCLSADV REPLACING MYFD BY yourfd
    for sequential files that used QSOPNADV

    where yourfd is the COBOL FD name, of the file to OPEN or CLOSE.

To re-read the last record on an input file, issue a CALL in the format:

CALL QSFDRERE USING myfd, ioarea, QSFD {,ret-code} {,NoLLZZ}

where: myfd is the COBOL FD name, ioarea is the Working Storage variable name to receive the record, QSFD refers to the 01 level QSFD or QSFDADV, whichever is being used for this DD, ret-code is an optional parameter which returns a 3-character value of ‘EOF’ or ‘OK ’.

NoLLZZ is an optional parameter which tells QSFDRERE not to return the 4 byte length field contained on variable length records. It refers to a 1 byte field with a value of 'V'. If this operand is present, ret-code is required.

This API call to QSFDRERE exists because there is no COBOL verb to perform a reread. For information on when a re-read is necessary, see LUW-Set-based-sequential-file-input.

If the application program CALLs other COBOL subprograms, you must use the RES COBOL compiler option when using FD Interception.

When using QUICKSTART's COBOL FD Interception, the initial PERFORM of CKPTRTN must occur before any COBOL OPEN verbs are issued. Also, it is important to OPEN each file both during the initial run and during a restart run. It is equally important to CLOSE each file before the termination PERFORM of CKPT-RTN.

Note

During a restart when using FD Interception, all sequential files within a program are opened when the first file is opened using the COPY QSOPENx statement.

VS COBOL users must use the AT END clause on READ statements rather than inspecting the FILE-STATUS.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*