BookmarkSubscribeRSS Feed
Durga_SAS
Fluorite | Level 6

I am using SAS EG 5.1.   when i am importing data from excel, along with data columns it is reading other columns and naming as A, B,C D... ETC.

 

Is there any option to restrict to read only the valid data colums from SAS?

 

Thanks,

Durga.

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You will find that it is Excel which is telling SAS these columns contain data not SAS.  What it is - per most Excel "features" - is things that are hidden behind the scenes, formats on cells, coloring and other formatting can indicate to Excel that there is "contents" in those cells - SAS just checks that information and reads in what Excel tells it contains data.  You can see this by highlighting all the columns to the right of your data which you can see don't contain data, highlight them and delete them.  The data will then import correctly.  It will be something small like formats on a cell or borders or something, Excel considers anything within a cell "data" not just a value.

 

Just to add an example.  If you create a new workbook, and in sheet 1 cell B2 you put:

=concatenate(A1,"")

What have we done here, well A1.value and B1.value both contain nothing.  However B1.formula does contain something, so Excel's datarange is set as A1:B1.  Now when SAS reads that in, it looks for that data range and reads it in, even though there is no variable.  Anything you put into a cell will cause Excel to presume that cell is part of the datarange.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 786 views
  • 0 likes
  • 2 in conversation