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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 621 views
  • 0 likes
  • 2 in conversation