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

Hello team,

I have inherited a code as below:

%mbrreconcile( indata               =work.somedataset,
                                             fld_patientNum         =  ,
                                             fld_patientmcdid      = ,
                                             fld_patientName = mbrName,
                                             fld_patientLastName = mbrLastNae,
                                      ......................
                                    ..........................

);

They told me that this macro matches the member. How could this macro do such a task?

I have always learned for matching to use joins. I wonder what syntax this is.

Can someone kindly please provide some instruction?

Regards,

blueblue

Blue Blue
1 ACCEPTED SOLUTION

Accepted Solutions
11 REPLIES 11
PaigeMiller
Diamond | Level 26

Please show us the code in the macro.

--
Paige Miller
GN0001
Barite | Level 11

PaigeMiller,

 

I have shown the code to you. It is exactly like what you see.

 

Regards,

blueblue

Blue Blue
SASKiwi
PROC Star

@GN0001 - What you've shown us is the code that calls the macro. What we need to see is the code that creates the macro in the first place.

PaigeMiller
Diamond | Level 26

@SASKiwi is correct.

 

We need to see the code inside the macro, not the code that calls the macro.

--
Paige Miller
ballardw
Super User

You ask about %mbrmatch but that is not the name of the macro you are calling. One suspects that your %mbrmatch may actually call the definition of one or more macros such as the one you show. If it doesn't have the definition code for the other macros you need to do some sleuthing.

 

Where is the code that starts

 

%macro mbrreconcile ( )

and ends with

%mend;

 

that is what defines the macro. If you have this macro in an Autocall macro library, which seems likely if you don't see the macro definition in the code you run, then you need to run

 

proc options option=SASautos;

run;

 

Which should show the path to any autocall libraries. Search in those folders for the definition of the macro you are using. This option would explain why you don't need to run the macro definition.

 

OR it may be called in your Autoexec.SAS for each session started.

GN0001
Barite | Level 11

Hello team,

Thanks for correcting me.

Mbrmatch was inside a macro, since it Mbrmatch had %, I thought it is a macro by itself.

 

This is what I have:

 

%macro get_data;

%do i = 1 %to &lst.

proc sql;

select strip(basefile) into: INFILEName from myfile where index=&i;

select strip(basefile) into: INFILEPath from myfile where index=&i;

quit;

%mbrmatch (indata = work.somedata,

                            fld_mbrID   = ,

                            fld_mbrName= ,

                            fld_mbrLastName= ,

                        ............................

                         );

 

proc sql;

create table thistable as

select ................

quit;

 

proc sql;

create table thattable as

select....

quit;

 

proc append

run;

 

%mend get_data;

%get_data;

quit;

 

I appreciate your response.

Regards,

Blueblue

 

 

 

Blue Blue
SASKiwi
PROC Star

We still need to see the code defining the MBRMATCH macro to know what it does.

Kurt_Bremser
Super User

Yes, it should be macro on its own, but you only have the CALL here, not the DEFINITION.

To assist you with the macro, we must see that definition.

GN0001
Barite | Level 11

hello kert,

 

What do you mean by saying: "Yes, it should be macro on its own,"?

 

What is the definition? 

 

That is the code I have in all the program for %mbr_match.

 

Regards,

blueblue

Blue Blue
Kurt_Bremser
Super User

Macros do not appear magically, they have to be defined within a %MACRO and %MEND statement:

%macro macroname (parameters);
/* macro code */
%mend macroname;
GN0001
Barite | Level 11

Hello team member,

I was told that it is too complicated for me and I don't need to learn it. They told me that it was written by a member from SAS institute.

Regards,

Blueblue

Blue Blue

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 11 replies
  • 1067 views
  • 7 likes
  • 5 in conversation