Previous Topic: 7.3.2.1.3 Define Input/Output Processing (USRFMT3)

Next Topic: 7.3.2.1.5 Validate Your Code

7.3.2.1.4 Define Additional Process Code (USRFMT4-6)

The USRFMT4, USRFMT5, and USRFMT6 macros exist to support
site-specific requirements.  Use them if you need to perform
a function not directly related to translating input record
fields to output observations.

USRFMT4 - Input end-of-file code
--------------------------------

USRFMT4 is referenced in DYfdaFMT's main SAS DATA step.  The
code you put in USRFMT4 is executed at the time an
end-of-file on the input data set has been detected by SAS
and the last input observation has been processed.

USRFMT4 code should contain valid SAS logic suitable for
inclusion in a DATA step and must not begin with a label.
This macro is typically used to produce a run status report.
A run status report provides the number of records of each
type and subtype that were processed, records validity check
counts, and so on.

USRFMT5 - Post-format, pre-sort code
------------------------------------

After the main DATA step, USRFMT5 is referenced.  The
reference is followed by code that sorts the work file
versions of the component's files into the prescribed order
onto the DETAIL database.

Because this macro is referenced outside of an existing SAS
DATA or PROC step, it must contain DATA or PROC statements of
its own.

It can be used to analyze work files through SAS PROCs, such
as PROC CONTENTS or PROC FREQ, or it can:

  o contain DATA statements to process work files further,

  o incorporate additional control information, or

  o produce additional database files from the original work
    files created in the main DATA step.

On DATA statements, remember to use macros of the form

   ... &iiit..iiifffnn
            (%fffFILE(OP=FILEOPTS,TS=timespanname)) ...

and on PROC statements, remember to use macros of the form

   PROC SORT DATA=WORK.iiifffnn OUT=&iiit.iiifffnn
            (%fffFILE(OP=FILEOPTS,TS=timespanname));

when writing DETAIL timespan files to the database.

USRFMT6 - End of format routine code
------------------------------------

Like the USRFMT5 macro, the USRFMT6 macro is referenced
outside of an existing SAS DATA or PROC step, so it must
contain DATA or PROC statements of its own.

It can be used to analyze work files through SAS PROCs, such
as PROC CONTENTS or PROC FREQ, or it can:

  o contain DATA statements to process work files further,

  o incorporate additional control information, or

  o produce additional database files from the original work
    files created in the main DATA step.

On DATA statements, remember to use macros of the form

   ... &iiit..iiifffnn
            (%fffFILE(OP=FILEOPTS,TS=timespanname)) ...

and on PROC statements, remember to use macros of the form

   PROC SORT DATA=WORK.iiifffnn OUT=&iiit.iiifffnn
            (%fffFILE(OP=FILEOPTS,TS=timespanname));

when writing DETAIL timespan files to the database.