I just didn't want the OP to be in an infinite loop.
And, once they debug that, find out that the data wasn't there.

I was trying to be constructive.

-----Original Message-----
From: Ron and Jenny Hawkins <[EMAIL PROTECTED]>
Date:         Thu, 6 Oct 2005 23:16:45 
To:IBM-MAIN@BAMA.UA.EDU
Subject: Re: Summarize length of all variable length records in a file?

Ted,

Thanks for that, but I guess we all cannot be perfect...

> 
> First: L would not be a written variable.
> It should be:
> DATA LRECL00(KEEP=LEN);
>       INFILE IN LENGTH=L;
>   INPUT @ ;
>   LEN = L ;

True. Total brainfart on my behalf!

> 
> Second: @ holds the line. You don't want that! You'll be stuck on the
> first record forever. It should be:
>   INPUT; * this works *;

Not True. Holds the line within one iteration of the data step. 
INPUT @; Works - I just tested it, and I use it all the time.

> 
> Third: you don't need the OUTPUT statement. If you leave it out, all
> records are automagically written.
> If you specify it then if there are no conditions it's the same as not
> specifying it. With conditions, only if a record is explicitly output will
> it appear in the output file.

On Mainframe SAS, until Version 6, an OUTPUT statement would cause the Data
step to be compiled so that control was not returned to the SAS Supervisor
after each Data Step iteration. This would save oodles of CPU time,
especially back in 3081/4 and 200J days. With Version 6 the SAS Compiler
works as if there is an implicit OUTPUT Statement.

I still code this out of habit, and On SAS for Windows I did a quick test on
SAS 8.? about a year ago and found OUTPUT gives a slight improvement. I just
tested again on Version 9.1.3 - 3 times with OUTPUT and 3 without - and with
8.1 Million records there was a 3% increase in average CPU time when OUTPUT
was omitted. 

Good enough reason for me to stay with my old habits, but you are correct,
the code works without it.

Coding in SAS since 82.? And Barry's PDB since the Blue Book - it wasn't MXG
then :)

Ron

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

-teD

In God we Trust!
All others bring data!
 -- W. Edwards Deming

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to