BookmarkSubscribeRSS Feed
Mirisage
Obsidian | Level 7

Hi Community,

  • I have a data set “data.txt” (“txt” is the extension name)
  • It has 37 variables and 1.3 million customers (records)
  • I just opened the data set, and it automatically opened in notepad.
  • The "Heading record" is found as a continuous string like below.

"Bank number","Start date","Branch number","Person name", “Balance", and so on…….

(note that names of some variables are having spaces)

  • Each record of descriptor portion is also found as a continuous string as follows, seperated by commas.

77,22/2/2011 0:00:00,6,"JOHN JOSEPH", and so on……

First of all, I need to run some descriptive statistics in SAS and get some feel about the data set.

I have given the following command to read the data set in SAS.

data test;

     infile 'H:\Model_Building\data.txt' firstobs=2 dlm='09'x dsd;

     input

Bank number Current date Branch number Short name Balance ........

;

Run;

My question

  1. Is this approach correct?
  2. Name of a single variable has two names (how to handle this?)

Help is highly appreciated.

Thank you

Mirisage

3 REPLIES 3
sassharp
Calcite | Level 5

Would you try like this

proc import datafile='H:\Model_Building\data.txt' dbms=dlm out=work.test replace;

delimiter=",";

getnames=yes;

guessingrows=500;

run;

Mirisage
Obsidian | Level 7

Hi SASSHARP,

Thank you very much.

Mirisage

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 778 views
  • 0 likes
  • 2 in conversation