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 ....

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 868 views
  • 0 likes
  • 2 in conversation