|
Depends on the OS you are working with and of the file format. If you are
working on zOS with VSAM files, you can get the information you are
looking for. In win it is impossible. If you want to get the "number of
records", there has to be a kind of header file which contain that
information. VSAM clusters and all DBs are working with different kinds of
such structure informations. In win a sequential file is simple a
collection of bytes with many control-chars to mark "end-of-record", "end-
of-file" and more. If you want to get the number of records, you simple
count the "end-of-record" chars and you have it. There is no other
possibility. For sure you can control, which records you want to write to
a SAS dataset. So you read all records and check for "end-of-file". Only
if that trigger is true, you OUTPUT the record.
filename xxx "c:\daten\test.dat";
data last_record;
infile xxx truncover end=eof;
input line $120.;
if eof then do;
call symput("n_of_records",_n_);
output;
end;
run;
%put &n_of_records = number of records;
Gerhard
On Fri, 9 Jan 2009 13:19:41 +0100, yom <yomsas@GMAIL.COM> wrote:
>Dear all,
>
>Do you know if it is possible to get the number of lines of a csv file (or
>text file) without creating the whole sas table.
>I would like to create a sas table with only one observation whose values
>are those of the last line of this csv file. Do you know a quick method ?
>
>Thank you very much in advance.
>yom
|