Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to create code to read data into SAS.

Status
Not open for further replies.

ChrisW75

Programmer
Dec 22, 2003
727
AU
Hi guys,
I spend ALOT of time writing SAS code to read data in to SAS, it's a tedious job, and one I'd like to avoid if I can.
I have this idea that it shouldn't be TOO difficult to write a script (say in Python or something similar) which could scan a file, work out what the delimiter is (or accept this as a parameter), calculate the lengths of the variables, whether they are numerics etc, and then put together the necessary SAS code to read the data in.
However, my scripting skills are a bit, well, crappy frankly, and it'll take me some time to write such a thing, so before I try this, I thought I'd see if anyone else has anything like this that they'd be prepared to share.
Anyone got anything like this?
Cheers
Chris.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
PS - Currently I use Excel to save me some of the donkey work, by pasting the header record in, transposing it and then using it to construct the length and input statements that I need.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top