BookmarkSubscribeRSS Feed
cathp
Calcite | Level 5

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

4 REPLIES 4
Tom
Super User Tom
Super User

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.

cathp
Calcite | Level 5

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

Reeza
Super User

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.

wmebenjaminjr3
Calcite | Level 5

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

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1111 views
  • 0 likes
  • 4 in conversation