The code you originally posted looks like it was designed to deterime the number of records in the text file, not the file size in bytes. You'll have a bit of trouble with this code under windows for a couple of reasons: 1. Your code specifies RECFM=F for the input file. This indicates that the text file has fixed length records, i.e. every line in the text file is exactly the same number of characters long. Windows doesn't produce fixed record files - windows text file are variable records length format (RECFM=V). So unless the file was created on another system (probably a mainframe) you should use RECFM=V instead of RECFM=F. 2. The default input buffer size on Windows is 256 bytes. If any individual record in the ext file is more than 256 bytes long, the record will be truncated in the input buffer. Specifying an input buffer size LARGER than the largest record has no ill effect other than consuming a few bytes more of memory. You can specify the input buffer size (Logical RECord Length) with the LRECL= option. 3. If, during a DATA step, you want to put a value into a macro variable for use in downstream program steps, you need a data step function like CALL SYMPUTX(). Try something like this: %let File=C:\Somefile.ext;
filename _in "&file" lrecl=32767;
data _null_;
infile _in end=last;
input;
ctr+1;
if last then call symputx('ctr',ctr);
run;
filename _in clear;
%PUT NOTE: &file contains &ctr records.;
... View more