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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.