%macro LOBNoCode(lobname1,lobname2);
PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1TRANS (DROP=_NAME_);
ID MONTH;
BY LOB Category Code CODE_DESCRIPTION;
RUN;
%mend LOBNoCode;
%lobnocode(0100,'0100');
Got the error:
ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB, LABEL, LET, NAME, OUT, PREFIX,
SUFFIX.
Do no tknow why
table PAID_CLAIMS_FINAL0100 exisiting , no problem
@JHE wrote:
%macro LOBNoCode(lobname1,lobname2);
PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1TRANS (DROP=_NAME_);
ID MONTH;
BY LOB Category Code CODE_DESCRIPTION;
RUN;
%mend LOBNoCode;
%lobnocode(0100,'0100');
Got the error:
ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB, LABEL, LET, NAME, OUT, PREFIX,
SUFFIX.
Do no tknow why
It's always helpful to show us the entire SASLOG (or the relevant parts related to this PROC) and not just the ERROR message.
As a guess, what happens if you use this, where &lobname1 in the OUT= is followed by a period
PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1.TRANS (DROP=_NAME_);
attached
It is best to post code and log results into a code box using the forum {i} icon.
Many folks don't want to open Excel or Word documents because of security or corporate policy not allowing the download.
ok, will do . Thank you remind me.
On your OUT= designation, SAS doesn't know what the name of the macro variable is. Using lower/upper case isn't enough:
OUT=Paid_Claims_Final&lobname1TRANS
Instead, you have to tell SAS specifically where the name of the macro variable ends by adding a dot:
OUT=Paid_Claims_Final&lobname1.TRANS
This code works. ![]()
![]()
Thank you
%macro LOBNoCode(lobname1,lobname2);
PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1.TRANS (DROP=_NAME_);
ID MONTH;
BY LOB Category Code CODE_DESCRIPTION;
RUN;
%mend LOBNoCode;
%lobnocode(0100,'0100');
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.