BookmarkSubscribeRSS Feed
michellel
Calcite | Level 5

Hi,

I have a question about input excel macro-enabled worksheet into SAS. My problem is for columns created in spreadsheet by VBA, they only show the first digit of numbers in SAS. For example, if it is 57 in spreadsheet, it will be shown as 5 in SAS after input them into SAS.

I did the following steps.

Firstly, when I try to save it as CSV (Comma delimited) file, Excel popped out a window saying the csv file may contain features that are not compatible with CSV. Do you want to keep the workbook in this format? I clicked Yes to saved it as CSV file.

Secondly, I input this CSV file into SAS, but for two variables created in EXCEL by VBA, it only shows the first digit of the number as I said above.

proc import datafile="C:\....\abc.csv"

   out=abc

   dbms=csv

   replace;

   getnames=yes;

run;

Could you give me some hint how to solve this problem. Thanks so much!

1 REPLY 1
SASKiwi
PROC Star

Have a look at the CSV file in a text editor like Notepad. What does it show for the column being truncated? Is it showing correctly and what is the format for it?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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