%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');
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.