BookmarkSubscribeRSS Feed
farwa
Calcite | Level 5

Hi, I am new to this software. I am trying to run a code but its giving me error that "Libref ALB is not assigned". If anyone can help me in this. How do I assign the Libref? I am trying to run the above code

I am attaching the screenshot of error.

sas sc.png

Following is the code I'm trying to run.

data ALB.N; set sample_farwa (keep=_ric date_time Ex_Cntrb_ID price volume bid_price ask_price Exch_Time where=(_ric="ALB.N"));
retain ap;
retain bp;
if Date_Time~=lag(Date_Time) then do; bp=.; ap=.; end;
if bid_price=. then bid_price=bp; else bp=bid_price; 
if ask_price=. then ask_price=ap; else ap=ask_price; 
z=100*mod(price,0.01); run;
1 REPLY 1
Tom
Super User Tom
Super User

Do you actually need to make a permanent dataset at this point?  If not then use a member name for the dataset that does not include period, like the name of the dataset you are reading in.  Names in SAS should only contain letters, digits and underscore and cannot start with a digit.

data ALB_N;
.... 

If you do want to make a permanent dataset then you should use a member name that is more meaningful than just the single letter N.   First you need to know what directory you want to write the dataset and use that directory name in the LIBNAME statement.

libname alb 'c:\myfiles\mydir\');
data alb.farwa_2 ;
  set sample_farwa ....

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 600 views
  • 0 likes
  • 2 in conversation