BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

 

Hi. I have this reference to &ZIP5 that isn't resolving. It's inside of my Macro named Loopy, does this keep it from resolving?  Or maybe something to do with the statements being in quotes?

 

Any help would be appreciated.

 

MPRINT(LOOPY):   * Create unique index (if not exist), to meet the criteria that only one record (imb) per ;
MPRINT(LOOPY):   * rule is kept and counted in the data ;
MPRINT(LOOPY):   data _null_;
MPRINT(LOOPY):   set sashelp.vmember (where=(Libname='WORK' and memname='FINALDATA&ZIP5'));
MPRINT(LOOPY):   if upcase(index)='NO' then call execute('proc datasets; modify finaldata&ZIP5; index create imb_code /unique;
run; quit;');
MPRINT(LOOPY):   run;

NOTE: There were 0 observations read from the data set SASHELP.VMEMBER.
      WHERE (Libname='WORK') and (memname='FINALDATA&ZIP5');
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

1 ACCEPTED SOLUTION

Accepted Solutions
JohnHoughton
Quartz | Level 8
Try double quotes instead of single quotes

View solution in original post

3 REPLIES 3
jklaverstijn
Rhodochrosite | Level 12

Hi,

 

No way to know for sure until we get to see the full code. But a common oversight is to determine the scope of a variable. If it is not defined as global inside a macro the variable reference may not get resolved.

 

%GLOBAL zip5;

 But to get the full picture we need the code.

 

Regards,

- Jan

JohnHoughton
Quartz | Level 8
Try double quotes instead of single quotes
jklaverstijn
Rhodochrosite | Level 12
Ah yes. Doh!

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
  • 3 replies
  • 801 views
  • 2 likes
  • 3 in conversation