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

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!

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