DATA Step, Macro, Functions and more

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

Reply
Occasional Contributor
Posts: 13

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

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

Super User
Posts: 5,917

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

Posted in reply to abhityagi
?
Please exemplify!
Data never sleeps
Super User
Posts: 6,933

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

Posted in reply to abhityagi

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.  

Super User
Posts: 10,570

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

Posted in reply to abhityagi

Just out of curiosity: where did you get the notion that there is such a thing as "in1..a" in SAS?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Super User
Posts: 8,279

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

[ Edited ]
Posted in reply to abhityagi

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

Ask a Question
Discussion stats
  • 4 replies
  • 253 views
  • 0 likes
  • 5 in conversation