You are here: Command Parameters > EOF

EOF

EOF or End of File causes the complete Extract command to be executed one more time after the end of the file has been reached. End of File is usually used in procedures when processing a file using the Group command.

This is normally used in situations where the information to be extracted cannot be determined until after a group of records has been processed.

Whenever the End of File command parameter is used, it is mandatory that all information to be extracted is collected and stored in variables or is based solely on variables (see Variables). Fields and ad-hoc expressions are not supported when using the EOF parameter.

Command Mode Syntax

End of File is abbreviated as “EOF”.

In the following example, the procedure will fill variables for each record with the required field information and then extract out the variables when a blank record is found. The procedure repeats the process for each address.

This process works if the pattern of blanks continues and the last line in the procedure also contains a blank. However, if the last line is not a blank, then the final address can be missed. In this situation, using EOF will force the Extract command to execute one additional time when the end of the file is reached, preventing the loss of the last address.

ADDRESS1=ADDRESSMAIN¿

ADDRESS2=ADDRESSMAIN¿

ADDRESS3=ADDRESSMAIN¿

ADDRESS4=ADDRESSMAIN¿

COUNTER=0¿

GROUP IF ADDRESSMAIN=" "¿

EXTRACT ADDRESS1 ADDRESS2 ADDRESS3 ADDRESS4 TO OUT EOF¿

COUNTER=0¿

ELSE IF COUNTER=0¿

ADDRESS1=ADDRESSMAIN¿

ADDRESS2=" "¿

ADDRESS3=" "¿

ADDRESS4=" "¿

COUNTER=1¿

ELSE IF COUNTER=1¿

ADDRESS2=ADDRESSMAIN¿

COUNTER=2¿

ELSE IF COUNTER=2¿

ADDRESS3=ADDRESSMAIN¿

COUNTER=3¿

ELSE IF COUNTER=3¿

ADDRESS4=ADDRESSMAIN¿

COUNTER=4¿

END¿

Command Dialog Box

The EOF checkbox is available by clicking the [More] button.