DATA Step, Macro, Functions and more

%macro?

Reply
Frequent Contributor
Frequent Contributor
Posts: 98

%macro?

My code:

 

%MACRO lobcodecount(lobname);

 

PROC SORT DATA=REWORKO.REWORK&lobname._CODECOUNT;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

 

PROC SORT DATA=Paid_Fina&lobnameTRANS;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

 

DATA REWORKO.REWORK&lobname._CODECOUNT_FINAL;

MERGE REWORKO.REWORK&lobname._CODECOUNT WORK.PAID_FINA&lobnameTRANS;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

 

%Mend lobcodecount;

%lobcodecount(0500);

 

WORK.Paid_Fina&lobnameTRANS;  macro varible &lobnameTRANS would not be able applyied.

why ?

 

Had the errors on Merger step.

 

Error message:

REWORKO.REWORK&lobname._CODECOUNT WORK.Paid_Fina&lobnameTRANS;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

_

22

200

WARNING: Apparent symbolic reference LOBNAMETRANS not resolved.

ERROR: File WORK.PAID_FINA.DATA does not exist.

ERROR: File WORK.LOBNAMETRANS.DATA does not exist.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, END, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

 

Super User
Posts: 19,878

Re: %macro?


JHE wrote:

 

200

WARNING: Apparent symbolic reference LOBNAMETRANS not resolved.

ERROR: File WORK.PAID_FINA.DATA does not exist.

ERROR: File WORK.LOBNAMETRANS.DATA does not exist.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, END, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

 


 

Do you have a macro variable "LOBNAMETRANS"?

 

If not, check the code and see if you forgot to include a period after the LOBNAME portion. 

Otherwise the macro processor can't tell if you're trying to use a macro variable named lobname or lobnametrans.

 

 

 

 

Frequent Contributor
Frequent Contributor
Posts: 98

Re: %macro?

you mean &lobname.trans?  &lobname i sMacro Varible.

Super User
Posts: 19,878

Re: %macro?

Try it Smiley Happy

Frequent Contributor
Frequent Contributor
Posts: 98

Re: %macro?

I resolved myself.

 

Paid_Fina&lobname.TRANS ---- name too long , change to Paid&lobname.TRANS  it works. Thank you all !

 

 

Ask a Question
Discussion stats
  • 4 replies
  • 72 views
  • 0 likes
  • 2 in conversation