BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
France
Quartz | Level 8

dear all, 

 

I have imported an .XLSX file into SAS by the following code,

proc import datafile = 'C:\Users\70660\Desktop\Datastream_GB.xlsx' OUT=sa_step5.DATASTREAM_GB1 DBMS=XLSX replace;

Sheet='Total1';
RANGE='A1: I16458';
GETNAMES=YES;
run;

But I confuse what should I do if I expect to define the FORMAT of the variable during the proc import step. could you please give me some suggestions? 

 

thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

If you want to control how data is imported into SAS, you must not use the Excel file format. Export your data to a text file from Excel, and read that with a data step where you can set attributes as you please.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

If you want to control how data is imported into SAS, you must not use the Excel file format. Export your data to a text file from Excel, and read that with a data step where you can set attributes as you please.

Vince_SAS
Rhodochrosite | Level 12

It would be helpful if you could post a workbook with sample data, explain the results that you got, and explain the results that you want.

 

Vince DelGobbo

SAS R&D

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1169 views
  • 0 likes
  • 3 in conversation