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 🙂

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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