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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1654 views
  • 0 likes
  • 5 in conversation