The periods are part of the macro code, not part of the name.
c_sample.rwa_p&pp.&yy._live
&pp. will resolve to the value of the PP macro variable
&yy. will resolve to the value of the YY macro variable.
So this code
%let PP=ABC ;
%let YY=15 ;
%put c_sample.rwa_p&pp.&yy._live ;
willl write
c_sample.rwa_pABC15_live
to the log. There is only one period in the resulting value.
The period is needed on the &YY reference to mark where the end of the macro name is. Otherwise the macro processor would look for a macro variable named YY_LIVE instead of YY. It is not required on the reference to PP since the & following PP will signal the end of the macro variable name.
Please post the code using the four level name.
What software are you running, this doesn't look like base SAS, perhap Enterprise Guide or something else? Does the code work? In base SAS it is always <library>.<dataset>
The periods are part of the macro code, not part of the name.
c_sample.rwa_p&pp.&yy._live
&pp. will resolve to the value of the PP macro variable
&yy. will resolve to the value of the YY macro variable.
So this code
%let PP=ABC ;
%let YY=15 ;
%put c_sample.rwa_p&pp.&yy._live ;
willl write
c_sample.rwa_pABC15_live
to the log. There is only one period in the resulting value.
The period is needed on the &YY reference to mark where the end of the macro name is. Otherwise the macro processor would look for a macro variable named YY_LIVE instead of YY. It is not required on the reference to PP since the & following PP will signal the end of the macro variable name.
That is not a 4 level name. Since there are macro variables involved (the && bits) the "." is a concatenator.
If there were two dots ".." in the code then the macro processor would resolve that to a . separating the names.
Something, possibly a prompt(?) or menu selection is building a name for you if you didn't create that code.
With c_sample.rwa_p&pp.&yy_live
if there is something set so that a macro variable PP = DOG and a variable YY_LIVE=SHOE this would resolve to
c_sample.rwa_pDOGSHOE. The first do does not have a possible macro variable before it but the second does.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.