- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The aim of this code is just to get create a log file in the unix location but I've been getting this error.
These are the steps I've taken so far:
1. I checked the shared unix path to make sure I have access
2. Made sure the unix path is written correctly
3. made sure the folders were created and had read write rights.
4. I even created a dummy document but nothing seems to get rid of this error and the log displays nothing useful, just the below statements all over again.
All the posts in this forum regarding this error were mainly due to its usage in infile statement, so I couldn't find anything similar.
Would appreciate some help
filename pswrdfile "some password file location" ;
data _null_ ;
infile pswrdfile truncover;
input line :$50.;
call symputx('dtbspswrd',line);
run ;
%put & dtbspswrd ;
%let unix_path = some unix path location;
proc printto log = "&unix_path./log/prjname_log.txt";
run;
options nocenter source2 mlogic symbolgen nomprint;
Proc SQL;
CONNECT TO teradata (user="%sysget(USER)" password="& dtbspswrd." tdpid=aprtera mode=teradata);
CREATE TABLE def as
Select * From connection to teradata
(SELECT top 10 * FROM some_table);
DISCONNECT FROM TERADATA;
QUIT;
proc contents data= def;
run;
proc printto; run;
Adding log:
GOPTIONS ACCESSIBLE;filename pswrdfile "some password file location" ;
data _null_ ;
infile pswrdfile truncover;
input line :$50.;
call symputx('dtbspswrd',line);
run ;
NOTE: The infile PSWRDFILE is:Filename = some password file location,Owner Name = [my user id], Group Name = sasuser2,Last Modified = 06Dec2018;11:36:54,File Size (bytes) = 40NOTE: 1 record was read from the infile PSWRDFILE.The minimum record length was 40.The maximum record length was 40.NOTE: DATA statement used (Total process time): real time 0.01 secondscpu time 0.01 seconds
%put & dtbspswrd ;
SYMBOLGEN: Macro variable DTBSPSWRD resolves to {Encrypted password}
%let unix_path = some unix path location;
proc printto log = "&unix_path./log/prjname_log.txt";
SYMBOLGEN: Macro variable UNIX_PATH resolves to 'some unix path location'run;
ERROR: Physical file does not exist, some unix path location/log/prjname_log.txtNOTE: The SAS System stopped processing this step because of errors.
options nocenter source2 mlogic symbolgen nomprint;
Proc SQL;
CONNECT TO teradata (user="%sysget(USER)" password="& dtbspswrd." tdpid=aprtera mode=teradata);
CREATE TABLE def as
Select * From connection to teradata
(SELECT top 10 * FROM some_table);NOTE: Table WORK.DEF created, with 13 rows and 700 columns
DISCONNECT FROM TERADATA;
QUIT;
NOTE: PROCEDURE SQL used (Total process time):real time 15.30 secondscpu time 0.04 secondsproc contents data= def;
run;
proc printto; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you post your log with the errors?
you have a space after your ampersand
My first sujestion would be to change this:
password="& dtbspswrd."
to this:
password="&dtbspswrd."
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Space was a typo, I removed it, thanks. That didn't help with the error sadly. Also updated the logs. Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Make sure that the path....
some unix path location/log
....exists and is accessible out of the server context where your program executes from.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you execute the following code..
%put &unix_path./log;
...and then copy/paste the resolved path from the log 1:1 into WinSCP: Does this work?
Is the user you use with WinSCP the same than the one under which the SAS program executes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@astha8882000 wrote:
Ok so this warning is sorted. But the issue is still there 😞
So have you tried:
...and then copy/paste the resolved path from the log 1:1 into WinSCP: Does this work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I tried another method, creating the log file on a temporary sasmart location and then do a x "cp command. The log file did get created but it's not copying over to the unix_path location.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Read through what @Tom wrote. He's covering pretty much the possible root causes of why that's not working for you.
For testing: Instead of redirecting the log why don't you just first try with a simple filename statement writing "something" to the desired location. If that works then redirecting the log to such a location should work as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Where is your SAS program running? On the same server as the Unix file paths or some other computer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try inserting the "/" to before the macro variable , in case it does not resolve it along with "&unix_path"
proc printto log = "/&unix_path./log/prjname_log.txt";
run;