Read single observation from compressed dataset (.sas7bdat.gz)

Viewed 37

I need to run proc contents (interested in names and data types) on multiple large gzipped datasets on a machine with limited free disk space. Is it possible to read a single observation from the .sas7bdat.gz?

My current approach is:

filename zipf ZIP "/mypath/myfile.sas7bdat.gz" GZIP;
filename outf "%sysfunc(getoption(WORK))/myfile.sas7bdat";

data _null_;
  infile zipf lrecl=512 recfm=F length=length eof=eof;
    file outf lrecl=512 recfm=N;
  input;
  put _infile_ $varying512. length;
  return;
  eof: stop;
  run;
proc contents data=myfile; run;
0 Answers
Related