DATA Step, Macro, Functions and more

where is macro parameter resolving?

Reply
N/A
Posts: 0

where is macro parameter resolving?

%macro readvmf(dataread);

data abc&&cff&&veon;
infile &dataread missover lrecl=&reclen firstobs=2;
input @1 comp $char13.
@14 polno $char10.
@24 rectyp $char2.
@26 lob $char1.

%mend;

%macro outvmf(dataout);
data &&outdata (compress=yes);
set &dataout;
label comp ='Company ';
label company ='Code';
label polno ='Number';
label rectyp ='Type';

%mend;

%macro loadvmf;
%if &load = 1 %then %do;
%readvmf(indata1);
%outvmf(abc&&cff&&veon);
%end;

%mend;

%loadvmf;

I don’t understand where dataread and dataout (see text in bold,italic,underlined) are being created. There is nowhere that these parameters are being given a value. Can you please explain me this?
Super Contributor
Posts: 359

Re: where is macro parameter resolving?

%macro readvmf(dataread);
------------

They are the parameters you are feeding the macro.
%readvmf(indata1);
%outvmf(abc&&cff&&veon);

So they are "indata1" and whatever the abc thing resolves to. You will need to look at the source of the components of CFF and VEON.

And by the way, most of the double "&" are not needed in this context.
N/A
Posts: 0

Re: where is macro parameter resolving?

Thanks a lot. Got it.
Ask a Question
Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 2 in conversation