"Leonard S. Berkowitz" wrote:
>
> I need to extract the last record of a file into a second file.
>
> I can use
>
> PURGE file2
> FILE file2;SAVE
> PRINT file1;OUT=*file2;UNN;START=-1
>
> or
>
> PURGE file2
> SETVAR EOF_FILE1 FINFO ("file1","EOF) - 1
> FCOPY FROM=file1;TO=file2;SUBSET=!EOF_FILE1,1;NEW
>
> I assume that behind the scenes PRINT is doing stuff implicitly that I have to
> do explicitly for FCOPY.
>
> Which method is faster or more efficient or better. Is there a better way?
The POSIX solution would be simply:
tail -1 file1 >file2
- Mark B.