[Info-vax] READ and WRITE vs. SEARCH/OUTPUT

Arne Vajhøj arne at vajhoej.dk
Sat Jan 21 17:32:19 EST 2012


On 1/21/2012 11:29 AM, Phillip Helbig---undress to reply wrote:
> Imagine a file x.x like
>
> A
> A
> A
> B
> A
> A
> B
> A
> A
> A
> A
> B
>
> Would SEARCH x.x B /OUT=X.LIS be better than
>
> $  OPEN/READ IN X.X
> $  OPEN/WRITE OUT X.LIS
> $LOOP:
> $  READ/END=DONE IN REC
> $  IF REC .EQS. "B" THEN WRITE OUT REC
> $ GOTO LOOP
> $DONE:
> $  CLOSE IN
> $  CLOSE OUT
> $  EXIT
>
> Some tests indicate that SEARCH is much faster.  Can one depend on this
> always being the case?

DCL is interpreted. SYS$SYSTEM:SEARCH.EXE is compiled code. It seems
reasonable to expect that there exist a value N for which SEARCH is
faster than DCL for files with >=N lines.

Arne





More information about the Info-vax mailing list