01-03-2018 03:19 PM - edited 01-03-2018 03:21 PM
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
01-05-2018 06:25 PM
Need further help from the community? Please ask a new question.