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 is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 19 replies
  • 7935 views
  • 0 likes
  • 8 in conversation