Fast/Unload with Model 204 file groups

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

If you have purchased the Fast/Unload SOUL Interface, you can directly unload groups with Fast/Unload. You can unload permanent groups, temporary groups, or ad hoc groups with this feature. No User Language changes are necessary to use groups with Fast/Unload. Fast/Unload automatically determines when a found set has a group context, and treats the group as a single database for the duration of the unload. This means that a single output data set is produced for the entire group unload.

All FUEL statements are supported with the use of groups, except the SORT and HASH options of UAI.

You should be aware of the following special considerations:

  • If a field referenced on a PUT statement does not exist in some of the databases in the group, the reference will be treated as a missing occurrence for each record in those files. This means that the PUT statement's MISSING clause will be executed for each record in those files in which the field is not defined.
  • The #RECIN variable will always be set to the current record number for the current file. The #RECIN variable is reset at the completion of each file in the group. So, for groups, there can be multiple records unloaded with the same #RECIN value.
  • The #RECOUT variable is not reset for the duration of a group unload. It always contains a running total of the number output records produced for the entire unload.
  • The #GRPSIZ variable contains the number of files in the group.
  • The #GRPMEM variable contains the number of the current file within the group (1 for the first file, etc.).
  • If you have any FUEL statements before the FOR EACH RECORD loop, those statements are executed once at the start of the job; they are not executed before each member in the group.
  • If you have any FUEL statements following the end of the FOR EACH RECORD loop, those statements are executed once at the end of the job; they are not executed at the end of each member in the group.
  • Field statistics are produced separately for each file in a group.
  • Date statistics are produced separately for each file in a group.
  • The FRECORD parameter only applies to the first file, if a group unload is being performed.

For example, the following FUEL program prints the number of records in each file and the total number of records in the group (the latter is somewhat silly, since the total number of records is available from the standard Fast/Unload summary messages):

OPEN INFILES %GTOT = 0 /* Initialize counters %FTOT = 0 FOR EACH RECORD IF %GRP NE #GRPMEM THEN /* New group member? %GTOT = %GTOT + %FTOT %FTOT = 0 %GRP = #GRPMEM END IF %FTOT = %FTOT + 1 END FOR %GTOT = %GTOT + %FTOT /* Include last file REPORT %GTOT AND 'records in group' REPORT #GRPSIZ AND 'files in group'

See also