BookmarkSubscribeRSS Feed
PNWSkibum
Calcite | Level 5

Greetings SAS Community - 

Using 9.4 I am attempting to create a sequence of macro variables using PROC SQL and SELECT, INTO. I have successfully done the same numerous times in the past without problems. However, using the code below I am encountering the following in my log:

WARNING: INTO Clause :eplnkgtyp1_l through :eplnkgtyp1_88 does not specify a valid sequence of macro variables.
WARNING: INTO Clause :eplnkgtyp2_l through :eplnkgtyp2_88 does not specify a valid sequence of macro variables.
WARNING: INTO Clause :eplnkgnd1_l through :eplnkgnd1_88 does not specify a valid sequence of macro variables.
WARNING: INTO Clause :eplnkgnd2_l through :eplnkgnd2_88 does not specify a valid sequence of macro variables.

This, along with failure of my program to create the intended sequences of macro variables.

proc sql; select count(eplnk_1) into :eplnkcnt
from tbgms2.gms_all_&gmsdtaxprtdt._i5;
quit; %put &eplnkcnt;
%let eplnkscnt=%cmpres(&eplnkcnt); %put &eplnkcnt &eplnkscnt;

proc sql; select eplnkgtyp_1, eplnkgtyp_2, eplnkgnd_1, eplnkgnd_2 into
:eplnkgtyp1_l-:eplnkgtyp1_&eplnkscnt, :eplnkgtyp2_l-:eplnkgtyp2_&eplnkscnt,
:eplnkgnd1_l-:eplnkgnd1_&eplnkscnt, :eplnkgnd2_l-:eplnkgnd2_&eplnkscnt
from tbgms2.gms_all_&gmsdtaxprtdt._i5
where eplnk_1 ne ''
order by eplnk_1, eplnk_2;
quit;

All values of my SELECT variables are non-missing. EPLNK_1 and EPLNK_2 are reference identifiers for the data record in the subset of data I am querying (n=88). My series is required to be ordered as such, because each macro value in the series much be called in order of these identifiers.   Researching otherwise I have only found reference to this problem when case of the series naming is not consistent. This clearly is not the case here. I have also tried renaming my series variables, and trying with only a single SELECT variable and INTO series, all to no avail. I do not see how my code could otherwise violate any other SAS conventions (e.g. variable name length). If any of you have a clue where I am going wrong I would much appreciate your assist. Thanks and cheers to all - Shawn

5 REPLIES 5
SASKiwi
PROC Star

Look closely at this - eplnkgtyp1_l - looks like you have suffixed your starting macro variable with the letter "l" not the digit "1".

PNWSkibum
Calcite | Level 5

Thanks much, and sorry for the bother. Looks like its time to get my contact lens script updated. 

 

SASKiwi
PROC Star

@PNWSkibum  - LOL, please update this post as answered in that case.

Reeza
Super User
Something like this was how I knew I needed glasses in the first place 😄
SASKiwi
PROC Star

There's an advert series that runs over here where a character does something really stupid because they couldn't see properly. The punchline is - Should have gone to Specsavers 😀

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1477 views
  • 8 likes
  • 3 in conversation