Thanks, you provided the macro in the code box.
However it would really help if you read and followed the rest of the instructions. We don't need the 50 or so lines of the log before %create_ipay_pct9 is called. We're trying to help you, but you have to help us.
MPRINT(CREATE_IPAY_PCT9): data ipay_pct9_2202504 (keep=pstn area nmbr vl);
MPRINT(CREATE_IPAY_PCT9): set ipay_pct9202504;
MPRINT(CREATE_IPAY_PCT9): if country not in (' ') or wert not= . then do;
MPRINT(CREATE_IPAY_PCT9): pstn = "(PCT2)";
MPRINT(CREATE_IPAY_PCT9): end;
MPRINT(CREATE_IPAY_PCT9): run;
NOTE: Variable country is uninitialized.
NOTE: Variable wert is uninitialized.
The macro fails because in the &input data set, there is no variable named COUNTRY and no variable named WERT, so SAS doesn't know what to do. In essence, this isn't a macro error, it is a BASE SAS error, you can't use variable names that don't exist in the data set.
Which brings up a discussion of "best practice" when writing macros. First you need to create code that works without macros and without macro variables, for one possible set of values if input, output and pstn_value. It appears you have not done that. Had you done that, you could fix that code and get it to work before writing the macro, based on working code. You need to do that and show us the working code without macros and without macro variables.
... View more