If you're running this from SAS Enterprise Guide, you can do something like this.
First, download the file into a known location on your server. I reference the SASUSER location here, but you could choose another path that you know you can navigate to.
filename census "%sysfunc(getoption(sasuser))/raw.txt";
proc http
url="https://www2.census.gov/programs-surveys/demo/tables/geographic-mobility/2015/county-to-county-migration-2011-2015/county-to-county-migration-flows/MCDxMCD_ager_US.txt"
method="GET"
out=census;
run;
I prefer PROC HTTP instead of FILENAME URL. It's a bit more code, but you have more control over the file name and destination.
In the Servers list, navigate your server's file system and find the file you just downloaded.
Double-click the file to add to your project. Then right-click and select Import Data.
In the Import Data wizard, select the Fixed Width option to set your column boundaries, then add the column names/attributes on the next page.
The wizard will generate DATA step code that you can then incorporate back into your original program -- and thus automate this step in the future. I recently wrote a How To article about importing fixed-width column data here. With this large file, be sure to follow my steps for tuning the performance of the import step.
Update: Follow @Reeza's instructions for the documented file layout -- save my steps here for when you have a file without any code template for the layout 🙂
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.