BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
The worksheet name (which is &dat passed as parameter) has spaces in them. I used compress function in the data step to compress the spaces.But it doesnt seem to work and throws an error ,because sas will not support spaces in the dataset name.
any work around for this?
%macro import_caremark(dat);
PROC IMPORT OUT= &dat
DATAFILE= "&inpt.\MPB 2009 08 revised.xls"
DBMS=EXCEL REPLACE;
range"&dat$A3:M32";
GETNAMES=YES;
MIXED=yes;
SCANTEXT=YES;
USEDATE=no;
SCANTIME=YES;


RUN;
data %sysfunc(compress(&dat));
set %sysfunc(compress(&dat));
file_date=put(intnx('month',date(),-1),YYMMD7.);
run;
%mend;
%import_caremark(MPB Sales Report August09);
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Code a %LET statement before the PROC IMPORT to perform the compress on your &DAT variable.

Scott Barry
SBBWorks, Inc.

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