BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChrisHemedinger
Community Manager

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.

 

serverlist.png

 

Double-click the file to add to your project.  Then right-click and select Import Data.

 

import.png

 

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.

 

importfw.png

 

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 🙂

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Cynthia_sas
Diamond | Level 26
Hi, Chris:
Remember that some EG users do not have WRITE access to the SASUSER library. This is why the certification guides have special instructions for how to bypass SASUSER and point to a different location.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 17990 views
  • 7 likes
  • 7 in conversation