06-01-2016 09:07 AM
I am trying to use an %INCLUDE statement on Linux with an uppercase pathname (which is forced on me, because all user directories start like this). I keep getting "WARNING: Physical file does not exist, '/server1/home/ms/userx/file.txt'. ERROR: Cannot open %INCLUDE file INCL1.", so I assume the problem is with the uppercase pathname, I thought from the documentation that this should be fine if I use quotation marks (I also tried "..." instead of '...' - what I do below works in an interactive session using "...", but not '...', but somehow in batch mode neither seems to work). Or is it something else that I am doing wrong??
My code is something like
filename incl1 '/SERVER1/home/ms/userx/file.txt';
proc iml; %include inc1; quit;
and I also tried
proc iml; %include '/SERVER1/home/ms/userx/file.txt'; quit;
I cannot really get around using an include statement, because I need to use a submit statement in PROC IML in order to run some R code via PROC IML (and it appears I cannot have my submit/endsubmit code inside a macro, which this needs to be embedden in for some other reasons to do with parallelizing some simulations). The content of file.txt is some R code plus the submit/endsubmit statements, say:
submit / R; abc <- 1:15 endsubmit;
06-01-2016 09:19 AM
Are you 100% sure that this file exists with your spelling/casing?
And the user that executes the SAS program has access?
Just to rule out the possibility of that is the error message that change the case, not the filename/%include...
Have you tried other files/locations?
06-01-2016 09:53 AM
Thanks, using "~..." was a great suggestion. That worked and solved my very specific problem, I guess a more general answer would be useful for the future, too, but I will accept this as the solution for my current problem.
06-01-2016 09:52 AM
Can you run some Unix commands from SAS to see what is going on?
data _null_; input cmd $80. ; infile cmd pipe filevar=cmd end=eof; put cmd=; do while (not eof); input ; put _infile_; end; cards; pwd ls -ld ~ ls -ld /server1/home ls -ld /SERVER1/home ;;;;
Need further help from the community? Please ask a new question.