BookmarkSubscribeRSS Feed
abhityagi
Obsidian | Level 7

what is the difference between in1, in1.a and in1..a; in SAS.

4 REPLIES 4
LinusH
Tourmaline | Level 20
?
Please exemplify!
Data never sleeps
Astounding
PROC Star

in1 is just a name of something.  It's probably a variable name, but could be anything that would be named within a SAS program (a variable, a data set , an array).  So its meaning depends on the context within the program.

 

in1.a also depends on context.  In most cases, it is the data set A, stored within the library IN1.  But within SQL, it is the variable A stored within the data set IN1.  There may be other possibilities, but those are the main ones.

 

in1..a doesn't exist in SAS.  

Tom
Super User Tom
Super User

The place in SAS where you might see double periods like that would be when using macro variables to generate a string that needs to have a period in it.  For example if you had a macro variable than contained the library name and you wanted to generate a reference to particual dataset in that library.

 

libname mydata 'my path';
%let libref=mydata;
proc print data=&libref..myds;
run;

The first period is used by the macro processor to indicate the end of the macro variable name. So the result of "&libref..myds" is the string "mydata.myds". 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1705 views
  • 0 likes
  • 5 in conversation