BookmarkSubscribeRSS Feed
vijayanand
Obsidian | Level 7

Hi,

 

I need to compare two different sas datasets lying in two different servers. One is Unix and the other one is in Windows.  I am running my sas session in windows , connecting to Unix using SAS/CONNECT to compare both the datasets.  The program is throwing an error that the local library is not recognised. Please find below the snippet.  The local directory was recognized by PROC DOWNLOADS but not by PROC COMPARE.

 

libname local "D:\test_dir";


%let rmtsrvr = xxxxxxxx xxxx;
options comamid=tcp remote=rmtsrvr;
signon user="xxxx" password="xxxxxxxxxxxxxxxxxxxxxx";

rsubmit;

libname rmt "/xxx/xxx/xxxx";

proc compare base=rmt.dt1 compare=local.dt1_t;
ID var1 var2;
run;

endrsubmit;

ERROR: Libref LOCAL is not assigned.

 

 

Thanks,

Vijay.

 

 

1 REPLY 1
Kurt_Bremser
Super User
libname local "D:\test_dir"; * this happens in your local session;


%let rmtsrvr = xxxxxxxx xxxx;
options comamid=tcp remote=rmtsrvr;
signon user="xxxx" password="xxxxxxxxxxxxxxxxxxxxxx";

rsubmit; * from here on everything happens in the remote session;

libname rmt "/xxx/xxx/xxxx";

proc compare base=rmt.dt1 compare=local.dt1_t;
* you never executed a libname for local in the remote session, so it does not have that libref;

ID var1 var2;
run;

endrsubmit;

You should do this instead:

libname local "D:\test_dir";

%let rmtsrvr = xxxxxxxx xxxx;
options comamid=tcp remote=rmtsrvr;
signon user="xxxx" password="xxxxxxxxxxxxxxxxxxxxxx";

libname rmt remote "/xxx/xxx/xxxx" server=rmtsrvr;

proc compare base=rmt.dt1 compare=local.dt1_t;
ID var1 var2;
run;

Now, everything executes locally, and the libref for rmt points to the SAS/CONNECT session.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 666 views
  • 0 likes
  • 2 in conversation