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
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

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1942 views
  • 0 likes
  • 2 in conversation