Hello,
I have a dataset in the unix location by the name 'db_&cur_mon.' where cur_mon is a macro variable which gets the value MONYY. This dataset gets generated each month, and every month I need to copy the current months' dataset from its unix location to a windows shared drive location.
This is the function that I'm using (attached), but I get this error:
ERROR: File /unix link/TEMP/YES/db_&cur_mon..sas7bdat not a valid file
I'm assuming it's because I shouldn't be using a macro variable but am not sure how else can I perform this operation.
Appreciate all helping me understand this concept. Thank you!
%let abc=/unix link/TEMP/YES;
%let win=\\shard drive windows location\PILOT;
%SYSRPUT win=&win.;
&cur_mon cannot be resolved in the SAS session.
Since this now seems to be a .NET problem, I moved the post to the EG community. Maybe @ChrisHemedinger can help.
@AJ_Brien Do you have a log from the Copy Files task? If not, you might need to enable Application Logging (Tools->Options) to get a detailed log, and work with SAS Tech Support on this.
One other thing to try -- map a drive to your UNC path (\\server\path\file) and use the mapped drive instead of the "\\" notation.
What remote SAS/Connect session do you think the %SYSRPUT statement is going to execute in?
Did you actually run those %LET statements in the current SAS session before trying to run the copy task?
So I made some changes and this is what I did:
%let path_unix=unix path;
%SYSRPUT path_unix=&path_unix.;
%let path_win = \\windows shared drive path;
%SYSRPUT path_win=&path_win.;
%let MON = %sysfunc(intnx(month, %sysfunc(today()),0), monyy5.);
%SYSRPUT MON=&MON.;
Now when I use the copy task to move my dataset from &path_unix./ABC_&mon..sas7bdat to &path_win.
it gives me the error:
ERROR: Object reference not set to an instance of an object.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.