BookmarkSubscribeRSS Feed
Quentin
Super User

Agree with Astounding %put _user_ could help.  And also a good suggestion to back off a bit on the macro quoting, unless you have special need for note.  Was going to suggest adding %unquote(), but since you use %SYSFUNC not %QSYFUNC all the quoting is removed at that point.

Here is what I see, cant see the slash anywhere. You can see the quoting that was applied to &Separator and &datafile.

16         %let Datafile=%str(pippo3.xlsx);
17         %let raw=/sasdata/Projects/share/AGSourcingExcelTool/Superuser;
18         %let separator = %str(/);
19         %let aa= %sysfunc(catx(&separator,%nrstr(%superq(raw)),%nrstr(%superq(Datafile))));
20         %put _user_;
GLOBAL SEPARATOR    
GLOBAL RAW /sasdata/Projects/share/AGSourcingExcelTool/Superuser
GLOBAL AA /sasdata/Projects/share/AGSourcingExcelTool/Superuser/pippo3.xlsx
GLOBAL DATAFILE  pippo3.xlsx 

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
Cynthia_sas
SAS Super FREQ

Hi:

  When I try your code (even though I do not think you need the CATX function), I do not get double slashes with either your complex example or any of the simple alternatives (using SAS 9.4).

cynthia


other_alternate_syntax.pngno_double_slash_94.png
Kurt_Bremser
Super User

Are you absolutely sure that the path works (eg copy it into a cd statement in telnet and the see if ls shows the file)? With that many capital letters there may be an error hiding.

Double slashes are usually compressed to single slashes by UNIX.

I rarely do more than filename xx "&path./&file"; and have no problems.

DonJefe68
Calcite | Level 5

Not to resurrect a thread, but I've got another piece of data on this:

%let crmms4dt=20140915;
%let crmms2dt=20140811;
%let datadir=/hli/ims/nbtz3jg/sla/prod/data/;

PROC IMPORT OUT=crm_ms4
            DATAFILE= "&datadir.Cumulative SLA Research Reports/Cum SLA Research Report &crmms4dt..xlsx"
            DBMS=XLSX REPLACE;
     SHEET="LLD";
     GETNAMES=YES;
     MIXED=NO;
RUN;

proc import out=crm_assign_request_9b
            DATAFILE= "&datadir.Trigger To Case Create Date/Dashboard CRM Daily &crmms2dt..xlsx"
            DBMS=XLSX REPLACE;
     SHEET="9B";
     GETNAMES=YES;
     MIXED=NO;
RUN;

The first one works and the second one doesn't, failing with the double slash file name error message.

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
  • 19 replies
  • 7798 views
  • 0 likes
  • 8 in conversation