Hi,
I have a huge .dat file of size 63G. Is it even possible to read into PC-SAS? My computer has 12G memory.
Thanks.
There are people with SAS datasets in the terabyte range. Output disc space and run time will likely be the issue.
I would recommend using an OBS option to try importing a few hundred records to make sure the formats and variables look right before loading the whole thing. Nothing like waiting a few hours for something to finish importing only to discover a variable was imported with 6 charcters instead of 12...
You can read it as long as you have enough disk space. If it is just a text file then you are better off writing the code to read it yourself. Or take a small set of sample records and run it through PROC IMPORT and pull back the generated code and clean it up and point it to the large file.
Thank you, Tom. It is a .dat file. I have the data library which tells the name, position, length and type of each variable.
I used data step, infile statement with obs=50, but it still took unbearably long time to get result.
OBS=50 on INFILE statement should cause it to stop pretty quickly.
You could try coding a STOP statement instead.
data small ;
infile 'big.dat' lrecl=100000 obs=50;
....
run;
or
data small ;
if _n_ > 50 then stop;
infile 'big.dat' lrecl=100000 ;
....
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.