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 

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: 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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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