BookmarkSubscribeRSS Feed
Reeza
Super User

Are you learning how to clean data?

Other than that, this would be an exercise in futility. 

My suggestion would be to dump the file to Excel and clean it up by hand. 

 

There's not a heck of a lot of benefit to reading in a file of this nature, besides learning. It wouldn't be acceptable for a process that needs to be repeated on any sort of regular basis so it's most likely a one time import. 

 

Log the changes you make in Excel in a document, but fighting with this file will take more effort than it's worth IMO. 

art297
Opal | Level 21

The following worked for me. It simply includes a combination of tabs and pipes as delimiters:

 

data want;
  infile '/folders/myfolders/magnolia.txt' dlm='097c'x dsd;
  informat prefix $2.;
  informat name $25.;
  informat sci_name $25.;
  input prefix name sci_name sale_qty remnant code $ color $;
run;

Art, CEO, AnalystFinder.com

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!

How to Concatenate Values

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.

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
  • 1585 views
  • 1 like
  • 7 in conversation