%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');
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.