SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Why some variable in list does not match type prescribeb

Reply
New Contributor
Posts: 2

Why some variable in list does not match type prescribeb

Hi,

I don't understand why SAS road variable in list does not match type prescribeb for this list.

It's all numeric data, but when i look in the librairy some data are in alphanum.. how can i change this ?

Capture d’écran 2015-06-13 à 22.48.48.png

In SAS, my data rc1 isnumeric, but not my other data like bg1

Capture d’écran 2015-06-13 à 22.46.02.png

Is't because i have 0 and . in my folder ?

Capture d’écran 2015-06-13 à 22.51.00.png

THanks and sorry for my english Smiley Happy

Super User
Super User
Posts: 7,039

Re: Why some variable in list does not match type prescribeb

How did you make the data set?

SAS is not going to convert the types of your variables, it will just do what you ask.  Now if you tried to use PROC IMPORT to have SAS guess about what type of data you have in a CSV or EXCEL file then you might end up with some variables being defined as character.  It is better to write your own program to read the data and then you have control over how the variables are defined.

New Contributor
Posts: 2

Re: Why some variable in list does not match type prescribeb

My data are all numeric (see my data in excel on the bottom), but when I put it in SAS university, SAS read the data bq1 bq2 bq3 bgm1 bgm2 bgm3 as alphanum. Why ?



Capture d’écran 2015-06-14 à 20.41.03.png

Super User
Posts: 19,789

Re: Why some variable in list does not match type prescribeb

Your numbers are left aligned, typically numbers are right aligned.  I'm guessing that Excel has the cells formatted as text and SAS is assuming those formats.  Try right aligning number and setting to numbers in Excel before import and see if that helps the import.

New Contributor
Posts: 2

Re: Why some variable in list does not match type prescribeb

in your first image Obs 13 has a period "." or rather a "Missing" value. check to see what value is in the input file. You may have an "O" (letter O) not a "0" number zero.

William E Benjamin Jr

SAS Press - William E. Benjamin, Jr. Author Page

Ask a Question
Discussion stats
  • 4 replies
  • 400 views
  • 0 likes
  • 4 in conversation