Date: Sat, 17 Nov 2001 01:02:50 -0000
Reply-To: Puddin' Man <pudding_man@POSTMARK.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Puddin' Man <pudding_man@POSTMARK.NET>
Subject: Re: Second cousin, once removed, of Speed of SAS vs. COBOL vs.
C++
Date: Sat, 17 Nov 2001 01:02:50 +0000
Content-Type: text/plain; charset="iso-8859-1"
Larry Bertolini wrote:
> Can SAS "skip" directly to a desired record?
> On OS/390, I'd give a qualified "yes", if you are processing
> a file with RECFM=FBS. (the "S" indicating
> "Standard", i.e., no truncated blocks; in this context,
> "S" does *not* mean "Spanned")
>
> Using SAS 8.1 on OS/390 2.9, on an HDS Pilot 27
> (equivalent to an IBM 9672 R25)...
>
> Consider the following program, in which we
> attempt to skip the first 100,000 records.
> Each record is 175 bytes.
> There are two pairs of INFILE/INPUT statements:
> * pair 1 uses RECFM=N, to access the file as
> a binary stream
> * pair 2 uses FIRSTOBS
>
> (I commented out one pair for each run.)
>
> //FOODOG DD DSN=DBAT.D1480301.ADDRESSB,DISP=SHR
> //SYSIN DD *
> DATA _NULL_;
> /* pair 1 */
> INFILE FOODOG RECFM=N ;
> INPUT @17500001 FOODOG $CHAR175.;
> /* pair 2 */
> *INFILE FOODOG FIRSTOBS=100001;
> *INPUT @1 FOODOG $CHAR175.;
> PUT '----+----0';
> PUT _INFILE_;
> STOP;
> RUN;
>
> INFILE/INPUT method: #records skipped CPU time of SAS step
> -------------------- ---------------- --------------------
> RECFM=N; INPUT @1750001 10,000 0.22 sec
> FIRSTOBS=10001 10,000 0.25 sec
> RECFM=N; INPUT @17500001 100,000 0.22 sec
> FIRSTOBS=100001 100,000 0.42 sec
I'm not certain CPU time is the most important metric, here.
Why didn't you include EXCP's, which should reflect the
amount of data transferred from DASD to internal storage?
Puddin'
*******************************************************
*** Puddin' Man *** Pudding_Man@postmark.net *****
*******************************************************;
> Based on the fact that the "RECFM=N" program takes the same
> amount of CPU to skip 10,000 and 100,000 records, I'm
> tempted to infer that SAS is going directly to the desired
> record, and not reading/discarding prior records. (I admit,
> I haven't checked SMF data to confirm that.)
>
> The downside is that "RECFM=N" implies UNBUFFERED (no read ahead)
> processing, so it's not necessarily a good solution to Fred
> Gehm's appliction. [Of course, YMMV, based on LRECL, BLKSIZE,
> and the "smarts" of your disk subsystem, which may be capable of
> recognizing that your application is doing sequential access,
> and might start prefetching data into cache.] But I just
> wanted to point that it appears that SAS can go directly to
> a desired record.
|